elm_gengrid_item_prepend UTC added
authorjh0506.yun <jh0506.yun@samsung.com>
Wed, 27 Oct 2010 06:38:14 +0000 (15:38 +0900)
committerjh0506.yun <jh0506.yun@samsung.com>
Wed, 27 Oct 2010 06:38:14 +0000 (15:38 +0900)
TC/elm_ts/gengrid/Makefile
TC/elm_ts/gengrid/tslist
TC/elm_ts/gengrid/utc_UIFW_elm_gengrid_item_prepend_func.c [new file with mode: 0644]

index 53feb79..60d4702 100755 (executable)
@@ -4,6 +4,7 @@ TARGETS = utc_UIFW_elm_gengrid_add_func \
          utc_UIFW_elm_gengrid_item_size_get_func \
          utc_UIFW_elm_gengrid_align_get_func \
          utc_UIFW_elm_gengrid_item_append_func \
+         utc_UIFW_elm_gengrid_item_prepend_func \
          utc_UIFW_elm_gengrid_item_object_get_func \
          utc_UIFW_elm_gengrid_item_data_get_func \
          utc_UIFW_elm_gengrid_item_pos_get_func \
index a06a6dd..5797691 100644 (file)
@@ -2,6 +2,7 @@
 /elm_ts/gengrid/utc_UIFW_elm_gengrid_item_size_get_func
 /elm_ts/gengrid/utc_UIFW_elm_gengrid_align_get_func
 /elm_ts/gengrid/utc_UIFW_elm_gengrid_item_append_func
+/elm_ts/gengrid/utc_UIFW_elm_gengrid_item_prepend_func
 /elm_ts/gengrid/utc_UIFW_elm_gengrid_item_object_get_func
 /elm_ts/gengrid/utc_UIFW_elm_gengrid_item_data_get_func
 /elm_ts/gengrid/utc_UIFW_elm_gengrid_item_pos_get_func
diff --git a/TC/elm_ts/gengrid/utc_UIFW_elm_gengrid_item_prepend_func.c b/TC/elm_ts/gengrid/utc_UIFW_elm_gengrid_item_prepend_func.c
new file mode 100644 (file)
index 0000000..7823d48
--- /dev/null
@@ -0,0 +1,146 @@
+#include <tet_api.h>
+#include <Elementary.h>
+
+// Definitions
+// For checking the result of the positive test case.
+#define TET_CHECK_PASS(x1, y...) \
+{ \
+       if (y == (x1)) \
+               { \
+                       tet_printf("[TET_CHECK_PASS]:: %s[%d] : Test has failed..", __FILE__,__LINE__); \
+                       tet_result(TET_FAIL); \
+                       return; \
+               } \
+}
+
+// For checking the result of the negative test case.
+#define TET_CHECK_FAIL(x1, y...) \
+{ \
+       if (y != (x1)) \
+               { \
+                       tet_printf("[TET_CHECK_FAIL]:: %s[%d] : Test has failed..", __FILE__,__LINE__); \
+                       tet_result(TET_FAIL); \
+                       return; \
+               } \
+}
+
+Evas_Object *main_win, *main_bg;
+Evas_Object *test_win, *test_bg;
+Evas_Object *test_eo = NULL;
+Elm_Gengrid_Item_Class gic;
+
+void _elm_precondition(void);
+static void _win_del(void *data, Evas_Object *obj, void *event_info);
+
+static void _win_del(void *data, Evas_Object *obj, void *event_info)
+{
+       elm_exit();
+}
+
+void _elm_precondition(void)
+{
+       elm_init(0, NULL);
+
+       main_win = elm_win_add(NULL, "main", ELM_WIN_BASIC);
+       elm_win_title_set(main_win, "Elementary Unit Test Suite");
+       evas_object_smart_callback_add(main_win, "delete,request", _win_del, NULL);
+       main_bg = elm_bg_add(main_win);
+       evas_object_size_hint_weight_set(main_bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+
+       evas_object_resize(main_win, 320, 480);
+       evas_object_show(main_win);     
+}
+
+static void startup(void);
+static void cleanup(void);
+
+void (*tet_startup)(void) = startup;
+void (*tet_cleanup)(void) = cleanup;
+
+static void utc_UIFW_elm_gengrid_item_append_func_01(void);
+static void utc_UIFW_elm_gengrid_item_append_func_02(void);
+
+enum {
+       POSITIVE_TC_IDX = 0x01,
+       NEGATIVE_TC_IDX,
+};
+
+struct tet_testlist tet_testlist[] = {
+       { utc_UIFW_elm_gengrid_item_append_func_01, POSITIVE_TC_IDX },
+       { utc_UIFW_elm_gengrid_item_append_func_02, NEGATIVE_TC_IDX },
+};
+
+static void startup(void)
+{
+       tet_infoline("[[ TET_MSG ]]:: ============ Startup ============ ");
+
+       _elm_precondition();
+
+       test_win = elm_win_add(NULL, "Page Control", ELM_WIN_BASIC);
+       elm_win_title_set(test_win, "Page Control");
+       elm_win_autodel_set(test_win, 1);
+       
+       test_bg = elm_bg_add(test_win);
+       elm_win_resize_object_add(test_win, test_bg);
+       evas_object_size_hint_weight_set(test_bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+       evas_object_show(test_bg);
+       
+       evas_object_resize(test_win, 480, 800);
+       evas_object_show(test_win);
+
+       test_eo = elm_gengrid_add(test_win);
+       gic.item_style = "default_grid";
+       gic.func.label_get = NULL;
+       gic.func.icon_get = NULL;
+       
+       tet_infoline("[[ TET_MSG ]]:: Completing startup");
+}
+
+static void cleanup(void)
+{
+       if ( NULL != main_win ) {
+               main_win = NULL;
+       }
+       
+       if ( NULL != main_bg ) {
+               main_bg = NULL;
+       }
+       
+       if ( NULL != test_win ) {
+               test_win = NULL;
+       }
+       
+       if ( NULL != test_bg ) {
+               test_bg = NULL;
+       }
+       
+       if ( NULL != test_eo ) {
+               test_eo = NULL;
+       }
+       
+       elm_exit();
+       
+       tet_infoline("[[ TET_MSG ]]:: ============ Cleanup ============ ");
+}
+
+static void utc_UIFW_elm_gengrid_item_append_func_01(void)
+{
+       Elm_Gengrid_Item *item = NULL;
+       
+       item = elm_gengrid_item_prepend(test_eo, &gic, NULL, NULL, NULL);
+       TET_CHECK_PASS(NULL, item);
+       
+       tet_result(TET_PASS);
+       tet_infoline("[[ TET_MSG ]]::[ID]:TC_01, [TYPE]: Positive, [RESULT]:PASS, elm_gengrid_item_append");
+}
+
+static void utc_UIFW_elm_gengrid_item_append_func_02(void)
+{
+       Elm_Gengrid_Item *item = NULL;
+
+       item = elm_gengrid_item_prepend(NULL, NULL, NULL, NULL, NULL);
+       TET_CHECK_FAIL(NULL, item);
+       
+       tet_result(TET_PASS);
+       tet_infoline("[[ TET_MSG ]]::[ID]:TC_02, [TYPE]: Negative, [RESULT]:PASS, elm_gengrid_item_append");
+}