utc-system-device-callback.c
utc-system-device-display.c
utc-system-device-power.c
+ utc-system-device-thermal.c
)
ENDIF()
utc-system-device-haptic.c
utc-system-device-led.c
utc-system-device-ir.c
+ utc-system-device-thermal.c
)
ENDIF()
capi-system-info
glib-2.0
dlog
-
)
INCLUDE_DIRECTORIES(
-device_add_callback
+device_add_callback
device_battery_get_level_status
device_battery_get_percent
device_battery_is_charging
device_battery_get_status
device_battery_get_property
device_display_change_state
-device_display_get_brightness
-device_display_get_max_brightness
-device_display_get_numbers
+device_display_get_brightness
+device_display_get_max_brightness
+device_display_get_numbers
device_display_get_state
-device_display_set_brightness
-device_flash_get_brightness
-device_flash_get_max_brightness
-device_flash_set_brightness
-device_haptic_close
-device_haptic_get_count
-device_haptic_open
-device_haptic_stop
-device_haptic_vibrate
-device_led_play_custom
-device_led_stop_custom
-device_power_release_lock
-device_power_request_lock
-device_power_wakeup
-device_remove_callback
+device_display_set_brightness
+device_flash_get_brightness
+device_flash_get_max_brightness
+device_flash_set_brightness
+device_haptic_close
+device_haptic_get_count
+device_haptic_open
+device_haptic_stop
+device_haptic_vibrate
+device_led_play_custom
+device_led_stop_custom
+device_power_release_lock
+device_power_request_lock
+device_power_wakeup
+device_remove_callback
+device_thermal_get_temperature
extern void utc_system_device_ir_startup(void);
extern void utc_system_device_battery_startup(void);
extern void utc_system_device_battery_cleanup(void);
+extern void utc_system_device_thermal_startup(void);
+extern void utc_system_device_thermal_cleanup(void);
extern int utc_system_device_add_callback_p(void);
extern int utc_system_device_add_callback_n_1(void);
extern int utc_system_device_ir_transmit_p(void);
extern int utc_system_device_ir_transmit_n_1(void);
extern int utc_system_device_ir_transmit_n_2(void);
+extern int utc_system_device_thermal_get_temperature_p(void);
+extern int utc_system_device_thermal_get_temperature_n(void);
testcase tc_array[] = {
{"utc_system_device_add_callback_p",utc_system_device_add_callback_p,NULL,NULL},
{"utc_system_device_ir_transmit_p",utc_system_device_ir_transmit_p,utc_system_device_ir_startup,NULL},
{"utc_system_device_ir_transmit_n_1",utc_system_device_ir_transmit_n_1,utc_system_device_ir_startup,NULL},
{"utc_system_device_ir_transmit_n_2",utc_system_device_ir_transmit_n_2,utc_system_device_ir_startup,NULL},
+ {"utc_system_device_thermal_get_temperature_p",utc_system_device_thermal_get_temperature_p,utc_system_device_thermal_startup,utc_system_device_thermal_cleanup},
+ {"utc_system_device_thermal_get_temperature_n",utc_system_device_thermal_get_temperature_n,utc_system_device_thermal_startup,utc_system_device_thermal_cleanup},
{NULL, NULL}
};
extern void utc_system_device_ir_startup(void);
extern void utc_system_device_battery_startup(void);
extern void utc_system_device_battery_cleanup(void);
+extern void utc_system_device_thermal_startup(void);
+extern void utc_system_device_thermal_cleanup(void);
extern int utc_system_device_add_callback_p(void);
extern int utc_system_device_add_callback_n_1(void);
extern int utc_system_device_ir_transmit_p(void);
extern int utc_system_device_ir_transmit_n_1(void);
extern int utc_system_device_ir_transmit_n_2(void);
+extern int utc_system_device_thermal_get_temperature_p(void);
+extern int utc_system_device_thermal_get_temperature_n(void);
testcase tc_array[] = {
{"utc_system_device_add_callback_p",utc_system_device_add_callback_p,NULL,NULL},
{"utc_system_device_ir_transmit_p",utc_system_device_ir_transmit_p,utc_system_device_ir_startup,NULL},
{"utc_system_device_ir_transmit_n_1",utc_system_device_ir_transmit_n_1,utc_system_device_ir_startup,NULL},
{"utc_system_device_ir_transmit_n_2",utc_system_device_ir_transmit_n_2,utc_system_device_ir_startup,NULL},
+ {"utc_system_device_thermal_get_temperature_p",utc_system_device_thermal_get_temperature_p,utc_system_device_thermal_startup,utc_system_device_thermal_cleanup},
+ {"utc_system_device_thermal_get_temperature_n",utc_system_device_thermal_get_temperature_n,utc_system_device_thermal_startup,utc_system_device_thermal_cleanup},
{NULL, NULL}
};
extern void utc_system_device_ir_startup(void);
extern void utc_system_device_battery_startup(void);
extern void utc_system_device_battery_cleanup(void);
+extern void utc_system_device_thermal_startup(void);
+extern void utc_system_device_thermal_cleanup(void);
extern int utc_system_device_add_callback_p(void);
extern int utc_system_device_add_callback_n_1(void);
extern int utc_system_device_ir_transmit_p(void);
extern int utc_system_device_ir_transmit_n_1(void);
extern int utc_system_device_ir_transmit_n_2(void);
+extern int utc_system_device_thermal_get_temperature_p(void);
+extern int utc_system_device_thermal_get_temperature_n(void);
testcase tc_array[] = {
{"utc_system_device_add_callback_p",utc_system_device_add_callback_p,NULL,NULL},
{"utc_system_device_ir_transmit_p",utc_system_device_ir_transmit_p,utc_system_device_ir_startup,NULL},
{"utc_system_device_ir_transmit_n_1",utc_system_device_ir_transmit_n_1,utc_system_device_ir_startup,NULL},
{"utc_system_device_ir_transmit_n_2",utc_system_device_ir_transmit_n_2,utc_system_device_ir_startup,NULL},
+ {"utc_system_device_thermal_get_temperature_p",utc_system_device_thermal_get_temperature_p,utc_system_device_thermal_startup,utc_system_device_thermal_cleanup},
+ {"utc_system_device_thermal_get_temperature_n",utc_system_device_thermal_get_temperature_n,utc_system_device_thermal_startup,utc_system_device_thermal_cleanup},
{NULL, NULL}
};
--- /dev/null
+//
+// Copyright (c) 2019 Samsung Electronics Co., Ltd.
+//
+// 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 "assert.h"
+#include <device/temperature.h>
+
+//& set: DeviceTemperature
+#define THERMAL_AP_FEATURE "http://tizen.org/feature/thermistor.AP"
+#define THERMAL_CP_FEATURE "http://tizen.org/feature/thermistor.CP"
+#define THERMAL_BATTERY_FEATURE "http://tizen.org/feature/thermistor.Battery"
+
+static bool ap_supported;
+static bool cp_supported;
+static bool battery_supported;
+
+
+/**
+ * @testcase utc_system_device_temperature_startup
+ * @since_tizen 5.5
+ * @description Called before each test
+ */
+void utc_system_device_thermal_startup(void)
+{
+ int ret;
+
+ ret = system_info_get_platform_bool(THERMAL_AP_FEATURE, &ap_supported);
+ ret = system_info_get_platform_bool(THERMAL_CP_FEATURE, &cp_supported);
+ ret = system_info_get_platform_bool(THERMAL_BATTERY_FEATURE, &battery_supported);
+
+ return;
+}
+
+/**
+ * @testcase utc_system_device_temperature_cleanup
+ * @since_tizen 5.5
+ * @description Called before each test
+ */
+void utc_system_device_thermal_cleanup(void)
+{
+
+ return;
+}
+
+/**
+ * @testcase utc_system_device_thermal_get_temperature_p
+ * @since_tizen 5.5
+ * @description Positive test case of utc_system_device_thermal_get_temperature.
+ */
+int utc_system_device_thermal_get_temperature_p(void)
+{
+ int value;
+ int error;
+
+ if(!ap_supported && !cp_supported && !battery_supported)
+ return 0;
+
+ if (ap_supported) {
+ error = device_thermal_get_temperature(DEVICE_THERMAL_AP, &value);
+ assert_eq(error, DEVICE_ERROR_NONE);
+ }
+
+ if (cp_supported) {
+ error = device_thermal_get_temperature(DEVICE_THERMAL_CP, &value);
+ assert_eq(error, DEVICE_ERROR_NONE);
+ }
+
+ if (battery_supported) {
+ error = device_thermal_get_temperature(DEVICE_THERMAL_BATTERY, &value);
+ assert_eq(error, DEVICE_ERROR_NONE);
+ }
+
+ return 0;
+}
+
+/**
+ * @testcase utc_system_device_thermal_get_temperature_n
+ * @since_tizen 5.5
+ * @description Negative test case of utc_system_device_thermal_get_temperature.
+ */
+int utc_system_device_thermal_get_temperature_n(void)
+{
+ int value;
+ int error;
+
+ if(!ap_supported && !cp_supported && !battery_supported)
+ return 0;
+
+ error = device_thermal_get_temperature(1000, &value);
+ assert_eq(error, DEVICE_ERROR_INVALID_PARAMETER);
+
+ return 0;
+}