From: Sohyun Kim Date: Tue, 14 Sep 2010 04:41:19 +0000 (+0900) Subject: [datefield]add testcases X-Git-Tag: origin~211 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6cef6c4f3c64c0af08c21dc7b0f8cd40706c9b77;p=framework%2Fuifw%2Felementary.git [datefield]add testcases --- diff --git a/TC/elm_ts/datefield/Makefile b/TC/elm_ts/datefield/Makefile index 6f63cd1..cea1778 100755 --- a/TC/elm_ts/datefield/Makefile +++ b/TC/elm_ts/datefield/Makefile @@ -6,7 +6,11 @@ TARGETS = utc_UIFW_elm_datefield_add_func \ utc_UIFW_elm_datefield_date_set_func \ utc_UIFW_elm_datefield_date_get_func \ utc_UIFW_elm_datefield_time_mode_set_func \ - utc_UIFW_elm_datefield_time_mode_get_func + utc_UIFW_elm_datefield_time_mode_get_func \ + utc_UIFW_elm_datefield_date_format_set_func \ + utc_UIFW_elm_datefield_date_format_get_func \ + utc_UIFW_elm_datefield_input_panel_state_callback_add \ + utc_UIFW_elm_datefield_input_panel_state_callback_del PKGS = elementary diff --git a/TC/elm_ts/datefield/tslist b/TC/elm_ts/datefield/tslist index 14844c0..bd14c58 100644 --- a/TC/elm_ts/datefield/tslist +++ b/TC/elm_ts/datefield/tslist @@ -5,3 +5,7 @@ /elm_ts/datefield/utc_UIFW_elm_datefield_date_get_func /elm_ts/datefield/utc_UIFW_elm_datefield_time_mode_set_func /elm_ts/datefield/utc_UIFW_elm_datefield_time_mode_get_func +/elm_ts/datefield/utc_UIFW_elm_datefield_date_format_set_func +/elm_ts/datefield/utc_UIFW_elm_datefield_date_format_get_func +/elm_ts/datefield/utc_UIFW_elm_datefield_input_panel_state_callback_add_func +/elm_ts/datefield/utc_UIFW_elm_datefield_input_panel_state_callback_del_func diff --git a/TC/elm_ts/datefield/utc_UIFW_elm_datefield_date_format_get_func.c b/TC/elm_ts/datefield/utc_UIFW_elm_datefield_date_format_get_func.c new file mode 100644 index 0000000..fd1025d --- /dev/null +++ b/TC/elm_ts/datefield/utc_UIFW_elm_datefield_date_format_get_func.c @@ -0,0 +1,108 @@ +#include +#include + +// Definitions +// For checking the result of the positive test case. +#define TET_CHECK_PASS(x1, y...) \ +{ \ + Evas_Object *err = y; \ + if (err == (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...) \ +{ \ + Evas_Object *err = y; \ + if (err != (x1)) \ + { \ + tet_printf("[TET_CHECK_FAIL]:: %s[%d] : Test has failed..", __FILE__,__LINE__); \ + tet_result(TET_FAIL); \ + return; \ + } \ +} + + +static Evas_Object *main_win; +static Evas_Object *datefield; + +static void startup(void); +static void cleanup(void); + +void (*tet_startup)(void) = startup; +void (*tet_cleanup)(void) = cleanup; + +static void utc_UIFW_elm_datefield_date_format_get_func_01(void); +static void utc_UIFW_elm_datefield_date_format_get_func_02(void); + +enum { + POSITIVE_TC_IDX = 0x01, + NEGATIVE_TC_IDX, +}; + +struct tet_testlist tet_testlist[] = { + { utc_UIFW_elm_datefield_date_format_get_func_01, POSITIVE_TC_IDX }, + { utc_UIFW_elm_datefield_date_format_get_func_02, NEGATIVE_TC_IDX }, +}; + +static void startup(void) +{ + tet_infoline("[[ TET_MSG ]]:: ============ Startup ============ "); + elm_init(0, NULL); + main_win = elm_win_add(NULL, "main", ELM_WIN_BASIC); + evas_object_show(main_win); +} + +static void cleanup(void) +{ + if ( NULL != datefield ) { + evas_object_del(datefield); + datefield = NULL; + } + if ( NULL != main_win ) { + evas_object_del(main_win); + main_win = NULL; + } + elm_shutdown(); + tet_infoline("[[ TET_MSG ]]:: ============ Cleanup ============ "); +} + +/** + * @brief Positive test case of elm_datefield_date_format_get() + */ +static void utc_UIFW_elm_datefield_date_format_get_func_01(void) +{ + const char *format = NULL; + + datefield = elm_datefield_add(main_win); + format = elm_datefield_date_format_get(datefield); + + if (strcmp(format, "mmddyy")) { + tet_infoline("elm_datefield_date_format_get() failed in positive test case"); + tet_result(TET_FAIL); + return; + } + tet_result(TET_PASS); +} + +/** + * @brief Negative test case of ug_init elm_datefield_date_format_get() + */ +static void utc_UIFW_elm_datefield_date_format_get_func_02(void) +{ + const char *format = NULL; + + datefield = elm_datefield_add(main_win); + format = elm_datefield_date_format_get(NULL); + + if (!strcmp(format, "mmddyy")) { + tet_infoline("elm_datefield_date_format_get() failed in negative test case"); + tet_result(TET_FAIL); + return; + } + tet_result(TET_PASS); +} diff --git a/TC/elm_ts/datefield/utc_UIFW_elm_datefield_date_format_set_func.c b/TC/elm_ts/datefield/utc_UIFW_elm_datefield_date_format_set_func.c new file mode 100644 index 0000000..10665a4 --- /dev/null +++ b/TC/elm_ts/datefield/utc_UIFW_elm_datefield_date_format_set_func.c @@ -0,0 +1,104 @@ +#include +#include + +// Definitions +// For checking the result of the positive test case. +#define TET_CHECK_PASS(x1, y...) \ +{ \ + Evas_Object *err = y; \ + if (err == (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...) \ +{ \ + Evas_Object *err = y; \ + if (err != (x1)) \ + { \ + tet_printf("[TET_CHECK_FAIL]:: %s[%d] : Test has failed..", __FILE__,__LINE__); \ + tet_result(TET_FAIL); \ + return; \ + } \ +} + + +static Evas_Object *main_win; +static Evas_Object *datefield; + +static void startup(void); +static void cleanup(void); + +void (*tet_startup)(void) = startup; +void (*tet_cleanup)(void) = cleanup; + +static void utc_UIFW_elm_datefield_date_format_set_func_01(void); +static void utc_UIFW_elm_datefield_date_format_set_func_02(void); + +enum { + POSITIVE_TC_IDX = 0x01, + NEGATIVE_TC_IDX, +}; + +struct tet_testlist tet_testlist[] = { + { utc_UIFW_elm_datefield_date_format_set_func_01, POSITIVE_TC_IDX }, + { utc_UIFW_elm_datefield_date_format_set_func_02, NEGATIVE_TC_IDX }, +}; + +static void startup(void) +{ + tet_infoline("[[ TET_MSG ]]:: ============ Startup ============ "); + elm_init(0, NULL); + main_win = elm_win_add(NULL, "main", ELM_WIN_BASIC); + evas_object_show(main_win); +} + +static void cleanup(void) +{ + if ( NULL != datefield ) { + evas_object_del(datefield); + datefield = NULL; + } + if ( NULL != main_win ) { + evas_object_del(main_win); + main_win = NULL; + } + elm_shutdown(); + tet_infoline("[[ TET_MSG ]]:: ============ Cleanup ============ "); +} + +/** + * @brief Positive test case of elm_datefield_date_format_set() + */ +static void utc_UIFW_elm_datefield_date_format_set_func_01(void) +{ + datefield = elm_datefield_add(main_win); + elm_datefield_date_format_set(datefield, "ddmmyy"); + + if (strcmp(elm_datefield_date_format_get(datefield), "ddmmyy")) { + tet_infoline("elm_datefield_date_format_set() failed in positive test case"); + tet_result(TET_FAIL); + return; + } + tet_result(TET_PASS); +} + +/** + * @brief Negative test case of ug_init elm_datefield_date_format_set() + */ +static void utc_UIFW_elm_datefield_date_format_set_func_02(void) +{ + datefield = elm_datefield_add(main_win); + elm_datefield_date_format_set(datefield, "dmydmy"); + + if (strcmp(elm_datefield_date_format_get(datefield), "mmddyy")) { + tet_infoline("elm_datefield_date_format_set() failed in negative test case"); + tet_result(TET_FAIL); + return; + } + tet_result(TET_PASS); +} diff --git a/TC/elm_ts/datefield/utc_UIFW_elm_datefield_input_panel_state_callback_add_func b/TC/elm_ts/datefield/utc_UIFW_elm_datefield_input_panel_state_callback_add_func new file mode 100755 index 0000000..19c2797 Binary files /dev/null and b/TC/elm_ts/datefield/utc_UIFW_elm_datefield_input_panel_state_callback_add_func differ diff --git a/TC/elm_ts/datefield/utc_UIFW_elm_datefield_input_panel_state_callback_add_func.c b/TC/elm_ts/datefield/utc_UIFW_elm_datefield_input_panel_state_callback_add_func.c new file mode 100644 index 0000000..c2ab11e --- /dev/null +++ b/TC/elm_ts/datefield/utc_UIFW_elm_datefield_input_panel_state_callback_add_func.c @@ -0,0 +1,108 @@ +#include +#include + +// Definitions +// For checking the result of the positive test case. +#define TET_CHECK_PASS(x1, y...) \ +{ \ + Evas_Object *err = y; \ + if (err == (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...) \ +{ \ + Evas_Object *err = y; \ + if (err != (x1)) \ + { \ + tet_printf("[TET_CHECK_FAIL]:: %s[%d] : Test has failed..", __FILE__,__LINE__); \ + tet_result(TET_FAIL); \ + return; \ + } \ +} + + +static Evas_Object *main_win; +static Evas_Object *datefield; + +static void startup(void); +static void cleanup(void); + +void (*tet_startup)(void) = startup; +void (*tet_cleanup)(void) = cleanup; + +static void utc_UIFW_elm_datefield_input_panel_state_callback_add_func_01(void); +static void utc_UIFW_elm_datefield_input_panel_state_callback_add_func_02(void); + +enum { + POSITIVE_TC_IDX = 0x01, + NEGATIVE_TC_IDX, +}; + +struct tet_testlist tet_testlist[] = { + { utc_UIFW_elm_datefield_input_panel_state_callback_add_func_01, POSITIVE_TC_IDX }, + { utc_UIFW_elm_datefield_input_panel_state_callback_add_func_02, NEGATIVE_TC_IDX }, +}; + +static void startup(void) +{ + tet_infoline("[[ TET_MSG ]]:: ============ Startup ============ "); + elm_init(0, NULL); + main_win = elm_win_add(NULL, "main", ELM_WIN_BASIC); + evas_object_show(main_win); +} + +static void cleanup(void) +{ + if ( NULL != datefield) { + evas_object_del(datefield); + datefield = NULL; + } + if ( NULL != main_win ) { + evas_object_del(main_win); + main_win = NULL; + } + elm_shutdown(); + tet_infoline("[[ TET_MSG ]]:: ============ Cleanup ============ "); +} + +static void _input_panel_state_cb(void *data, Evas_Object *obj, int value) +{ +} + +/** + * @brief Positive test case of elm_datefield_input_panel_state_callback_add() + */ +static void utc_UIFW_elm_datefield_input_panel_state_callback_add_func_01(void) +{ + datefield = elm_datefield_add(main_win); + elm_datefield_input_panel_state_callback_add(datefield, _input_panel_state_cb, NULL); + + /*if (!r) { + tet_infoline("elm_datefield_input_panel_state_callback_add() failed in positive test case"); + tet_result(TET_FAIL); + return; + }*/ + tet_result(TET_PASS); +} + +/** + * @brief Negative test case of ug_init elm_datefield_input_panel_state_callback_add() + */ +static void utc_UIFW_elm_datefield_input_panel_state_callback_add_func_02(void) +{ + datefield = elm_datefield_add(main_win); + elm_datefield_input_panel_state_callback_add(NULL, _input_panel_state_cb, NULL); + + /*if (r) { + tet_infoline("elm_datefield_input_panel_state_callback_add() failed in negative test case"); + tet_result(TET_FAIL); + return; + }*/ + tet_result(TET_PASS); +} diff --git a/TC/elm_ts/datefield/utc_UIFW_elm_datefield_input_panel_state_callback_del_func b/TC/elm_ts/datefield/utc_UIFW_elm_datefield_input_panel_state_callback_del_func new file mode 100755 index 0000000..4fa4907 Binary files /dev/null and b/TC/elm_ts/datefield/utc_UIFW_elm_datefield_input_panel_state_callback_del_func differ diff --git a/TC/elm_ts/datefield/utc_UIFW_elm_datefield_input_panel_state_callback_del_func.c b/TC/elm_ts/datefield/utc_UIFW_elm_datefield_input_panel_state_callback_del_func.c new file mode 100644 index 0000000..2e5f659 --- /dev/null +++ b/TC/elm_ts/datefield/utc_UIFW_elm_datefield_input_panel_state_callback_del_func.c @@ -0,0 +1,108 @@ +#include +#include + +// Definitions +// For checking the result of the positive test case. +#define TET_CHECK_PASS(x1, y...) \ +{ \ + Evas_Object *err = y; \ + if (err == (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...) \ +{ \ + Evas_Object *err = y; \ + if (err != (x1)) \ + { \ + tet_printf("[TET_CHECK_FAIL]:: %s[%d] : Test has failed..", __FILE__,__LINE__); \ + tet_result(TET_FAIL); \ + return; \ + } \ +} + + +static Evas_Object *main_win; +static Evas_Object *datefield; + +static void startup(void); +static void cleanup(void); + +void (*tet_startup)(void) = startup; +void (*tet_cleanup)(void) = cleanup; + +static void utc_UIFW_elm_datefield_input_panel_state_callback_del_func_01(void); +static void utc_UIFW_elm_datefield_input_panel_state_callback_del_func_02(void); + +enum { + POSITIVE_TC_IDX = 0x01, + NEGATIVE_TC_IDX, +}; + +struct tet_testlist tet_testlist[] = { + { utc_UIFW_elm_datefield_input_panel_state_callback_del_func_01, POSITIVE_TC_IDX }, + { utc_UIFW_elm_datefield_input_panel_state_callback_del_func_02, NEGATIVE_TC_IDX }, +}; + +static void startup(void) +{ + tet_infoline("[[ TET_MSG ]]:: ============ Startup ============ "); + elm_init(0, NULL); + main_win = elm_win_add(NULL, "main", ELM_WIN_BASIC); + evas_object_show(main_win); +} + +static void cleanup(void) +{ + if ( NULL != datefield) { + evas_object_del(datefield); + datefield = NULL; + } + if ( NULL != main_win ) { + evas_object_del(main_win); + main_win = NULL; + } + elm_shutdown(); + tet_infoline("[[ TET_MSG ]]:: ============ Cleanup ============ "); +} + +static void _input_panel_state_cb(void *data, Evas_Object *obj, int value) +{ +} + +/** + * @brief Positive test case of elm_datefield_input_panel_state_callback_del() + */ +static void utc_UIFW_elm_datefield_input_panel_state_callback_del_func_01(void) +{ + datefield = elm_datefield_add(main_win); + elm_datefield_input_panel_state_callback_del(datefield, _input_panel_state_cb); + + /*if (!r) { + tet_infoline("elm_datefield_input_panel_state_callback_del() failed in positive test case"); + tet_result(TET_FAIL); + return; + }*/ + tet_result(TET_PASS); +} + +/** + * @brief Negative test case of ug_init elm_datefield_input_panel_state_callback_del() + */ +static void utc_UIFW_elm_datefield_input_panel_state_callback_del_func_02(void) +{ + datefield = elm_datefield_add(main_win); + elm_datefield_input_panel_state_callback_del(NULL, _input_panel_state_cb); + + /*if (r) { + tet_infoline("elm_datefield_input_panel_state_callback_del() failed in negative test case"); + tet_result(TET_FAIL); + return; + }*/ + tet_result(TET_PASS); +}