summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlokilee73 <changjoo.lee@samsung.com>2019-02-22 04:11:50 (GMT)
committerlokilee73 <changjoo.lee@samsung.com>2019-02-22 04:12:16 (GMT)
commitc85f0a736fdebb805b5f12586b009ffa2a8f52e5 (patch)
treeab7579b1c5d29fcd68c3b9fa7afda67d8ba89a67
parentb955a220deccff8beb73c32bc4c320a4cd8d2c72 (diff)
downloadlibdevice-node-c85f0a736fdebb805b5f12586b009ffa2a8f52e5.zip
libdevice-node-c85f0a736fdebb805b5f12586b009ffa2a8f52e5.tar.gz
libdevice-node-c85f0a736fdebb805b5f12586b009ffa2a8f52e5.tar.bz2
Add thermistor feature for hal testrefs/changes/47/200347/1
Change-Id: I0247d1c74ae8f4eb0ab5e7df34f06b6f6a837b69 Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
-rw-r--r--unittest/device_haltests.cpp18
-rw-r--r--unittest/unittest.h1
2 files changed, 19 insertions, 0 deletions
diff --git a/unittest/device_haltests.cpp b/unittest/device_haltests.cpp
index 1dba1b4..3927d72 100644
--- a/unittest/device_haltests.cpp
+++ b/unittest/device_haltests.cpp
@@ -136,7 +136,10 @@ class THERMALHalTest : public testing::Test
public:
virtual void SetUp()
{
+ int ret;
+ ret = system_info_get_platform_bool(FEATURE_THERMISTOR, &supported);
+ EXPECT_EQ(SYSTEM_INFO_ERROR_NONE, ret) << "system_info_get_platform_bool failed";
}
virtual void TearDown()
@@ -740,6 +743,9 @@ TEST_F(THERMALHalTest, InitP)
{
int ret;
+ if (!supported)
+ return;
+
info = NULL;
ret = hw_get_info(THERMAL_HARDWARE_DEVICE_ID,
(const struct hw_info **)&info);
@@ -763,6 +769,9 @@ TEST_F(THERMALHalTest, GetInfoP)
struct thermal_info thermal;
int ret;
+ if (!supported)
+ return;
+
if (!thermal_dev || !thermal_dev->get_info) {
cout << "There is no function for get_info" << endl;
return;
@@ -780,6 +789,9 @@ TEST_F(THERMALHalTest, RegisterChangedEventP)
{
int ret;
+ if (!supported)
+ return;
+
if (!thermal_dev || !thermal_dev->register_changed_event) {
cout << "There is no function for register_changed_event" << endl;
return;
@@ -790,6 +802,9 @@ TEST_F(THERMALHalTest, RegisterChangedEventP)
TEST_F(THERMALHalTest, UnregisterChangedEventP)
{
+ if (!supported)
+ return;
+
if (!thermal_dev || !thermal_dev->unregister_changed_event) {
cout << "There is no function for unregister_changed_event" << endl;
return;
@@ -801,6 +816,9 @@ TEST_F(THERMALHalTest, DeinitP)
{
int ret;
+ if (!supported)
+ return;
+
if (!info || !info->close) {
cout << "There is no function for info close" << endl;
return;
diff --git a/unittest/unittest.h b/unittest/unittest.h
index e418093..9a2400b 100644
--- a/unittest/unittest.h
+++ b/unittest/unittest.h
@@ -25,6 +25,7 @@ extern "C" {
#define FEATURE_BATTERY "http://tizen.org/feature/battery"
#define FEATURE_LED "http://tizen.org/feature/led"
#define FEATURE_IR "http://tizen.org/feature/consumer_ir"
+#define FEATURE_THERMISTOR "http://tizen.org/feature/thermistor.ap"
bool supported;