haltest: Add test for radio 97/256197/10 accepted/tizen_6.5_unified accepted/tizen_7.0_unified accepted/tizen_7.0_unified_hotfix accepted/tizen_8.0_unified tizen_6.5 tizen_7.0 tizen_7.0_hotfix tizen_8.0 accepted/tizen/6.5/unified/20211028.115034 accepted/tizen/7.0/unified/20221110.062427 accepted/tizen/7.0/unified/hotfix/20221116.110336 accepted/tizen/8.0/unified/20231005.094421 accepted/tizen/unified/20210402.091050 submit/tizen/20210402.064427 submit/tizen_6.5/20211028.163201 tizen_6.5.m2_release tizen_7.0_m2_release tizen_8.0_m2_release
authorGilbok Lee <gilbok.lee@samsung.com>
Thu, 25 Mar 2021 02:43:42 +0000 (11:43 +0900)
committerGilbok Lee <gilbok.lee@samsung.com>
Fri, 2 Apr 2021 04:59:39 +0000 (13:59 +0900)
Change-Id: I7148222375cb1b183cb7e59f3276351805011532

CMakeLists.txt
packaging/hal-api-radio-haltests.manifest [moved from packaging/hal-api-radio-devel.manifest with 100% similarity]
packaging/hal-api-radio.spec
tests/CMakeLists.txt [new file with mode: 0644]
tests/radio_hal_test.cpp [new file with mode: 0644]

index f3e6f66..5608d5e 100644 (file)
@@ -1,5 +1,5 @@
 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
-PROJECT(hal-api-radio C)
+PROJECT(hal-api-radio)
 
 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
 SET(EXEC_PREFIX "${CMAKE_INSTALL_PREFIX}/bin")
@@ -43,3 +43,5 @@ INSTALL(TARGETS               ${PROJECT_NAME} DESTINATION ${LIBDIR}/hal)
 INSTALL(FILES          ${CMAKE_CURRENT_SOURCE_DIR}/include/hal-radio.h DESTINATION ${INCLUDEDIR}/hal)
 INSTALL(FILES          ${CMAKE_CURRENT_SOURCE_DIR}/include/hal-radio-interface.h DESTINATION ${INCLUDEDIR}/hal)
 INSTALL(FILES          ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}.pc DESTINATION ${LIBDIR}/pkgconfig)
+
+ADD_SUBDIRECTORY(tests)
\ No newline at end of file
index 240bafe..9ed60a6 100644 (file)
@@ -1,36 +1,45 @@
 %define module_name    radio
 %define name           hal-api-radio
-%define devel_name     hal-api-radio-devel
 
 ### main package #########
 Name:       %{name}
 Summary:    %{name} interface
-Version:    0.0.1
+Version:    0.0.2
 Release:    1
 Group:      Development/Libraries
 License:    Apache-2.0
 Source0:    %{name}-%{version}.tar.gz
 Source1:    %{name}.manifest
-Source2:    %{devel_name}.manifest
+Source2:    %{name}-haltests.manifest
 
 Requires(post): /sbin/ldconfig
 Requires(postun): /sbin/ldconfig
 BuildRequires: cmake
 BuildRequires: pkgconfig(dlog)
 BuildRequires: pkgconfig(hal-api-common)
+BuildRequires: pkgconfig(gmock)
+BuildRequires: pkgconfig(capi-system-info)
 
 %description
 %{name} interface
 
 ### devel package #########
-%package -n    %{devel_name}
+%package devel
 Summary:       %{name} interface
 Group:         Development/Libraries
 Requires:      %{name} = %{version}-%{release}
 
-%description -n        %{devel_name}
+%description devel
 %{name} Interface for product vendor developer
 
+### test package #########
+%package haltests
+Summary: tests for %{name}
+Requires: %{name} = %{version}
+
+%description haltests
+Haltests for %{name}
+
 ### build and install #########
 %prep
 %setup -q
@@ -62,9 +71,12 @@ rm -rf %{buildroot}
 %defattr(-,root,root,-)
 %{_libdir}/hal/*.so.*
 
-%files -n %{devel_name}
+%files devel
 %defattr(-,root,root,-)
-%manifest %{devel_name}.manifest
 %{_includedir}/hal/*.h
 %{_libdir}/hal/*.so
 %{_libdir}/pkgconfig/%{name}.pc
+
+%files haltests
+%manifest %{name}-haltests.manifest
+%{_bindir}/hal/radio-haltests
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
new file mode 100644 (file)
index 0000000..6cfba37
--- /dev/null
@@ -0,0 +1,21 @@
+SET(HAL_RADIO_HALTEST "radio-haltests")
+
+SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -Wall -Werror")
+
+AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/ HALTEST_SRCS)
+ADD_EXECUTABLE(${HAL_RADIO_HALTEST} ${HALTEST_SRCS})
+
+INCLUDE(FindPkgConfig)
+pkg_check_modules(${HAL_RADIO_HALTEST}_pkgs REQUIRED capi-system-info gmock)
+
+FOREACH(flag ${${HAL_RADIO_HALTEST}_pkgs_CFLAGS})
+       SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
+ENDFOREACH(flag)
+
+SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_CFLAGS} -fPIC -pie -Wall")
+
+TARGET_LINK_LIBRARIES(${HAL_RADIO_HALTEST} ${${HAL_RADIO_HALTEST}_pkgs_LDFLAGS} ${PROJECT_NAME})
+SET_TARGET_PROPERTIES(${HAL_RADIO_HALTEST} PROPERTIES COMPILE_FLAGS "-fPIE")
+SET_TARGET_PROPERTIES(${HAL_COMMON_HALTEST} PROPERTIES LINK_FLAGS "-pie")
+
+INSTALL(TARGETS ${HAL_RADIO_HALTEST} DESTINATION ${EXEC_PREFIX}/hal/)
diff --git a/tests/radio_hal_test.cpp b/tests/radio_hal_test.cpp
new file mode 100644 (file)
index 0000000..28cd1ae
--- /dev/null
@@ -0,0 +1,1000 @@
+/*
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Gilbok Lee <gilbok.lee@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <string.h>
+#include <gtest/gtest.h>
+#include <unistd.h>
+#include <iostream>
+#include <system_info.h>
+#include "hal-radio.h"
+#include "hal-radio-interface.h"
+
+using namespace std;
+
+int ret;
+
+void *hal_radio;
+bool radio_supported;
+
+#define RADIO_SUPPORT_CHECK \
+do {\
+       if (!radio_supported) {\
+               cout << "RADIO NOT SUPPORTED" << endl;\
+               return;\
+       }\
+} while (0)
+
+/*
+ * main class
+ */
+class RadioHalTest : public testing::Test
+{
+       public:
+               virtual void SetUp()
+               {
+                       radio_supported = false;
+
+                       system_info_get_platform_bool("http://tizen.org/feature/fmradio", &radio_supported);
+                       if (!radio_supported) {
+                               cout << "RADIO NOT SUPPORTED" << endl;
+                               return;
+                       }
+
+                       ret = hal_radio_get_backend(&hal_radio);
+                       if (ret != HAL_RADIO_ERROR_NONE) {
+                               cout << "radio hal get backend failed " << ret << endl;
+                               return;
+                       }
+
+                       ret = hal_radio_init(hal_radio);
+                       if (ret != HAL_RADIO_ERROR_NONE) {
+                               cout << "radio hal init failed " << ret << endl;
+                               return;
+                       }
+               }
+
+               virtual void TearDown()
+               {
+                       if (hal_radio) {
+                               ret = hal_radio_init(hal_radio);
+                               ret = hal_radio_put_backend(hal_radio);
+                               hal_radio = nullptr;
+                       }
+
+                       return;
+               }
+};
+
+/**
+ * @testcase           GetPutBackendP
+ * @since_tizen                6.5
+ * @author                     SR(gilbok.lee)
+ * @reviewer           SR(eunhae1.choi)
+ * @type                       auto
+ * @description                Positive, Deinitializes radio HAL handle
+ * @apicovered         hal_radio_get_backend, hal_radio_put_backend
+ * @passcase           when hal_radio_get_backend returns HAL_RADIO_ERROR_NONE
+ * @failcase           when hal_radio_get_backend does not return HAL_RADIO_ERROR_NONE
+ * @precondition       None
+ * @postcondition      None
+ */
+TEST_F(RadioHalTest, GetPutBackendP)
+{
+       void *hal_handle = nullptr;
+
+       RADIO_SUPPORT_CHECK;
+
+       ret = hal_radio_get_backend(&hal_handle);
+
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_NONE);
+       ASSERT_NE(hal_handle, nullptr);
+
+       ret = hal_radio_put_backend(hal_handle);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_NONE);
+       hal_handle = nullptr;
+}
+
+/**
+ * @testcase           InitP
+ * @since_tizen                6.5
+ * @author                     SR(gilbok.lee)
+ * @reviewer           SR(eunhae1.choi)
+ * @type                       auto
+ * @description                Positive, Initializes radio HAL handle
+ * @apicovered         hal_radio_init
+ * @passcase           when hal_radio_init returns HAL_RADIO_ERROR_NONE and the handle "h" is not a NULL pointer
+ * @failcase           when handle "h" is a NULL pointer
+ * @precondition       None
+ * @postcondition      None
+ */
+TEST_F(RadioHalTest, InitP)
+{
+       void *hal_handle = nullptr;
+
+       RADIO_SUPPORT_CHECK;
+
+       ret = hal_radio_get_backend(&hal_handle);
+
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_NONE);
+       ASSERT_NE(hal_handle, nullptr);
+
+       ret = hal_radio_init(hal_handle);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_NONE);
+
+       hal_radio_deinit(hal_handle);
+       hal_radio_put_backend(hal_handle);
+       hal_handle = nullptr;
+}
+
+/**
+ * @testcase           DeinitP
+ * @since_tizen                6.5
+ * @author                     SR(gilbok.lee)
+ * @reviewer           SR(eunhae1.choi)
+ * @type                       auto
+ * @description                Positive, Deinitializes radio HAL handle
+ * @apicovered         hal_radio_init, hal_radio_deinit
+ * @passcase           when hal_radio_deinit returns HAL_RADIO_ERROR_NONE
+ * @failcase           when hal_radio_deinit does not return HAL_RADIO_ERROR_NONE
+ * @precondition       None
+ * @postcondition      None
+ */
+TEST_F(RadioHalTest, DeinitP)
+{
+       void *hal_handle = nullptr;
+
+       RADIO_SUPPORT_CHECK;
+
+       ret = hal_radio_get_backend(&hal_handle);
+
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_NONE);
+       ASSERT_NE(hal_handle, nullptr);
+
+       ret = hal_radio_init(hal_handle);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_NONE);
+
+       ret = hal_radio_deinit(hal_handle);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_NONE);
+
+       hal_radio_put_backend(hal_handle);
+       hal_handle = nullptr;
+}
+
+/**
+ * @testcase           PrepareDeviceP
+ * @since_tizen                6.5
+ * @author                     SR(gilbok.lee)
+ * @reviewer           SR(eunhae1.choi)
+ * @type                       auto
+ * @description                Positive, Prepares device for device open
+ * @apicovered         hal_radio_prepare
+ * @passcase           when hal_radio_prepare returns HAL_RADIO_ERROR_NONE
+ * @failcase           when hal_radio_prepare does not return HAL_RADIO_ERROR_NONE
+ * @precondition       None
+ * @postcondition      None
+ */
+TEST_F(RadioHalTest, PrepareDeviceP)
+{
+       RADIO_SUPPORT_CHECK;
+
+       ASSERT_NE(hal_radio, nullptr);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_NONE);
+
+       ret = hal_radio_prepare(hal_radio);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_NONE);
+
+       hal_radio_unprepare(hal_radio);
+}
+
+/**
+ * @testcase           PrepareDeviceN
+ * @since_tizen                6.5
+ * @author                     SR(gilbok.lee)
+ * @reviewer           SR(eunhae1.choi)
+ * @type                       auto
+ * @description                Negative, Prepares device for device open
+ * @apicovered         hal_radio_prepare
+ * @passcase           when hal_radio_prepare returns HAL_RADIO_ERROR_INVALID_PARAMETER
+ * @failcase           when hal_radio_prepare does not return HAL_RADIO_ERROR_INVALID_PARAMETER
+ * @precondition       None
+ * @postcondition      None
+ */
+TEST_F(RadioHalTest, PrepareDeviceN)
+{
+       RADIO_SUPPORT_CHECK;
+
+       ASSERT_NE(hal_radio, nullptr);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_NONE);
+
+       ret = hal_radio_prepare(nullptr);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_INVALID_PARAMETER);
+}
+
+/**
+ * @testcase           UnprepareDeviceP
+ * @since_tizen                6.5
+ * @author                     SR(gilbok.lee)
+ * @reviewer           SR(eunhae1.choi)
+ * @type                       auto
+ * @description                Positive, Unprepares device for device open
+ * @apicovered         hal_radio_prepare, hal_radio_unprepare
+ * @passcase           when hal_radio_unprepare returns HAL_RADIO_ERROR_NONE
+ * @failcase           when hal_radio_unprepare does not return HAL_RADIO_ERROR_NONE
+ * @precondition       None
+ * @postcondition      None
+ */
+TEST_F(RadioHalTest, UnprepareDeviceP)
+{
+       RADIO_SUPPORT_CHECK;
+
+       ASSERT_NE(hal_radio, nullptr);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_NONE);
+
+       ret = hal_radio_prepare(hal_radio);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_NONE);
+
+       ret = hal_radio_unprepare(hal_radio);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_NONE);
+}
+
+/**
+ * @testcase           UnprepareDeviceN
+ * @since_tizen                6.5
+ * @author                     SR(gilbok.lee)
+ * @reviewer           SR(eunhae1.choi)
+ * @type                       auto
+ * @description                Negative, Prepares device for device open
+ * @apicovered         hal_radio_prepare, hal_radio_unprepare
+ * @passcase           when hal_radio_unprepare returns HAL_RADIO_ERROR_INVALID_PARAMETER
+ * @failcase           when hal_radio_unprepare does not return HAL_RADIO_ERROR_INVALID_PARAMETER
+ * @precondition       None
+ * @postcondition      None
+ */
+TEST_F(RadioHalTest, UnprepareDeviceN)
+{
+       RADIO_SUPPORT_CHECK;
+
+       ASSERT_NE(hal_radio, nullptr);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_NONE);
+
+       ret = hal_radio_prepare(hal_radio);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_NONE);
+
+       ret = hal_radio_unprepare(nullptr);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_INVALID_PARAMETER);
+
+       hal_radio_unprepare(hal_radio);
+}
+
+/**
+ * @testcase           OpenDeviceP
+ * @since_tizen                6.5
+ * @author                     SR(gilbok.lee)
+ * @reviewer           SR(eunhae1.choi)
+ * @type                       auto
+ * @description                Positive, Opens radio device
+ * @apicovered         hal_radio_prepare, hal_radio_open
+ * @passcase           when hal_radio_open returns HAL_RADIO_ERROR_NONE
+ * @failcase           when hal_radio_open does not return HAL_RADIO_ERROR_NONE
+ * @precondition       None
+ * @postcondition      None
+ */
+TEST_F(RadioHalTest, OpenDeviceP)
+{
+       RADIO_SUPPORT_CHECK;
+
+       ASSERT_NE(hal_radio, nullptr);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_NONE);
+
+       ret = hal_radio_prepare(hal_radio);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_NONE);
+
+       ret = hal_radio_open(hal_radio);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_NONE);
+
+       hal_radio_close(hal_radio);
+       hal_radio_unprepare(hal_radio);
+}
+
+/**
+ * @testcase           OpenDeviceN
+ * @since_tizen                6.5
+ * @author                     SR(gilbok.lee)
+ * @reviewer           SR(eunhae1.choi)
+ * @type                       auto
+ * @description                Negative, Opens radio device
+ * @apicovered         hal_radio_prepare, hal_radio_open
+ * @passcase           when hal_radio_open returns HAL_RADIO_ERROR_INVALID_PARAMETER
+ * @failcase           when hal_radio_open does not return HAL_RADIO_ERROR_INVALID_PARAMETER
+ * @precondition       None
+ * @postcondition      None
+ */
+TEST_F(RadioHalTest, OpenDeviceN)
+{
+       RADIO_SUPPORT_CHECK;
+
+       ASSERT_NE(hal_radio, nullptr);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_NONE);
+
+       ret = hal_radio_prepare(hal_radio);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_NONE);
+
+       ret = hal_radio_open(nullptr);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_INVALID_PARAMETER);
+
+       hal_radio_unprepare(hal_radio);
+}
+
+/**
+ * @testcase           CloseDeviceP
+ * @since_tizen                6.5
+ * @author                     SR(gilbok.lee)
+ * @reviewer           SR(eunhae1.choi)
+ * @type                       auto
+ * @description                Positive, Closes radio device
+ * @apicovered         hal_radio_prepare, hal_radio_open, hal_radio_close
+ * @passcase           when hal_radio_close returns HAL_RADIO_ERROR_NONE
+ * @failcase           when hal_radio_close does not return HAL_RADIO_ERROR_NONE
+ * @precondition       None
+ * @postcondition      None
+ */
+TEST_F(RadioHalTest, CloseDeviceP)
+{
+       RADIO_SUPPORT_CHECK;
+
+       ASSERT_NE(hal_radio, nullptr);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_NONE);
+
+       ret = hal_radio_prepare(hal_radio);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_NONE);
+
+       ret = hal_radio_open(hal_radio);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_NONE);
+
+       ret = hal_radio_close(hal_radio);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_NONE);
+
+       hal_radio_unprepare(hal_radio);
+}
+
+/**
+ * @testcase           CloseDeviceN
+ * @since_tizen                6.5
+ * @author                     SR(gilbok.lee)
+ * @reviewer           SR(eunhae1.choi)
+ * @type                       auto
+ * @description                Negative, Closes radio device
+ * @apicovered         hal_radio_prepare, hal_radio_open, hal_radio_close
+ * @passcase           when hal_radio_close returns HAL_RADIO_ERROR_INVALID_PARAMETER
+ * @failcase           when hal_radio_close does not return HAL_RADIO_ERROR_INVALID_PARAMETER
+ * @precondition       None
+ * @postcondition      None
+ */
+TEST_F(RadioHalTest, CloseDeviceN)
+{
+       RADIO_SUPPORT_CHECK;
+
+       ASSERT_NE(hal_radio, nullptr);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_NONE);
+
+       ret = hal_radio_prepare(hal_radio);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_NONE);
+
+       ret = hal_radio_open(hal_radio);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_NONE);
+
+       ret = hal_radio_close(nullptr);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_INVALID_PARAMETER);
+
+       hal_radio_close(hal_radio);
+
+       hal_radio_unprepare(hal_radio);
+}
+
+/**
+ * @testcase           StartP
+ * @since_tizen                6.5
+ * @author                     SR(gilbok.lee)
+ * @reviewer           SR(eunhae1.choi)
+ * @type                       auto
+ * @description                Positive, Starts radio
+ * @apicovered         hal_radio_prepare, hal_radio_open, hal_radio_start
+ * @passcase           when hal_radio_start returns HAL_RADIO_ERROR_NONE
+ * @failcase           when hal_radio_start does not return HAL_RADIO_ERROR_NONE
+ * @precondition       None
+ * @postcondition      None
+ */
+TEST_F(RadioHalTest, StartP)
+{
+       RADIO_SUPPORT_CHECK;
+
+       ASSERT_NE(hal_radio, nullptr);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_NONE);
+
+       ret = hal_radio_prepare(hal_radio);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_NONE);
+
+       ret = hal_radio_open(hal_radio);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_NONE);
+
+       ret = hal_radio_start(hal_radio);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_NONE);
+
+       hal_radio_stop(hal_radio);
+
+       hal_radio_close(hal_radio);
+
+       hal_radio_unprepare(hal_radio);
+}
+
+/**
+ * @testcase           StartN1
+ * @since_tizen                6.5
+ * @author                     SR(gilbok.lee)
+ * @reviewer           SR(eunhae1.choi)
+ * @type                       auto
+ * @description                Negative, Starts radio
+ * @apicovered         hal_radio_prepare, hal_radio_open, hal_radio_start
+ * @passcase           when hal_radio_start returns HAL_RADIO_ERROR_INVALID_PARAMETER
+ * @failcase           when hal_radio_start does not return HAL_RADIO_ERROR_INVALID_PARAMETER
+ * @precondition       None
+ * @postcondition      None
+ */
+TEST_F(RadioHalTest, StartN1)
+{
+       RADIO_SUPPORT_CHECK;
+
+       ASSERT_NE(hal_radio, nullptr);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_NONE);
+
+       ret = hal_radio_prepare(hal_radio);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_NONE);
+
+       ret = hal_radio_open(hal_radio);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_NONE);
+
+       ret = hal_radio_start(nullptr);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_INVALID_PARAMETER);
+
+       hal_radio_close(hal_radio);
+
+       hal_radio_unprepare(hal_radio);
+}
+
+/**
+ * @testcase           StartN2
+ * @since_tizen                6.5
+ * @author                     SR(gilbok.lee)
+ * @reviewer           SR(eunhae1.choi)
+ * @type                       auto
+ * @description                Negative, Starts radio
+ * @apicovered         hal_radio_start
+ * @passcase           when hal_radio_start returns HAL_RADIO_ERROR_DEVICE_NOT_OPENED
+ * @failcase           when hal_radio_start does not return HAL_RADIO_ERROR_DEVICE_NOT_OPENED
+ * @precondition       None
+ * @postcondition      None
+ */
+TEST_F(RadioHalTest, StartN2)
+{
+       RADIO_SUPPORT_CHECK;
+
+       ASSERT_NE(hal_radio, nullptr);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_NONE);
+
+       ret = hal_radio_start(hal_radio);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_DEVICE_NOT_OPENED);
+}
+
+/**
+ * @testcase           StopP
+ * @since_tizen                6.5
+ * @author                     SR(gilbok.lee)
+ * @reviewer           SR(eunhae1.choi)
+ * @type                       auto
+ * @description                Positive, Stops radio
+ * @apicovered         hal_radio_prepare, hal_radio_open, hal_radio_start, hal_radio_stop
+ * @passcase           when hal_radio_stop returns HAL_RADIO_ERROR_NONE
+ * @failcase           when hal_radio_stop does not return HAL_RADIO_ERROR_NONE
+ * @precondition       None
+ * @postcondition      None
+ */
+TEST_F(RadioHalTest, StopP)
+{
+       RADIO_SUPPORT_CHECK;
+
+       ASSERT_NE(hal_radio, nullptr);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_NONE);
+
+       ret = hal_radio_prepare(hal_radio);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_NONE);
+
+       ret = hal_radio_open(hal_radio);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_NONE);
+
+       ret = hal_radio_start(hal_radio);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_NONE);
+
+       ret = hal_radio_stop(hal_radio);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_NONE);
+
+       hal_radio_close(hal_radio);
+
+       hal_radio_unprepare(hal_radio);
+}
+
+/**
+ * @testcase           StopN1
+ * @since_tizen                6.5
+ * @author                     SR(gilbok.lee)
+ * @reviewer           SR(eunhae1.choi)
+ * @type                       auto
+ * @description                Negative, Stops radio
+ * @apicovered         hal_radio_prepare, hal_radio_open, hal_radio_start, hal_radio_stop
+ * @passcase           when hal_radio_stop returns HAL_RADIO_ERROR_INVALID_PARAMETER
+ * @failcase           when hal_radio_stop does not return HAL_RADIO_ERROR_INVALID_PARAMETER
+ * @precondition       None
+ * @postcondition      None
+ */
+TEST_F(RadioHalTest, StopN1)
+{
+       RADIO_SUPPORT_CHECK;
+
+       ASSERT_NE(hal_radio, nullptr);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_NONE);
+
+       ret = hal_radio_prepare(hal_radio);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_NONE);
+
+       ret = hal_radio_open(hal_radio);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_NONE);
+
+       ret = hal_radio_start(hal_radio);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_NONE);
+
+       ret = hal_radio_stop(nullptr);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_INVALID_PARAMETER);
+
+       hal_radio_stop(hal_radio);
+
+       hal_radio_close(hal_radio);
+
+       hal_radio_unprepare(hal_radio);
+}
+
+/**
+ * @testcase           StopN2
+ * @since_tizen                6.5
+ * @author                     SR(gilbok.lee)
+ * @reviewer           SR(eunhae1.choi)
+ * @type                       auto
+ * @description                Negative, Stops radio
+ * @apicovered         hal_radio_stop
+ * @passcase           when hal_radio_stop returns HAL_RADIO_ERROR_DEVICE_NOT_OPENED
+ * @failcase           when hal_radio_stop does not return HAL_RADIO_ERROR_DEVICE_NOT_OPENED
+ * @precondition       None
+ * @postcondition      None
+ */
+TEST_F(RadioHalTest, StopN2)
+{
+       RADIO_SUPPORT_CHECK;
+
+       ASSERT_NE(hal_radio, nullptr);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_NONE);
+
+       ret = hal_radio_stop(hal_radio);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_DEVICE_NOT_OPENED);
+}
+
+/**
+ * @testcase           SetFrequencyP
+ * @since_tizen                6.5
+ * @author                     SR(gilbok.lee)
+ * @reviewer           SR(eunhae1.choi)
+ * @type                       auto
+ * @description                Positive, Sets radio frequency
+ * @apicovered         hal_radio_prepare, hal_radio_open, hal_radio_start, hal_radio_stop, hal_radio_set_frequency
+ * @passcase           when hal_radio_set_frequency returns HAL_RADIO_ERROR_NONE
+ * @failcase           when hal_radio_set_frequency does not return HAL_RADIO_ERROR_NONE
+ * @precondition       None
+ * @postcondition      None
+ */
+TEST_F(RadioHalTest, SetFrequencyP)
+{
+       uint32_t freq = 95900;
+       RADIO_SUPPORT_CHECK;
+
+       ASSERT_NE(hal_radio, nullptr);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_NONE);
+
+       ret = hal_radio_prepare(hal_radio);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_NONE);
+
+       ret = hal_radio_open(hal_radio);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_NONE);
+
+       ret = hal_radio_start(hal_radio);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_NONE);
+
+       ret = hal_radio_set_frequency(hal_radio, freq);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_NONE);
+
+       hal_radio_stop(hal_radio);
+
+       hal_radio_close(hal_radio);
+
+       hal_radio_unprepare(hal_radio);
+}
+
+/**
+ * @testcase           SetFrequencyN
+ * @since_tizen                6.5
+ * @author                     SR(gilbok.lee)
+ * @reviewer           SR(eunhae1.choi)
+ * @type                       auto
+ * @description                Negative, Sets radio frequency
+ * @apicovered         hal_radio_prepare, hal_radio_open, hal_radio_start, hal_radio_stop, hal_radio_set_frequency
+ * @passcase           when hal_radio_set_frequency returns HAL_RADIO_ERROR_INVALID_PARAMETER
+ * @failcase           when hal_radio_set_frequency does not return HAL_RADIO_ERROR_INVALID_PARAMETER
+ * @precondition       None
+ * @postcondition      None
+ */
+TEST_F(RadioHalTest, SetFrequencyN)
+{
+       uint32_t freq = 100;
+       RADIO_SUPPORT_CHECK;
+
+       ASSERT_NE(hal_radio, nullptr);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_NONE);
+
+       ret = hal_radio_prepare(hal_radio);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_NONE);
+
+       ret = hal_radio_open(hal_radio);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_NONE);
+
+       ret = hal_radio_start(hal_radio);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_NONE);
+
+       ret = hal_radio_set_frequency(hal_radio, freq);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_INVALID_PARAMETER);
+
+       hal_radio_stop(hal_radio);
+
+       hal_radio_close(hal_radio);
+
+       hal_radio_unprepare(hal_radio);
+}
+
+/**
+ * @testcase           GetFrequencyP
+ * @since_tizen                6.5
+ * @author                     SR(gilbok.lee)
+ * @reviewer           SR(eunhae1.choi)
+ * @type                       auto
+ * @description                Positive, Gets radio frequency
+ * @apicovered         hal_radio_prepare, hal_radio_open, hal_radio_start, hal_radio_stop, hal_radio_set_frequency, hal_radio_get_frequency
+ * @passcase           when hal_radio_get_frequency returns HAL_RADIO_ERROR_NONE and result is same with previous set frequecny
+ * @failcase           when hal_radio_get_frequency does not return HAL_RADIO_ERROR_NONE
+ * @precondition       None
+ * @postcondition      None
+ */
+TEST_F(RadioHalTest, GetFrequencyP)
+{
+       uint32_t freq = 95900;
+       uint32_t getfreq = 0;
+       RADIO_SUPPORT_CHECK;
+
+       ASSERT_NE(hal_radio, nullptr);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_NONE);
+
+       ret = hal_radio_prepare(hal_radio);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_NONE);
+
+       ret = hal_radio_open(hal_radio);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_NONE);
+
+       ret = hal_radio_start(hal_radio);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_NONE);
+
+       ret = hal_radio_set_frequency(hal_radio, freq);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_NONE);
+
+       ret = hal_radio_get_frequency(hal_radio, &getfreq);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_NONE);
+       ASSERT_EQ(freq, getfreq);
+
+       hal_radio_stop(hal_radio);
+
+       hal_radio_close(hal_radio);
+
+       hal_radio_unprepare(hal_radio);
+}
+
+/**
+ * @testcase           GetFrequencyN
+ * @since_tizen                6.5
+ * @author                     SR(gilbok.lee)
+ * @reviewer           SR(eunhae1.choi)
+ * @type                       auto
+ * @description                Negative, Gets radio frequency
+ * @apicovered         hal_radio_prepare, hal_radio_open, hal_radio_start, hal_radio_get_frequency
+ * @passcase           when hal_radio_get_frequency returns HAL_RADIO_ERROR_INVALID_PARAMETER
+ * @failcase           when hal_radio_get_frequency does not return HAL_RADIO_ERROR_INVALID_PARAMETER
+ * @precondition       None
+ * @postcondition      None
+ */
+TEST_F(RadioHalTest, GetFrequencyN)
+{
+       RADIO_SUPPORT_CHECK;
+
+       ASSERT_NE(hal_radio, nullptr);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_NONE);
+
+       ret = hal_radio_prepare(hal_radio);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_NONE);
+
+       ret = hal_radio_open(hal_radio);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_NONE);
+
+       ret = hal_radio_start(hal_radio);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_NONE);
+
+       ret = hal_radio_get_frequency(hal_radio, NULL);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_INVALID_PARAMETER);
+
+       hal_radio_stop(hal_radio);
+
+       hal_radio_close(hal_radio);
+
+       hal_radio_unprepare(hal_radio);
+}
+
+/**
+ * @testcase           SeekUpP
+ * @since_tizen                6.5
+ * @author                     SR(gilbok.lee)
+ * @reviewer           SR(eunhae1.choi)
+ * @type                       auto
+ * @description                Positive, Seeks up frequency
+ * @apicovered         hal_radio_prepare, hal_radio_open, hal_radio_set_frequency, hal_radio_seek, hal_radio_get_frequency
+ * @passcase           when hal_radio_seek returns HAL_RADIO_ERROR_NONE and the result frequency is higher than the previous set frequency.
+ * @failcase           when hal_radio_seek does not return HAL_RADIO_ERROR_NONE
+ * @precondition       None
+ * @postcondition      None
+ */
+TEST_F(RadioHalTest, SeekUpP)
+{
+       uint32_t freq = 87500;
+       uint32_t getfreq = 0;
+       RADIO_SUPPORT_CHECK;
+
+       ASSERT_NE(hal_radio, nullptr);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_NONE);
+
+       ret = hal_radio_prepare(hal_radio);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_NONE);
+
+       ret = hal_radio_open(hal_radio);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_NONE);
+
+       ret = hal_radio_set_frequency(hal_radio, freq);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_NONE);
+
+       ret = hal_radio_seek(hal_radio, RADIO_SEEK_DIRECTION_UP);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_NONE);
+
+       ret = hal_radio_get_frequency(hal_radio, &getfreq);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_NONE);
+       ASSERT_LT(freq, getfreq);
+
+       hal_radio_close(hal_radio);
+
+       hal_radio_unprepare(hal_radio);
+}
+
+/**
+ * @testcase           SeekUpP
+ * @since_tizen                6.5
+ * @author                     SR(gilbok.lee)
+ * @reviewer           SR(eunhae1.choi)
+ * @type                       auto
+ * @description                Positive, Seeks up frequency
+ * @apicovered         hal_radio_prepare, hal_radio_open, hal_radio_set_frequency, hal_radio_seek, hal_radio_get_frequency
+ * @passcase           when hal_radio_seek returns HAL_RADIO_ERROR_NONE and the result frequency is lower than the previous set frequency.
+ * @failcase           when hal_radio_seek does not return HAL_RADIO_ERROR_NONE
+ * @precondition       None
+ * @postcondition      None
+ */
+TEST_F(RadioHalTest, SeekDownP)
+{
+       uint32_t freq = 108000;
+       uint32_t getfreq = 0;
+       RADIO_SUPPORT_CHECK;
+
+       ASSERT_NE(hal_radio, nullptr);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_NONE);
+
+       ret = hal_radio_prepare(hal_radio);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_NONE);
+
+       ret = hal_radio_open(hal_radio);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_NONE);
+
+       ret = hal_radio_set_frequency(hal_radio, freq);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_NONE);
+
+       ret = hal_radio_seek(hal_radio, RADIO_SEEK_DIRECTION_DOWN);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_NONE);
+
+       ret = hal_radio_get_frequency(hal_radio, &getfreq);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_NONE);
+       ASSERT_GT(freq, getfreq);
+
+       hal_radio_close(hal_radio);
+
+       hal_radio_unprepare(hal_radio);
+}
+
+/**
+ * @testcase           SeekN1
+ * @since_tizen                6.5
+ * @author                     SR(gilbok.lee)
+ * @reviewer           SR(eunhae1.choi)
+ * @type                       auto
+ * @description                Positive, Seeks up frequency
+ * @apicovered         hal_radio_prepare, hal_radio_open, hal_radio_set_frequency, hal_radio_seek
+ * @passcase           when hal_radio_seek returns HAL_RADIO_ERROR_INVALID_PARAMETER
+ * @failcase           when hal_radio_seek does not return HAL_RADIO_ERROR_INVALID_PARAMETER
+ * @precondition       None
+ * @postcondition      None
+ */
+TEST_F(RadioHalTest, SeekN1)
+{
+       uint32_t freq = 95900;
+
+       RADIO_SUPPORT_CHECK;
+
+       ASSERT_NE(hal_radio, nullptr);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_NONE);
+
+       ret = hal_radio_prepare(hal_radio);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_NONE);
+
+       ret = hal_radio_open(hal_radio);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_NONE);
+
+       ret = hal_radio_set_frequency(hal_radio, freq);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_NONE);
+
+       ret = hal_radio_seek(nullptr, RADIO_SEEK_DIRECTION_UP);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_INVALID_PARAMETER);
+
+       hal_radio_close(hal_radio);
+
+       hal_radio_unprepare(hal_radio);
+}
+
+/**
+ * @testcase           SeekN2
+ * @since_tizen                6.5
+ * @author                     SR(gilbok.lee)
+ * @reviewer           SR(eunhae1.choi)
+ * @type                       auto
+ * @description                Positive, Seeks up frequency
+ * @apicovered         hal_radio_seek
+ * @passcase           when hal_radio_seek returns HAL_RADIO_ERROR_DEVICE_NOT_OPENED
+ * @failcase           when hal_radio_seek does not return HAL_RADIO_ERROR_DEVICE_NOT_OPENED
+ * @precondition       None
+ * @postcondition      None
+ */
+TEST_F(RadioHalTest, SeekN2)
+{
+       RADIO_SUPPORT_CHECK;
+
+       ASSERT_NE(hal_radio, nullptr);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_NONE);
+
+       ret = hal_radio_seek(hal_radio, RADIO_SEEK_DIRECTION_UP);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_DEVICE_NOT_OPENED);
+}
+
+/**
+ * @testcase           GetSignalStrengthP
+ * @since_tizen                6.5
+ * @author                     SR(gilbok.lee)
+ * @reviewer           SR(eunhae1.choi)
+ * @type                       auto
+ * @description                Positive, Gets the radio signal strength
+ * @apicovered         hal_radio_prepare, hal_radio_open, hal_radio_start, hal_radio_get_signal_strength
+ * @passcase           when hal_radio_get_signal_strength returns HAL_RADIO_ERROR_NONE
+ * @failcase           when hal_radio_get_signal_strength does not return HAL_RADIO_ERROR_NONE
+ * @precondition       None
+ * @postcondition      None
+ */
+TEST_F(RadioHalTest, GetSignalStrengthP)
+{
+       int32_t getSignal = 0;
+       RADIO_SUPPORT_CHECK;
+
+       ASSERT_NE(hal_radio, nullptr);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_NONE);
+
+       ret = hal_radio_prepare(hal_radio);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_NONE);
+
+       ret = hal_radio_open(hal_radio);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_NONE);
+
+       ret = hal_radio_start(hal_radio);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_NONE);
+
+       ret = hal_radio_get_signal_strength(hal_radio, &getSignal);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_NONE);
+
+       hal_radio_stop(hal_radio);
+
+       hal_radio_close(hal_radio);
+
+       hal_radio_unprepare(hal_radio);
+}
+
+/**
+ * @testcase           GetSignalStrengthN
+ * @since_tizen                6.5
+ * @author                     SR(gilbok.lee)
+ * @reviewer           SR(eunhae1.choi)
+ * @type                       auto
+ * @description                Negative, Gets the radio signal strength
+ * @apicovered         hal_radio_prepare, hal_radio_open, hal_radio_start, hal_radio_get_signal_strength
+ * @passcase           when hal_radio_get_signal_strength returns HAL_RADIO_ERROR_INVALID_PARAMETER
+ * @failcase           when hal_radio_get_signal_strength does not return HAL_RADIO_ERROR_INVALID_PARAMETER
+ * @precondition       None
+ * @postcondition      None
+ */
+TEST_F(RadioHalTest, GetSignalStrengthN)
+{
+       RADIO_SUPPORT_CHECK;
+
+       ASSERT_NE(hal_radio, nullptr);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_NONE);
+
+       ret = hal_radio_prepare(hal_radio);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_NONE);
+
+       ret = hal_radio_open(hal_radio);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_NONE);
+
+       ret = hal_radio_start(hal_radio);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_NONE);
+
+       ret = hal_radio_get_signal_strength(hal_radio, nullptr);
+       ASSERT_EQ(ret, HAL_RADIO_ERROR_INVALID_PARAMETER);
+
+       hal_radio_stop(hal_radio);
+
+       hal_radio_close(hal_radio);
+
+       hal_radio_unprepare(hal_radio);
+}
+
+int main(int argc, char **argv)
+{
+       testing::InitGoogleTest(&argc, argv);
+
+       return RUN_ALL_TESTS();
+}