3 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
4 * PROPRIETARY/CONFIDENTIAL
6 * This software is the confidential and proprietary information of SAMSUNG
7 * ELECTRONICS ("Confidential Information"). You agree and acknowledge that
8 * this software is owned by Samsung and you shall not disclose such
9 * Confidential Information and shall use it only in accordance with the terms
10 * of the license agreement you entered into with SAMSUNG ELECTRONICS. SAMSUNG
11 * make no representations or warranties about the suitability of the software,
12 * either express or implied, including but not limited to the implied
13 * warranties of merchantability, fitness for a particular purpose, or
14 * non-infringement. SAMSUNG shall not be liable for any damages suffered by
15 * licensee arising out of or related to this software.
19 #include <dd-battery.h>
21 #define API_NAME_BATTERY_GET_PERCENT "battery_get_percent"
22 #define API_NAME_BATTERY_GET_PERCENT_RAW "battery_get_percent_raw"
23 #define API_NAME_BATTERY_IS_FULL "battery_is_full"
24 #define API_NAME_BATTERY_GET_HEALTH "battery_get_health"
26 static void startup(void);
27 static void cleanup(void);
29 void (*tet_startup)(void) = startup;
30 void (*tet_cleanup)(void) = cleanup;
33 static void utc_system_deviced_battery_get_percent_p(void);
34 static void utc_system_deviced_battery_get_percent_raw_p(void);
35 static void utc_system_deviced_battery_is_full_p(void);
36 static void utc_system_deviced_battery_get_health_p(void);
39 POSITIVE_TC_IDX = 0x01,
43 struct tet_testlist tet_testlist[] = {
44 { utc_system_deviced_battery_get_percent_p, POSITIVE_TC_IDX },
45 { utc_system_deviced_battery_get_percent_raw_p, POSITIVE_TC_IDX },
46 { utc_system_deviced_battery_is_full_p, POSITIVE_TC_IDX },
47 { utc_system_deviced_battery_get_health_p, POSITIVE_TC_IDX },
51 static void startup(void)
55 static void cleanup(void)
60 * @brief Positive test case of battery_get_percent()
62 static void utc_system_deviced_battery_get_percent_p(void)
66 ret = battery_get_percent();
67 dts_check_ge(API_NAME_BATTERY_GET_PERCENT, ret, 0);
71 * @brief Positive test case of battery_get_percent_raw()
73 static void utc_system_deviced_battery_get_percent_raw_p(void)
77 ret = battery_get_percent_raw();
78 dts_check_ge(API_NAME_BATTERY_GET_PERCENT_RAW, ret, 0);
82 * @brief Positive test case of battery_is_full()
84 static void utc_system_deviced_battery_is_full_p(void)
88 ret = battery_is_full();
89 dts_check_ge(API_NAME_BATTERY_IS_FULL, ret, 0);
93 * @brief Positive test case of battery_get_health()
95 static void utc_system_deviced_battery_get_health_p(void)
99 ret = battery_get_health();
100 dts_check_ge(API_NAME_BATTERY_GET_HEALTH, ret, 0);