diff options
author | jin0.kim <jin0.kim@samsung.com> | 2017-05-19 12:47:55 +0830 |
---|---|---|
committer | jin0.kim <jin0.kim@samsung.com> | 2017-05-19 12:48:19 +0830 |
commit | 6a07123a935e8f6df67f43d58e8e8de14d36eedb (patch) | |
tree | 026065e88ffe8c63df6040e0bac2e8d40c72a2d9 | |
parent | 938fd96d1d76ca816a0f5e020f9577c2883f23b8 (diff) | |
download | w3-home-6a07123a935e8f6df67f43d58e8e8de14d36eedb.tar.gz w3-home-6a07123a935e8f6df67f43d58e8e8de14d36eedb.tar.bz2 w3-home-6a07123a935e8f6df67f43d58e8e8de14d36eedb.zip |
Update group_function_moments_view and group_feature_moments_controls_view
Change-Id: Ic1fe012b1e2ef9bda433a252d9071fc124e01deb
-rwxr-xr-x | inc/moments/moments_control_view.h | 9 | ||||
-rwxr-xr-x | inc/moments/moments_view_conf.h | 24 | ||||
-rwxr-xr-x | res/image/CMakeLists.txt | 33 | ||||
-rwxr-xr-x | res/image/call_forwarding.png | bin | 0 -> 1791 bytes | |||
-rwxr-xr-x | res/image/esim.png | bin | 0 -> 1614 bytes | |||
-rwxr-xr-x | res/image/multimedia_off.png | bin | 0 -> 1693 bytes | |||
-rwxr-xr-x | res/image/music.png | bin | 0 -> 1521 bytes | |||
-rwxr-xr-x | res/image/vibrate.png | bin | 0 -> 1831 bytes | |||
-rwxr-xr-x | src/moments/moments_control_view.c | 136 | ||||
-rwxr-xr-x | src/moments/moments_view.c | 20 | ||||
-rwxr-xr-x | test/feature_test/feature_test.c | 2 | ||||
-rwxr-xr-x | test/feature_test/group_feature_moments_controls_view.c | 100 | ||||
-rwxr-xr-x | test/feature_test/group_feature_moments_default_ui.c | 2 | ||||
-rwxr-xr-x[-rw-r--r--] | test/feature_test/group_feature_moments_status_view_ui.c | 60 | ||||
-rwxr-xr-x | test/function_test/group_function_moments_view.c | 158 | ||||
-rwxr-xr-x | test/unit/inc/unit_assert.h | 7 |
16 files changed, 392 insertions, 159 deletions
diff --git a/inc/moments/moments_control_view.h b/inc/moments/moments_control_view.h index cd9acdc..6ea7ba9 100755 --- a/inc/moments/moments_control_view.h +++ b/inc/moments/moments_control_view.h @@ -46,12 +46,17 @@ typedef struct __control_info_t { char *volume_text; bool more_opt_status; void (*pressed)(void*); - bool do_not_show; + Evas_Object *button_layout; } control_info_t; Evas_Object *moments_control_view_create(Evas_Object *base_layout); void moments_control_view_destroy(void); -control_info_t *moments_control_create_control_button(const char * label); +control_info_t *moments_control_create_button(Evas_Object *base_layout, int button_id); +void moments_control_push_to_button_list(control_info_t *button_info); +void moments_control_destroy_button(control_info_t *button_info); +void moments_control_update(void); +position_t *moments_control_get_button_position(int index, int total_count); +void moments_control_clear_button_list(void); Eina_List * __t__get_moments_control_button_list(void); diff --git a/inc/moments/moments_view_conf.h b/inc/moments/moments_view_conf.h index 77b6df8..150cfa9 100755 --- a/inc/moments/moments_view_conf.h +++ b/inc/moments/moments_view_conf.h @@ -34,23 +34,23 @@ #define MOMENTS_CENTER_H (int)((180) * (SCALE_H)) #define MOMENTS_CENTER_STATUS_ICON_W (int)((30) * (SCALE_W)) -#define MOMENTS_CENTER_STATUS_ICON_H (int)((38) * (SCALE_W)) +#define MOMENTS_CENTER_STATUS_ICON_H (int)((38) * (SCALE_H)) #define MOMENTS_CENTER_STATUS_ICON_X (int)((WINDOW_H - MOMENTS_CENTER_STATUS_ICON_W)/2 * (SCALE_W)) -#define MOMENTS_CENTER_STATUS_ICON_Y (int)((64) * (SCALE_W)) +#define MOMENTS_CENTER_STATUS_ICON_Y (int)((64) * (SCALE_H)) #define MOMENTS_CENTER_STATUS_TEXT_W (int)((260) * (SCALE_W)) -#define MOMENTS_CENTER_STATUS_TEXT_H (int)((74) * (SCALE_W)) +#define MOMENTS_CENTER_STATUS_TEXT_H (int)((74) * (SCALE_H)) #define MOMENTS_CENTER_STATUS_TEXT_X (int)((50) * (SCALE_W)) -#define MOMENTS_CENTER_STATUS_TEXT_Y (int)((102) * (SCALE_W)) +#define MOMENTS_CENTER_STATUS_TEXT_Y (int)((102) * (SCALE_H)) #define MOMENTS_CENTER_PLMN_TEXT_W (int)((260) * (SCALE_W)) -#define MOMENTS_CENTER_PLMN_TEXT_H (int)((68) * (SCALE_W)) +#define MOMENTS_CENTER_PLMN_TEXT_H (int)((68) * (SCALE_H)) #define MOMENTS_CENTER_PLMN_TEXT_X (int)((50) * (SCALE_W)) -#define MOMENTS_CENTER_PLMN_TEXT_Y (int)((176) * (SCALE_W)) +#define MOMENTS_CENTER_PLMN_TEXT_Y (int)((176) * (SCALE_H)) -#define MOMENTS_BUTTON_W (int)((64) * (SCALE_H)) +#define MOMENTS_BUTTON_W (int)((64) * (SCALE_W)) #define MOMENTS_BUTTON_H (int)((64) * (SCALE_H)) -#define MOMENTS_BUTTON_1_X (int)((148) * (SCALE_H)) +#define MOMENTS_BUTTON_1_X (int)((148) * (SCALE_W)) #define MOMENTS_BUTTON_1_Y (int)((289) * (SCALE_H)) @@ -58,15 +58,15 @@ #define MOMENTS_ANIMATION_SHOW_TIME 0.03 #define MOMENTS_ANIMATION_DRAW_TIME 0.05 -#define MOMENTS_STATUS_UTIL_ICON_W (int)((24) * (SCALE_H)) +#define MOMENTS_STATUS_UTIL_ICON_W (int)((24) * (SCALE_W)) #define MOMENTS_STATUS_UTIL_ICON_H (int)((26) * (SCALE_H)) -#define MOMENTS_STATUS_BATTERY_ICON_W (int)((22) * (SCALE_H)) +#define MOMENTS_STATUS_BATTERY_ICON_W (int)((22) * (SCALE_W)) #define MOMENTS_STATUS_BATTERY_ICON_H (int)((33) * (SCALE_H)) -#define MOMENTS_STATUS_BATTERY_ICON_X (int)((169) * (SCALE_H)) +#define MOMENTS_STATUS_BATTERY_ICON_X (int)((169) * (SCALE_W)) #define MOMENTS_STATUS_BATTERY_ICON_Y (int)((0) * (SCALE_H)) -#define MOMENTS_STATUS_UTIL_POSITION_1_X (int)((135) * (SCALE_H)) +#define MOMENTS_STATUS_UTIL_POSITION_1_X (int)((135) * (SCALE_W)) #define MOMENTS_STATUS_UTIL_POSITION_1_Y (int)((7) * (SCALE_H)) #endif diff --git a/res/image/CMakeLists.txt b/res/image/CMakeLists.txt index ce1c04b..1499bef 100755 --- a/res/image/CMakeLists.txt +++ b/res/image/CMakeLists.txt @@ -1,33 +1,6 @@ -INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/unknown.png DESTINATION ${IMAGEDIR}) -INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/alarm.png DESTINATION ${IMAGEDIR}) -INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/apps.png DESTINATION ${IMAGEDIR}) -INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/atntmessages.png DESTINATION ${IMAGEDIR}) -INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/buddy.png DESTINATION ${IMAGEDIR}) -INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/recent.png DESTINATION ${IMAGEDIR}) -INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/calculator.png DESTINATION ${IMAGEDIR}) -INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/email.png DESTINATION ${IMAGEDIR}) -INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/findmycar.png DESTINATION ${IMAGEDIR}) -INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/findmydevice.png DESTINATION ${IMAGEDIR}) -INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/gallery.png DESTINATION ${IMAGEDIR}) -INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/gallery_delta.png DESTINATION ${IMAGEDIR}) -INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/phone.png DESTINATION ${IMAGEDIR}) -INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/shealth.png DESTINATION ${IMAGEDIR}) -INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/timer.png DESTINATION ${IMAGEDIR}) -INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/traffic.png DESTINATION ${IMAGEDIR}) -INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/voicememo.png DESTINATION ${IMAGEDIR}) -INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/contacts.png DESTINATION ${IMAGEDIR}) -INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/b_home_screen_focus_point.png DESTINATION ${IMAGEDIR}) -INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/b_home_screen_icon_left.png DESTINATION ${IMAGEDIR}) -INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/b_home_screen_icon_empty.png DESTINATION ${IMAGEDIR}) -INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/b_home_screen_icon_right.png DESTINATION ${IMAGEDIR}) -INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/home_indicator_horizontal_dot.png DESTINATION ${IMAGEDIR}) -INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/tw_ic_popup_btn_check.png DESTINATION ${IMAGEDIR}) -INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/tw_ic_popup_btn_delete.png DESTINATION ${IMAGEDIR}) -INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/tw_toast_popup_success.png DESTINATION ${IMAGEDIR}) -INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/donotdisturb.png DESTINATION ${IMAGEDIR}) -INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/brightness.png DESTINATION ${IMAGEDIR}) -INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/flight_mode.png DESTINATION ${IMAGEDIR}) -INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/multimedia.png DESTINATION ${IMAGEDIR}) + +INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/ DESTINATION ${IMAGEDIR} FILES_MATCHING PATTERN "*.png") + IF("${CIRCLE}" STREQUAL "circle") INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/widget_circle_bg_stroke.png DESTINATION ${IMAGEDIR}) diff --git a/res/image/call_forwarding.png b/res/image/call_forwarding.png Binary files differnew file mode 100755 index 0000000..58bc586 --- /dev/null +++ b/res/image/call_forwarding.png diff --git a/res/image/esim.png b/res/image/esim.png Binary files differnew file mode 100755 index 0000000..32ff324 --- /dev/null +++ b/res/image/esim.png diff --git a/res/image/multimedia_off.png b/res/image/multimedia_off.png Binary files differnew file mode 100755 index 0000000..d124ec2 --- /dev/null +++ b/res/image/multimedia_off.png diff --git a/res/image/music.png b/res/image/music.png Binary files differnew file mode 100755 index 0000000..e91e54b --- /dev/null +++ b/res/image/music.png diff --git a/res/image/vibrate.png b/res/image/vibrate.png Binary files differnew file mode 100755 index 0000000..395818f --- /dev/null +++ b/res/image/vibrate.png diff --git a/src/moments/moments_control_view.c b/src/moments/moments_control_view.c index d6fa414..16d5a1e 100755 --- a/src/moments/moments_control_view.c +++ b/src/moments/moments_control_view.c @@ -20,26 +20,45 @@ #include "log.h" #include "util.h" #include "common_conf.h" +#include "app_log.h" #include "moments/moments.h" #include "moments/moments_view_conf.h" #include "moments/moments_view_edje_conf.h" #include "moments/moments_control_view.h" -#include "app_log.h" #define CONTROL_BUTTON_LAYOUT_EDJE EDJE_DIR"/circle/moments_control_button_layout.edj" static struct __control_view_s { + Evas_Object *base_layout; Evas_Object *control_layout; Eina_List *button_list; } s_info = { + .base_layout = NULL, .control_layout = NULL, .button_list = NULL, }; +const char *controls_btn_group_name[MOMENTS_CONTROLS_BTN_TYPE_MAX] = { + CONTROLS_GROUP_ICON_ONLY, + CONTROLS_GROUP_ICON_AND_TEXT, + CONTROLS_GROUP_ICON_AND_BAR +}; + + +control_info_t control_button_list[MOMENTS_CONTROLS_MAX] = { + {MOMENTS_CONTROLS_DO_NOT_DISTRUB, MOMENTS_CONTROLS_BTN_TYPE_ICON_AND_BAR, "do not distrub", "donotdisturb.png", 0, "", 1, NULL, NULL}, + {MOMENTS_CONTROLS_VOLUME, MOMENTS_CONTROLS_BTN_TYPE_ICON_AND_TEXT, "volume", "multimedia.png", 0, "10", 0, NULL, NULL}, + {MOMENTS_CONTROLS_FIGHT_MODE, MOMENTS_CONTROLS_BTN_TYPE_ICON_AND_BAR, "fight mode", "flight_mode.png", 0, "", 0, NULL, NULL}, + {MOMENTS_CONTROLS_BRIGHTNESS, MOMENTS_CONTROLS_BTN_TYPE_ICON_AND_TEXT, "brightness", "brightness.png", 0, "7", 0, NULL, NULL}, + {MOMENTS_CONTROLS_MUSIC_PLAYER, MOMENTS_CONTROLS_BTN_TYPE_ICON_ONLY, "music player", "music.png", 0, "7", 0, NULL, NULL}, + {MOMENTS_CONTROLS_CALL_FORWARDING, MOMENTS_CONTROLS_BTN_TYPE_ICON_ONLY, "call forwarding", "call_forwarding.png", 0, "7", 0, NULL, NULL}, +}; + + Evas_Object *moments_control_view_create(Evas_Object *base_layout) { Evas_Object * control_layout = elm_grid_add(base_layout); @@ -59,6 +78,7 @@ Evas_Object *moments_control_view_create(Evas_Object *base_layout) evas_object_show(control_layout); s_info.control_layout = control_layout; + s_info.base_layout = base_layout; return control_layout; } @@ -76,18 +96,119 @@ const char *__get_icon_image_file (const char *label) return NULL; } -control_info_t *moments_control_create_control_button(const char * label) +static Evas_Object *__create_control_button(Evas_Object * base_layout, control_info_t *btn_info) +{ + Evas_Object *button_layout = elm_layout_add(base_layout); + + if (!button_layout || !elm_layout_file_set(button_layout, util_get_res_file_path(CONTROL_BUTTON_LAYOUT_EDJE), controls_btn_group_name[btn_info->btn_type])) { + _E("Failed to create base layout"); + goto __fail; + } + + evas_object_size_hint_min_set(button_layout, MOMENTS_BUTTON_W, MOMENTS_BUTTON_H); + evas_object_size_hint_weight_set(button_layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(button_layout, EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_color_set(button_layout, 255, 255, 255, 255); + + evas_object_show(button_layout); + + Evas_Object *icon = elm_image_add(button_layout); + + char full_path[MAX_FILE_PATH_LEN] = {0}; + + snprintf(full_path, MAX_FILE_PATH_LEN, "%simages/%s", app_get_resource_path(), btn_info->icon_image); + + elm_image_file_set(icon, full_path, NULL); + elm_object_part_content_set(button_layout, CONTROLS_ICON, icon); + + if (btn_info->btn_type == MOMENTS_CONTROLS_BTN_TYPE_ICON_AND_TEXT) { + elm_object_part_text_set(button_layout, CONTROLS_TEXT, btn_info->volume_text); + } + + return button_layout; + +__fail: + if (button_layout) evas_object_del(button_layout); + return NULL; +} + +control_info_t *moments_control_create_button(Evas_Object *base_layout, int button_id) { control_info_t *button = (control_info_t *)malloc(sizeof(control_info_t)); - button->label = strdup(label); - button->icon_image = __get_icon_image_file(label); - button->volume_text = strdup("0"); - button->btn_type = MOMENTS_CONTROLS_BTN_TYPE_ICON_ONLY; - button->icon_status = 0; + + button->index = control_button_list[button_id].index; + button->btn_type = control_button_list[button_id].btn_type; + button->label = control_button_list[button_id].label; + button->icon_image = control_button_list[button_id].icon_image; + button->icon_status = control_button_list[button_id].icon_status; + button->volume_text = control_button_list[button_id].volume_text; + button->more_opt_status= control_button_list[button_id].more_opt_status; + button->pressed = control_button_list[button_id].pressed; + button->button_layout = __create_control_button(base_layout, button); return button; } +void moments_control_destroy_button(control_info_t *button_info) +{ + if (button_info->button_layout != NULL) { + Evas_Object *icon = elm_object_part_content_get(button_info->button_layout, CONTROLS_ICON); + if (icon != NULL) { + evas_object_del(icon); + } + + evas_object_del(button_info->button_layout); + } + + free(button_info); +} + +void moments_control_clear_button_list(void) +{ + Eina_List * l = NULL; + control_info_t *button = NULL; + + EINA_LIST_FOREACH(s_info.button_list, l, button) { + elm_grid_unpack(s_info.control_layout, button->button_layout); + moments_control_destroy_button(button); + + s_info.button_list = eina_list_remove_list(s_info.button_list, l); + } + eina_list_free(s_info.button_list); + s_info.button_list = NULL; +} + +position_t temp_pos[6] = {{148, 289}, {223, 268}, {73, 268}, {274, 211}, {22, 211}, {0, 0}}; + +position_t *moments_control_get_button_position(int index, int total_count) +{ + static position_t pos = {148, 289}; + + pos = temp_pos[index]; + + return &pos; +} + +void moments_control_update(void) +{ + elm_grid_clear(s_info.control_layout, false); + + Eina_List * l = NULL; + control_info_t *button = NULL; + int count = eina_list_count(s_info.button_list); + int index = 0; + + EINA_LIST_FOREACH(s_info.button_list, l, button) { + position_t *pos = moments_control_get_button_position(index, count); + elm_grid_pack(s_info.control_layout, button->button_layout, pos->x * (SCALE_W), pos->y * (SCALE_H), MOMENTS_BUTTON_W, MOMENTS_BUTTON_H); + index++; + } +} + +void moments_control_push_to_button_list(control_info_t *button_info) +{ + s_info.button_list = eina_list_append(s_info.button_list, button_info); +} #include "test.h" #if TEST_MODE @@ -95,4 +216,5 @@ Eina_List *__t__get_moments_control_button_list() { return s_info.button_list; } + #endif diff --git a/src/moments/moments_view.c b/src/moments/moments_view.c index 3a7b92c..b7644ff 100755 --- a/src/moments/moments_view.c +++ b/src/moments/moments_view.c @@ -72,21 +72,6 @@ const char *center_layout_group_name[MOMENTS_CONNECTION_STATUS_MAX] = { -const char *controls_btn_group_name[MOMENTS_CONTROLS_BTN_TYPE_MAX] = { - CONTROLS_GROUP_ICON_ONLY, - CONTROLS_GROUP_ICON_AND_TEXT, - CONTROLS_GROUP_ICON_AND_BAR -}; - - -control_info_t controls_list[MOMENTS_CONTROLS_MAX] = { - {MOMENTS_CONTROLS_DO_NOT_DISTRUB, MOMENTS_CONTROLS_BTN_TYPE_ICON_AND_BAR, "do not distrub", "donotdisturb.png", 0, NULL, 0, NULL}, - {MOMENTS_CONTROLS_VOLUME, MOMENTS_CONTROLS_BTN_TYPE_ICON_AND_TEXT, "volume", "multimedia.png", 0, "10", 0, NULL}, - {MOMENTS_CONTROLS_FIGHT_MODE, MOMENTS_CONTROLS_BTN_TYPE_ICON_AND_BAR, "fight mode", "flight_mode.png", 0, NULL, 0, NULL}, - {MOMENTS_CONTROLS_BRIGHTNESS, MOMENTS_CONTROLS_BTN_TYPE_ICON_AND_TEXT, "brightness", "brightness.png", 0, "7", 0, NULL}, -}; - - int controls_btn_pos[4][2] = { {110, 284}, {186, 284}, {45, 248}, {251, 248}}; @@ -128,9 +113,6 @@ Evas_Object *moments_create_ui(Evas_Object *base_win) s_info.control_layout = moments_control_view_create(s_info.background_layout); -// s_info.button_object = __create_button_object(s_info.control_layout); -// elm_grid_pack(s_info.control_layout, s_info.button_object, MOMENTS_BUTTON_1_X, MOMENTS_BUTTON_1_Y, MOMENTS_BUTTON_W, MOMENTS_BUTTON_H); - __set_controls_icon(); evas_object_event_callback_add(s_info.background_layout, EVAS_CALLBACK_MOUSE_DOWN, __down_cb, NULL); evas_object_event_callback_add(s_info.background_layout, EVAS_CALLBACK_MOUSE_MOVE, __move_cb, NULL); @@ -332,6 +314,7 @@ static void __set_center_contents() //elm_object_part_text_set(center_layout, CENTER_PLMN_TEXT, "PLMN/SPN"); } +#if 0 static Evas_Object *__create_button_object(Evas_Object *base_layout) { Evas_Object *button_layout = elm_layout_add(base_layout); @@ -408,6 +391,7 @@ __fail: if (button_layout) evas_object_del(button_layout); return NULL; } +#endif static int __get_control_layout_alpha(int layout_bottom) { diff --git a/test/feature_test/feature_test.c b/test/feature_test/feature_test.c index 9b22792..a9cec27 100755 --- a/test/feature_test/feature_test.c +++ b/test/feature_test/feature_test.c @@ -12,13 +12,13 @@ void feature_test(void) { unit_clear_log(); + TEST_GROUP_ADD("group_feature_moments_status_view_ui", group_feature_moments_status_view_ui); TEST_GROUP_ADD("group_feature_moments_show", group_feature_moments_show); TEST_GROUP_ADD("group_feature_moments_pull_down", group_feature_moments_pull_down); TEST_GROUP_ADD("group_feature_status_area_layer_show", group_feature_status_area_layer_show); TEST_GROUP_ADD("group_feature_moments_default_ui", group_feature_moments_default_ui); TEST_GROUP_ADD("group_feature_moments_vi", group_feature_moments_vi); TEST_GROUP_ADD("group_feature_moments_controls_show", group_feature_moments_controls_show); - TEST_GROUP_ADD("group_feature_moments_status_view_ui", group_feature_moments_status_view_ui); TEST_RUN(__test_complete_cb); } diff --git a/test/feature_test/group_feature_moments_controls_view.c b/test/feature_test/group_feature_moments_controls_view.c index 87f4830..ea7746b 100755 --- a/test/feature_test/group_feature_moments_controls_view.c +++ b/test/feature_test/group_feature_moments_controls_view.c @@ -2,11 +2,13 @@ #if TEST_MODE #include "feature_test.h" +#include "common_conf.h" + #include "moments/moments.h" #include "moments/moments_control_view.h" #include "home_app_manager.h" -#include "common_conf.h" + #include "moments/moments_view_conf.h" #include "../test_function.h" @@ -21,38 +23,84 @@ static struct { static void __set_up(void) { - if (moments_get_visible() == false) { - main_s * info = main_get_info(); - - __t__layout_mouse_down(info->layout, 180, 50); - __t__layout_mouse_move(info->layout, 180, 300); - __t__layout_mouse_up(info->layout, 180, 300); - - ecore_timer_add(0.6, s_info.group->set_up_complete, s_info.group); - return ; - } - s_info.group->set_up_complete(s_info.group); } static void __tear_down(void) { - if (moments_get_visible()) { - moments_hide(); - ecore_timer_add(0.6, s_info.group->tear_down_complete, s_info.group); - return ; - } - s_info.group->tear_down_complete(s_info.group); } -static Eina_Bool __case_show_control_button(void * data) +static unit_case_func_t __continue_check_control_button(void * data); + +static unit_case_func_t __case_show_control_button(void * data) { Evas_Object *control_layout = __t__get_moments_control_layout(); TEST_ASSERT_TRUE(control_layout != NULL); + moments_control_clear_button_list(); + + int i = 0; + int count = (int)data; + + /** START **/ + if (count == 1) { + if (moments_get_visible() == false) { + main_s * info = main_get_info(); + + __t__layout_mouse_down(info->layout, 180, 50); + __t__layout_mouse_move(info->layout, 180, 300); + __t__layout_mouse_up(info->layout, 180, 300); + + TEST_CASE_CONTINUE(0.1, __case_show_control_button, data); + } + } + + for (i=0; i< count ; i++) { + control_info_t *new_button = moments_control_create_button(control_layout, i); + TEST_ASSERT_TRUE_UPGRADE(new_button != NULL); + TEST_ASSERT_TRUE_UPGRADE(new_button->button_layout != NULL); + + moments_control_push_to_button_list(new_button); + } + + moments_control_update(); + + TEST_CASE_CONTINUE(0.5, __continue_check_control_button, data); +} + +static unit_case_func_t __continue_check_control_button(void * data) +{ Eina_List *button_list = __t__get_moments_control_button_list(); + TEST_ASSERT_TRUE_UPGRADE(button_list != NULL); + + int i = 0; + int count = (int)data; + + for (i=0; i<count ; i++) { + control_info_t *button = eina_list_nth(button_list, i); + + TEST_ASSERT_TRUE_UPGRADE(button->button_layout != NULL); + TEST_ASSERT_TRUE_UPGRADE(evas_object_visible_get(button->button_layout)); + int x = 0, y = 0, w = 0, h = 0; + evas_object_geometry_get(button->button_layout, &x, &y, &w, &h); + + int total = eina_list_count(button_list); + position_t *pos = moments_control_get_button_position(i, total); + + TEST_ASSERT_EQUAL_INT_UPGRADE(pos->x, x); + TEST_ASSERT_EQUAL_INT_UPGRADE(pos->y, y); + TEST_ASSERT_EQUAL_INT_UPGRADE(MOMENTS_BUTTON_W, w); + TEST_ASSERT_EQUAL_INT_UPGRADE(MOMENTS_BUTTON_H, h); + } + + /** End **/ + if (count == 6) { + if (moments_get_visible()) { + moments_hide(); + } + } TEST_CASE_DONE(s_info.group); } @@ -63,14 +111,12 @@ void group_feature_moments_controls_show(unit_group_t * group) s_info.group->set_up = __set_up; s_info.group->tear_down = __tear_down; - - control_info_t *control_button = moments_control_create_control_button("do not distrub"); - - /* FIXME */ - //moments_control_push_to_button_list(control_button); - - TEST_CASE_ADD(s_info.group, __case_show_control_button, NULL); - + TEST_CASE_ADD(s_info.group, __case_show_control_button, (void*)1); + TEST_CASE_ADD(s_info.group, __case_show_control_button, (void*)2); + TEST_CASE_ADD(s_info.group, __case_show_control_button, (void*)3); + TEST_CASE_ADD(s_info.group, __case_show_control_button, (void*)4); + TEST_CASE_ADD(s_info.group, __case_show_control_button, (void*)5); + TEST_CASE_ADD(s_info.group, __case_show_control_button, (void*)6); TEST_GROUP_RUN(s_info.group); } diff --git a/test/feature_test/group_feature_moments_default_ui.c b/test/feature_test/group_feature_moments_default_ui.c index e389480..41786a8 100755 --- a/test/feature_test/group_feature_moments_default_ui.c +++ b/test/feature_test/group_feature_moments_default_ui.c @@ -195,7 +195,7 @@ void group_feature_moments_default_ui(unit_group_t * group) s_info.current_case = 0; s_info.group = group; - s_info.group_timer = ecore_timer_add(0.6, __group_timer_callback, NULL); + s_info.group_timer = ecore_timer_add(0.1, __group_timer_callback, NULL); } static Eina_Bool __group_timer_callback(void * data) diff --git a/test/feature_test/group_feature_moments_status_view_ui.c b/test/feature_test/group_feature_moments_status_view_ui.c index 21de5ae..7bb85fb 100644..100755 --- a/test/feature_test/group_feature_moments_status_view_ui.c +++ b/test/feature_test/group_feature_moments_status_view_ui.c @@ -79,26 +79,26 @@ static unit_case_func_t __case_check_status_view_layout(void *data) } Evas_Object *layout = moments_status_view_get_layout(); - TEST_ASSERT_TRUE(layout != NULL); + TEST_ASSERT_TRUE_UPGRADE(layout != NULL); const char *status_layout_file = NULL; elm_layout_file_get(layout, &status_layout_file, NULL); TEST_ASSERT_EQUAL_STRING(STATUS_LAYOUT_EDJE, status_layout_file); - TEST_ASSERT_TRUE(evas_object_visible_get(layout) == false); + TEST_ASSERT_TRUE_UPGRADE(evas_object_visible_get(layout) == false); int x, y, w, h; evas_object_geometry_get(layout, &x, &y, &w, &h); - TEST_ASSERT_EQUAL_INT(OUTSIDE_X, x); - TEST_ASSERT_EQUAL_INT(OUTSIDE_Y, y); - TEST_ASSERT_EQUAL_INT(WINDOW_W, w); - TEST_ASSERT_EQUAL_INT(MOMENTS_INIT_H, h); + TEST_ASSERT_EQUAL_INT_UPGRADE(OUTSIDE_X, x); + TEST_ASSERT_EQUAL_INT_UPGRADE(OUTSIDE_Y, y); + TEST_ASSERT_EQUAL_INT_UPGRADE(WINDOW_W, w); + TEST_ASSERT_EQUAL_INT_UPGRADE(MOMENTS_INIT_H, h); Evas_Object *grid = __t__get_moments_status_grid(); - TEST_ASSERT_TRUE(grid != NULL); - TEST_ASSERT_TRUE(elm_object_part_content_get(layout, STATUS_CONTENT) != NULL); + TEST_ASSERT_TRUE_UPGRADE(grid != NULL); + TEST_ASSERT_TRUE_UPGRADE(elm_object_part_content_get(layout, STATUS_CONTENT) != NULL); evas_object_geometry_get(grid, &x, &y, &w, &h); - TEST_ASSERT_EQUAL_INT(OUTSIDE_X, x); - TEST_ASSERT_EQUAL_INT(OUTSIDE_Y, y); - TEST_ASSERT_EQUAL_INT(WINDOW_W, w); - TEST_ASSERT_EQUAL_INT(MOMENTS_INIT_H, h); + TEST_ASSERT_EQUAL_INT_UPGRADE(OUTSIDE_X, x); + TEST_ASSERT_EQUAL_INT_UPGRADE(OUTSIDE_Y, y); + TEST_ASSERT_EQUAL_INT_UPGRADE(WINDOW_W, w); + TEST_ASSERT_EQUAL_INT_UPGRADE(MOMENTS_INIT_H, h); TEST_CASE_DONE(s_info.group); } @@ -115,24 +115,24 @@ static unit_case_func_t __continue_check_status_battery_icon_change(void *data); static unit_case_func_t __case_check_status_view_battery(void *data) { Evas_Object *battery = __t__get_moments_status_battery(); - TEST_ASSERT_TRUE(battery != NULL); - TEST_ASSERT_TRUE(evas_object_visible_get(battery)); + TEST_ASSERT_TRUE_UPGRADE(battery != NULL); + TEST_ASSERT_TRUE_UPGRADE(evas_object_visible_get(battery)); int x, y, w, h; evas_object_geometry_get(battery, &x, &y, &w, &h); - TEST_ASSERT_EQUAL_INT(OUTSIDE_X + MOMENTS_STATUS_BATTERY_ICON_X, x); - TEST_ASSERT_EQUAL_INT(OUTSIDE_Y + MOMENTS_STATUS_BATTERY_ICON_Y, y); - TEST_ASSERT_EQUAL_INT(MOMENTS_STATUS_BATTERY_ICON_W, w); - TEST_ASSERT_EQUAL_INT(MOMENTS_STATUS_BATTERY_ICON_H, h); + TEST_ASSERT_EQUAL_INT_UPGRADE(OUTSIDE_X + MOMENTS_STATUS_BATTERY_ICON_X, x); + TEST_ASSERT_EQUAL_INT_UPGRADE(OUTSIDE_Y + MOMENTS_STATUS_BATTERY_ICON_Y, y); + TEST_ASSERT_EQUAL_INT_UPGRADE(MOMENTS_STATUS_BATTERY_ICON_W, w); + TEST_ASSERT_EQUAL_INT_UPGRADE(MOMENTS_STATUS_BATTERY_ICON_H, h); main_s *info = main_get_info(); - TEST_ASSERT_TRUE(info != NULL); - TEST_ASSERT_TRUE(info->layout != NULL); + TEST_ASSERT_TRUE_UPGRADE(info != NULL); + TEST_ASSERT_TRUE_UPGRADE(info->layout != NULL); Evas_Object *layout = moments_status_view_get_layout(); - TEST_ASSERT_TRUE(layout != NULL); + TEST_ASSERT_TRUE_UPGRADE(layout != NULL); __t__layout_mouse_down(info->layout, 180, 50); - TEST_ASSERT_TRUE(evas_object_visible_get(layout) == true); + TEST_ASSERT_TRUE_UPGRADE(evas_object_visible_get(layout) == true); static int percent = 0; __set_battery_percent(percent); @@ -146,10 +146,10 @@ static unit_case_func_t __continue_check_status_battery_icon_change(void *data) int percent = *(int *)data; Evas_Object *layout = moments_status_view_get_layout(); - TEST_ASSERT_TRUE(layout != NULL); + TEST_ASSERT_TRUE_UPGRADE(layout != NULL); Evas_Object *battery = __t__get_moments_status_battery(); - TEST_ASSERT_TRUE(battery != NULL); + TEST_ASSERT_TRUE_UPGRADE(battery != NULL); TEST_ASSERT_EQUAL_STRING(battery_text, elm_object_part_text_get(layout, "txt.battery")); TEST_ASSERT_EQUAL_STRING(battery_percent, edje_object_part_state_get(elm_layout_edje_get(battery), "icon_image", &val)); @@ -185,14 +185,14 @@ static unit_case_func_t __case_check_status_view_callsignal(void *data) TEST_CASE_CONTINUE(0.1, __case_check_status_view_callsignal, NULL); } - TEST_ASSERT_TRUE(evas_object_visible_get(callsignal)); + TEST_ASSERT_TRUE_UPGRADE(evas_object_visible_get(callsignal)); int x, y, w, h; evas_object_geometry_get(callsignal, &x, &y, &w, &h); - TEST_ASSERT_EQUAL_INT(135, x); - TEST_ASSERT_EQUAL_INT(7, y); - TEST_ASSERT_EQUAL_INT(MOMENTS_STATUS_UTIL_ICON_W, w); - TEST_ASSERT_EQUAL_INT(MOMENTS_STATUS_UTIL_ICON_H, h); + TEST_ASSERT_EQUAL_INT_UPGRADE(135, x); + TEST_ASSERT_EQUAL_INT_UPGRADE(7, y); + TEST_ASSERT_EQUAL_INT_UPGRADE(MOMENTS_STATUS_UTIL_ICON_W, w); + TEST_ASSERT_EQUAL_INT_UPGRADE(MOMENTS_STATUS_UTIL_ICON_H, h); //moments_status_callsignal_icon_hide(); @@ -206,7 +206,7 @@ static unit_case_func_t __continue_check_status_callsignal_icon_change(void *dat int strength = *(int *)data; double val = 0.0; Evas_Object *callsignal = __t__get_moments_status_callsignal(); - TEST_ASSERT_TRUE(callsignal != NULL); + TEST_ASSERT_TRUE_UPGRADE(callsignal != NULL); TEST_ASSERT_EQUAL_STRING(__t__callsignal_type[call_signal_index], edje_object_part_state_get(elm_layout_edje_get(callsignal), "icon_image", &val)); diff --git a/test/function_test/group_function_moments_view.c b/test/function_test/group_function_moments_view.c index 2089666..18a9db1 100755 --- a/test/function_test/group_function_moments_view.c +++ b/test/function_test/group_function_moments_view.c @@ -4,91 +4,187 @@ #include "function_test.h" #include "common_conf.h" #include "moments/moments_view_conf.h" +#include "moments/moments_view_edje_conf.h" +#include "moments/moments_control_view.h" + #include "../test_function.h" #include <Elementary.h> +#include "win.h" +#include "util.h" + +extern control_info_t control_button_list[MOMENTS_CONTROLS_MAX]; + +static struct { + unit_group_t * group; +} s_info = { + .group = NULL, +}; + -static void __set_up(void){} -static void __tear_down(void){} +static void __set_up(void) +{ + s_info.group->set_up_complete(s_info.group); +} + +static void __tear_down(void) +{ + s_info.group->tear_down_complete(s_info.group); +} -static void __case_check_view_position(bool * is_passed) +static unit_case_func_t __case_check_view_position(void * data) { int dest_y = 0; __t__get_draw_up_view_y(0, 0, &dest_y); - TEST_ASSERT_EQUAL_INT(0, dest_y); + TEST_ASSERT_EQUAL_INT_UPGRADE(0, dest_y); dest_y = 0; __t__get_draw_up_view_y(180, 180, &dest_y); - TEST_ASSERT_EQUAL_INT(0, dest_y); + TEST_ASSERT_EQUAL_INT_UPGRADE(0, dest_y); dest_y = 0; __t__get_draw_up_view_y(100, 90, &dest_y); - TEST_ASSERT_EQUAL_INT(0, dest_y); + TEST_ASSERT_EQUAL_INT_UPGRADE(0, dest_y); dest_y = 0; __t__get_draw_up_view_y(100, 89, &dest_y); - TEST_ASSERT_EQUAL_INT(-1, dest_y); + TEST_ASSERT_EQUAL_INT_UPGRADE(-1, dest_y); dest_y = 0; __t__get_draw_up_view_y(100, 10, &dest_y); - TEST_ASSERT_EQUAL_INT(-80, dest_y); + TEST_ASSERT_EQUAL_INT_UPGRADE(-80, dest_y); dest_y = 0; __t__get_draw_up_view_y(100, 130, &dest_y); - TEST_ASSERT_EQUAL_INT(0, dest_y); + TEST_ASSERT_EQUAL_INT_UPGRADE(0, dest_y); int start_y = -WINDOW_H + MOMENTS_INIT_H; dest_y = OUTSIDE_Y; __t__get_draw_down_view_y(100, 100, &dest_y); - TEST_ASSERT_EQUAL_INT(OUTSIDE_Y, dest_y); + TEST_ASSERT_EQUAL_INT_UPGRADE(OUTSIDE_Y, dest_y); dest_y = OUTSIDE_Y; __t__get_draw_down_view_y(100, 30, &dest_y); - TEST_ASSERT_EQUAL_INT(OUTSIDE_Y, dest_y); + TEST_ASSERT_EQUAL_INT_UPGRADE(OUTSIDE_Y, dest_y); dest_y = OUTSIDE_Y; __t__get_draw_down_view_y(200, 300, &dest_y); - TEST_ASSERT_EQUAL_INT(OUTSIDE_Y, dest_y); + TEST_ASSERT_EQUAL_INT_UPGRADE(OUTSIDE_Y, dest_y); dest_y = OUTSIDE_Y; __t__get_draw_down_view_y(100, 111, &dest_y); - TEST_ASSERT_EQUAL_INT(OUTSIDE_Y, dest_y); + TEST_ASSERT_EQUAL_INT_UPGRADE(OUTSIDE_Y, dest_y); dest_y = OUTSIDE_Y; __t__get_draw_down_view_y(100, MOMENTS_INIT_H, &dest_y); - TEST_ASSERT_EQUAL_INT(OUTSIDE_Y, dest_y); + TEST_ASSERT_EQUAL_INT_UPGRADE(OUTSIDE_Y, dest_y); dest_y = OUTSIDE_Y; __t__get_draw_down_view_y(100, MOMENTS_INIT_H + 1, &dest_y); - TEST_ASSERT_EQUAL_INT(start_y + 1, dest_y); + TEST_ASSERT_EQUAL_INT_UPGRADE(start_y + 1, dest_y); dest_y = OUTSIDE_Y; __t__get_draw_down_view_y(50, MOMENTS_INIT_H + 100, &dest_y); - TEST_ASSERT_EQUAL_INT(start_y + 100, dest_y); + TEST_ASSERT_EQUAL_INT_UPGRADE(start_y + 100, dest_y); - *is_passed = true; + TEST_CASE_DONE(s_info.group); } -static void __case_control_layout_alpha(bool * is_passed) +static unit_case_func_t __case_control_layout_alpha(void * data) { - TEST_ASSERT_EQUAL_INT(0, __t__get_control_layout_alpha(MOMENTS_INIT_H)); - TEST_ASSERT_EQUAL_INT(0, __t__get_control_layout_alpha((MOMENTS_INIT_H + MOMENT_BUTTON_VI_START_Y) / 2)); - TEST_ASSERT_EQUAL_INT(125, __t__get_control_layout_alpha(MOMENT_BUTTON_VI_START_Y)); - TEST_ASSERT_EQUAL_INT(190, __t__get_control_layout_alpha((MOMENT_BUTTON_VI_START_Y + MOMENT_BUTTON_VI_END_Y) / 2.0)); - TEST_ASSERT_EQUAL_INT(156, __t__get_control_layout_alpha(MOMENT_BUTTON_VI_START_Y + ((MOMENT_BUTTON_VI_END_Y - MOMENT_BUTTON_VI_START_Y) / 4.0))); - TEST_ASSERT_EQUAL_INT(221, __t__get_control_layout_alpha(MOMENT_BUTTON_VI_START_Y + ((MOMENT_BUTTON_VI_END_Y - MOMENT_BUTTON_VI_START_Y) * 3.0 / 4.0))); - TEST_ASSERT_EQUAL_INT(255, __t__get_control_layout_alpha(MOMENT_BUTTON_VI_END_Y)); - - *is_passed = true; + TEST_ASSERT_EQUAL_INT_UPGRADE(0, __t__get_control_layout_alpha(MOMENTS_INIT_H)); + TEST_ASSERT_EQUAL_INT_UPGRADE(0, __t__get_control_layout_alpha((MOMENTS_INIT_H + MOMENT_BUTTON_VI_START_Y) / 2)); + TEST_ASSERT_EQUAL_INT_UPGRADE(125, __t__get_control_layout_alpha(MOMENT_BUTTON_VI_START_Y)); + TEST_ASSERT_EQUAL_INT_UPGRADE(190, __t__get_control_layout_alpha((MOMENT_BUTTON_VI_START_Y + MOMENT_BUTTON_VI_END_Y) / 2.0)); + TEST_ASSERT_EQUAL_INT_UPGRADE(156, __t__get_control_layout_alpha(MOMENT_BUTTON_VI_START_Y + ((MOMENT_BUTTON_VI_END_Y - MOMENT_BUTTON_VI_START_Y) / 4.0))); + TEST_ASSERT_EQUAL_INT_UPGRADE(221, __t__get_control_layout_alpha(MOMENT_BUTTON_VI_START_Y + ((MOMENT_BUTTON_VI_END_Y - MOMENT_BUTTON_VI_START_Y) * 3.0 / 4.0))); + TEST_ASSERT_EQUAL_INT_UPGRADE(255, __t__get_control_layout_alpha(MOMENT_BUTTON_VI_END_Y)); + + TEST_CASE_DONE(s_info.group); } -void group_function_moments_view(unit_group_t * group) +static unit_case_func_t __case_control_button_create(void * data) { - TEST_CASE(group, __case_check_view_position); - TEST_CASE(group, __case_control_layout_alpha); + int button_id = (int)data; + + Evas_Object * base_layout = win_create("TEST"); + + control_info_t *button = moments_control_create_button(base_layout, button_id); + TEST_ASSERT_TRUE_UPGRADE(button != NULL); + + TEST_ASSERT_EQUAL_INT_UPGRADE(control_button_list[button_id].btn_type, button->btn_type); + + TEST_ASSERT_TRUE_UPGRADE(control_button_list[button_id].label != NULL); + TEST_ASSERT_EQUAL_STRING_UPGRADE(control_button_list[button_id].label, button->label); + + TEST_ASSERT_TRUE_UPGRADE(control_button_list[button_id].icon_image != NULL); + TEST_ASSERT_EQUAL_STRING_UPGRADE(control_button_list[button_id].icon_image, button->icon_image); + + TEST_ASSERT_TRUE_UPGRADE(control_button_list[button_id].volume_text != NULL); + TEST_ASSERT_EQUAL_STRING_UPGRADE(control_button_list[button_id].volume_text, button->volume_text); - group->finish(group); + TEST_ASSERT_EQUAL_INT_UPGRADE(control_button_list[button_id].icon_status, button->icon_status); + TEST_ASSERT_EQUAL_INT_UPGRADE(control_button_list[button_id].more_opt_status, button->more_opt_status); + TEST_ASSERT_EQUAL_INT_UPGRADE(control_button_list[button_id].index, button->index); + + TEST_ASSERT_TRUE_UPGRADE(control_button_list[button_id].pressed == button->pressed); + + TEST_ASSERT_TRUE_UPGRADE(button->button_layout != NULL); + + Evas_Object * icon = elm_object_part_content_get(button->button_layout, CONTROLS_ICON); + TEST_ASSERT_TRUE_UPGRADE(icon != NULL); + + const char *image_path = NULL; + elm_image_file_get(icon, &image_path, NULL); + TEST_ASSERT_TRUE_UPGRADE(image_path != NULL); + + char expected_path[MAX_FILE_PATH_LEN] = {0}; + snprintf(expected_path, MAX_FILE_PATH_LEN, "%simages/%s", app_get_resource_path(), control_button_list[button_id].icon_image); + + TEST_ASSERT_EQUAL_STRING_UPGRADE(expected_path, image_path); + + Evas_Object * text = NULL; + Evas_Object * bar = NULL; + + switch (button->btn_type) { + case MOMENTS_CONTROLS_BTN_TYPE_ICON_AND_TEXT: + text = (Evas_Object *)edje_object_part_object_get(elm_layout_edje_get(button->button_layout), CONTROLS_TEXT); + TEST_ASSERT_TRUE_UPGRADE(text != NULL); + + TEST_ASSERT_EQUAL_STRING(control_button_list[button_id].volume_text, elm_object_part_text_get(button->button_layout, CONTROLS_TEXT)); + break; + case MOMENTS_CONTROLS_BTN_TYPE_ICON_AND_BAR: + bar = (Evas_Object *)edje_object_part_object_get(elm_layout_edje_get(button->button_layout), CONTROLS_BAR); + TEST_ASSERT_TRUE_UPGRADE(bar != NULL); + + break; + default : + break; + } + + moments_control_destroy_button(button); + win_destroy(base_layout); + + TEST_CASE_DONE(s_info.group); +} + +void group_function_moments_view(unit_group_t * group) +{ + s_info.group = group; + s_info.group->set_up = __set_up; + s_info.group->tear_down = __tear_down; + + TEST_CASE_ADD(group, __case_check_view_position, NULL); + TEST_CASE_ADD(group, __case_control_layout_alpha, NULL); + TEST_CASE_ADD(group, __case_control_button_create, (void*)0); + TEST_CASE_ADD(group, __case_control_button_create, (void*)1); + TEST_CASE_ADD(group, __case_control_button_create, (void*)2); + TEST_CASE_ADD(group, __case_control_button_create, (void*)3); + TEST_CASE_ADD(group, __case_control_button_create, (void*)4); + TEST_CASE_ADD(group, __case_control_button_create, (void*)5); + + TEST_GROUP_RUN(s_info.group); } #endif diff --git a/test/unit/inc/unit_assert.h b/test/unit/inc/unit_assert.h index ff0682a..7d7e093 100755 --- a/test/unit/inc/unit_assert.h +++ b/test/unit/inc/unit_assert.h @@ -44,6 +44,13 @@ return; \ } \ } +#define TEST_ASSERT_EQUAL_STRING_UPGRADE(expected_value, input_value) { \ + bool __ret = unit_assert_equal_string_upgrade((expected_value), (input_value), (__FUNCTION__), (__LINE__)); \ + if (!__ret) { \ + TEST_CASE_FAIL(); \ + return EINA_FALSE; \ + } \ + } #define TEST_ASSERT_EQUAL_OBJECT(expected_value, input_value, compare_func) { \ bool __ret = unit_assert_equal_object((expected_value), (input_value), (compare_func), (__FUNCTION__), (__LINE__)); \ if (!__ret) { \ |