[UTC][device][ACR-622][Add battery status api TCs]
authortaeyoung <ty317.kim@samsung.com>
Thu, 16 Jun 2016 09:39:26 +0000 (18:39 +0900)
committertaeyoung <ty317.kim@samsung.com>
Thu, 16 Jun 2016 09:41:20 +0000 (18:41 +0900)
Signed-off-by: taeyoung <ty317.kim@samsung.com>
Change-Id: I2ff17117c8e7ee4b8a2e6b449a33937a2b35dacb

src/utc/device/public.list
src/utc/device/tct-device-core_mobile.h
src/utc/device/tct-device-core_wearable.h
src/utc/device/utc-system-device-battery.c

index 2774d08..7f50031 100755 (executable)
@@ -2,6 +2,10 @@ device_add_callback
 device_battery_get_level_status
 device_battery_get_percent
 device_battery_is_charging
+device_battery_get_health
+device_battery_get_power_source
+device_battery_get_status
+device_battery_get_property
 device_display_change_state
 device_display_get_brightness 
 device_display_get_max_brightness 
index b947925..9acab63 100755 (executable)
@@ -30,6 +30,14 @@ extern int utc_system_device_battery_is_charging_p(void);
 extern int utc_system_device_battery_is_charging_n(void);
 extern int utc_system_device_battery_get_level_status_p(void);
 extern int utc_system_device_battery_get_level_status_n(void);
+extern int utc_system_device_battery_get_health_p(void);
+extern int utc_system_device_battery_get_health_n(void);
+extern int utc_system_device_battery_get_power_source_p(void);
+extern int utc_system_device_battery_get_power_source_p(void);
+extern int utc_system_device_battery_get_status_p(void);
+extern int utc_system_device_battery_get_status_n(void);
+extern int utc_system_device_battery_get_property_p(void);
+extern int utc_system_device_battery_get_property_n(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_add_callback_n_2(void);
@@ -98,6 +106,14 @@ testcase tc_array[] = {
     {"utc_system_device_battery_is_charging_n", utc_system_device_battery_is_charging_n, NULL, NULL},
     {"utc_system_device_battery_get_level_status_p", utc_system_device_battery_get_level_status_p, NULL, NULL},
     {"utc_system_device_battery_get_level_status_n", utc_system_device_battery_get_level_status_n, NULL, NULL},
+    {"utc_system_device_battery_get_health_p", utc_system_device_battery_get_health_p, NULL, NULL},
+    {"utc_system_device_battery_get_health_n", utc_system_device_battery_get_health_n, NULL, NULL},
+    {"utc_system_device_battery_get_power_source_p", utc_system_device_battery_get_power_source_p, NULL, NULL},
+    {"utc_system_device_battery_get_power_source_n", utc_system_device_battery_get_power_source_n, NULL, NULL},
+    {"utc_system_device_battery_get_status_p", utc_system_device_battery_get_status_p, NULL, NULL},
+    {"utc_system_device_battery_get_status_n", utc_system_device_battery_get_status_n, NULL, NULL},
+    {"utc_system_device_battery_get_property_p", utc_system_device_battery_get_property_p, NULL, NULL},
+    {"utc_system_device_battery_get_property_n", utc_system_device_battery_get_property_n, NULL, NULL},
     {"utc_system_device_add_callback_p", utc_system_device_add_callback_p, NULL, NULL},
     {"utc_system_device_add_callback_n_1", utc_system_device_add_callback_n_1, NULL, NULL},
     {"utc_system_device_add_callback_n_2", utc_system_device_add_callback_n_2, NULL, NULL},
index b947925..9acab63 100755 (executable)
@@ -30,6 +30,14 @@ extern int utc_system_device_battery_is_charging_p(void);
 extern int utc_system_device_battery_is_charging_n(void);
 extern int utc_system_device_battery_get_level_status_p(void);
 extern int utc_system_device_battery_get_level_status_n(void);
+extern int utc_system_device_battery_get_health_p(void);
+extern int utc_system_device_battery_get_health_n(void);
+extern int utc_system_device_battery_get_power_source_p(void);
+extern int utc_system_device_battery_get_power_source_p(void);
+extern int utc_system_device_battery_get_status_p(void);
+extern int utc_system_device_battery_get_status_n(void);
+extern int utc_system_device_battery_get_property_p(void);
+extern int utc_system_device_battery_get_property_n(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_add_callback_n_2(void);
@@ -98,6 +106,14 @@ testcase tc_array[] = {
     {"utc_system_device_battery_is_charging_n", utc_system_device_battery_is_charging_n, NULL, NULL},
     {"utc_system_device_battery_get_level_status_p", utc_system_device_battery_get_level_status_p, NULL, NULL},
     {"utc_system_device_battery_get_level_status_n", utc_system_device_battery_get_level_status_n, NULL, NULL},
+    {"utc_system_device_battery_get_health_p", utc_system_device_battery_get_health_p, NULL, NULL},
+    {"utc_system_device_battery_get_health_n", utc_system_device_battery_get_health_n, NULL, NULL},
+    {"utc_system_device_battery_get_power_source_p", utc_system_device_battery_get_power_source_p, NULL, NULL},
+    {"utc_system_device_battery_get_power_source_n", utc_system_device_battery_get_power_source_n, NULL, NULL},
+    {"utc_system_device_battery_get_status_p", utc_system_device_battery_get_status_p, NULL, NULL},
+    {"utc_system_device_battery_get_status_n", utc_system_device_battery_get_status_n, NULL, NULL},
+    {"utc_system_device_battery_get_property_p", utc_system_device_battery_get_property_p, NULL, NULL},
+    {"utc_system_device_battery_get_property_n", utc_system_device_battery_get_property_n, NULL, NULL},
     {"utc_system_device_add_callback_p", utc_system_device_add_callback_p, NULL, NULL},
     {"utc_system_device_add_callback_n_1", utc_system_device_add_callback_n_1, NULL, NULL},
     {"utc_system_device_add_callback_n_2", utc_system_device_add_callback_n_2, NULL, NULL},
index a595b69..f480cbc 100755 (executable)
@@ -110,4 +110,135 @@ int utc_system_device_battery_get_level_status_n(void)
 
        return 0;
 }
-#endif //COMMON_IOT
\ No newline at end of file
+
+/**
+ * @testcase           utc_system_device_battery_get_health_p
+ * @since_tizen                3.0
+ * @description                Positive test case of device_battery_get_health.
+ */
+int utc_system_device_battery_get_health_p(void)
+{
+       device_battery_health_e health;
+       int error;
+
+       error = device_battery_get_health(&health);
+       assert_eq(error, DEVICE_ERROR_NONE);
+
+       return 0;
+}
+
+/**
+ * @testcase           utc_system_device_battery_get_health_n
+ * @since_tizen                3.0
+ * @description                Negative test case of device_battery_get_health.
+ */
+int utc_system_device_battery_get_health_n(void)
+{
+       int error;
+
+       error = device_battery_get_health(NULL);
+       assert_eq(error, DEVICE_ERROR_INVALID_PARAMETER);
+
+       return 0;
+}
+
+/**
+ * @testcase           utc_system_device_battery_get_power_source_p
+ * @since_tizen                3.0
+ * @description                Positive test case of device_battery_get_power_source.
+ */
+int utc_system_device_battery_get_power_source_p(void)
+{
+       device_battery_power_source_e power;
+       int error;
+
+       error = device_battery_get_power_source(&power);
+       assert_eq(error, DEVICE_ERROR_NONE);
+
+       return 0;
+}
+
+/**
+ * @testcase           utc_system_device_battery_get_power_source_n
+ * @since_tizen                3.0
+ * @description                Negative test case of device_battery_get_power_source.
+ */
+int utc_system_device_battery_get_power_source_n(void)
+{
+       int error;
+
+       error = device_battery_get_power_source(NULL);
+       assert_eq(error, DEVICE_ERROR_INVALID_PARAMETER);
+
+       return 0;
+}
+
+/**
+ * @testcase           utc_system_device_battery_get_status_p
+ * @since_tizen                3.0
+ * @description                Positive test case of device_battery_get_status.
+ */
+int utc_system_device_battery_get_status_p(void)
+{
+       device_battery_status_e status;
+       int error;
+
+       error = device_battery_get_status(&status);
+       assert_eq(error, DEVICE_ERROR_NONE);
+
+       return 0;
+}
+
+/**
+ * @testcase           utc_system_device_battery_get_status_n
+ * @since_tizen                3.0
+ * @description                Negative test case of device_battery_get_status.
+ */
+int utc_system_device_battery_get_status_n(void)
+{
+       int error;
+
+       error = device_battery_get_status(NULL);
+       assert_eq(error, DEVICE_ERROR_INVALID_PARAMETER);
+
+       return 0;
+}
+
+/**
+ * @testcase           utc_system_device_battery_get_property_p
+ * @since_tizen                3.0
+ * @description                Positive test case of device_battery_get_property.
+ */
+int utc_system_device_battery_get_property_p(void)
+{
+       int value;
+       int error;
+
+       error = device_battery_get_property(DEVICE_BATTERY_PROPERTY_CAPACITY, &value);
+       assert_eq(error, DEVICE_ERROR_NONE);
+
+       error = device_battery_get_property(DEVICE_BATTERY_PROPERTY_CURRENT_NOW, &value);
+       assert_eq(error, DEVICE_ERROR_NONE);
+
+       error = device_battery_get_property(DEVICE_BATTERY_PROPERTY_CURRENT_AVERAGE, &value);
+       assert_eq(error, DEVICE_ERROR_NONE);
+
+       return 0;
+}
+
+/**
+ * @testcase           utc_system_device_battery_get_property_n
+ * @since_tizen                3.0
+ * @description                Negative test case of device_battery_get_property.
+ */
+int utc_system_device_battery_get_property_n(void)
+{
+       int error;
+
+       error = device_battery_get_property(DEVICE_BATTERY_PROPERTY_CAPACITY, NULL);
+       assert_eq(error, DEVICE_ERROR_INVALID_PARAMETER);
+
+       return 0;
+}
+
+#endif //COMMON_IOT