From a1dcf7af9b6a8556714a91113b3eb66f04ae3cec Mon Sep 17 00:00:00 2001 From: Hyunsil Date: Mon, 27 Sep 2010 16:07:56 +0900 Subject: [PATCH] [multibuttonentry] add TestCase --- TC/elm_ts/multibuttonentry/Makefile | 40 ++++ TC/elm_ts/multibuttonentry/tc_gen.sh | 32 ++++ TC/elm_ts/multibuttonentry/tslist | 17 ++ .../multibuttonentry/utc_MODULE_API_func.c.in | 104 ++++++++++ .../utc_UIFW_elm_multibuttonentry_add_func.c | 176 +++++++++++++++++ .../utc_UIFW_elm_multibuttonentry_entry_get_func.c | 182 ++++++++++++++++++ ...UIFW_elm_multibuttonentry_item_add_after_func.c | 191 +++++++++++++++++++ ...IFW_elm_multibuttonentry_item_add_before_func.c | 191 +++++++++++++++++++ ...c_UIFW_elm_multibuttonentry_item_add_end_func.c | 192 +++++++++++++++++++ ...UIFW_elm_multibuttonentry_item_add_start_func.c | 191 +++++++++++++++++++ ..._UIFW_elm_multibuttonentry_item_data_get_func.c | 176 +++++++++++++++++ .../utc_UIFW_elm_multibuttonentry_item_del_func.c | 196 +++++++++++++++++++ ...UIFW_elm_multibuttonentry_item_first_get_func.c | 192 +++++++++++++++++++ ...UIFW_elm_multibuttonentry_item_label_get_func.c | 184 ++++++++++++++++++ ..._UIFW_elm_multibuttonentry_item_last_get_func.c | 192 +++++++++++++++++++ .../utc_UIFW_elm_multibuttonentry_item_next_func.c | 176 +++++++++++++++++ .../utc_UIFW_elm_multibuttonentry_item_prev_func.c | 176 +++++++++++++++++ ...W_elm_multibuttonentry_item_selected_get_func.c | 191 +++++++++++++++++++ .../utc_UIFW_elm_multibuttonentry_items_del_func.c | 176 +++++++++++++++++ .../utc_UIFW_elm_multibuttonentry_items_get_func.c | 212 +++++++++++++++++++++ .../utc_UIFW_elm_multibuttonentry_label_get_func.c | 185 ++++++++++++++++++ 21 files changed, 3372 insertions(+) create mode 100755 TC/elm_ts/multibuttonentry/Makefile create mode 100755 TC/elm_ts/multibuttonentry/tc_gen.sh create mode 100755 TC/elm_ts/multibuttonentry/tslist create mode 100755 TC/elm_ts/multibuttonentry/utc_MODULE_API_func.c.in create mode 100755 TC/elm_ts/multibuttonentry/utc_UIFW_elm_multibuttonentry_add_func.c create mode 100755 TC/elm_ts/multibuttonentry/utc_UIFW_elm_multibuttonentry_entry_get_func.c create mode 100755 TC/elm_ts/multibuttonentry/utc_UIFW_elm_multibuttonentry_item_add_after_func.c create mode 100755 TC/elm_ts/multibuttonentry/utc_UIFW_elm_multibuttonentry_item_add_before_func.c create mode 100755 TC/elm_ts/multibuttonentry/utc_UIFW_elm_multibuttonentry_item_add_end_func.c create mode 100755 TC/elm_ts/multibuttonentry/utc_UIFW_elm_multibuttonentry_item_add_start_func.c create mode 100755 TC/elm_ts/multibuttonentry/utc_UIFW_elm_multibuttonentry_item_data_get_func.c create mode 100755 TC/elm_ts/multibuttonentry/utc_UIFW_elm_multibuttonentry_item_del_func.c create mode 100755 TC/elm_ts/multibuttonentry/utc_UIFW_elm_multibuttonentry_item_first_get_func.c create mode 100755 TC/elm_ts/multibuttonentry/utc_UIFW_elm_multibuttonentry_item_label_get_func.c create mode 100755 TC/elm_ts/multibuttonentry/utc_UIFW_elm_multibuttonentry_item_last_get_func.c create mode 100755 TC/elm_ts/multibuttonentry/utc_UIFW_elm_multibuttonentry_item_next_func.c create mode 100755 TC/elm_ts/multibuttonentry/utc_UIFW_elm_multibuttonentry_item_prev_func.c create mode 100755 TC/elm_ts/multibuttonentry/utc_UIFW_elm_multibuttonentry_item_selected_get_func.c create mode 100755 TC/elm_ts/multibuttonentry/utc_UIFW_elm_multibuttonentry_items_del_func.c create mode 100755 TC/elm_ts/multibuttonentry/utc_UIFW_elm_multibuttonentry_items_get_func.c create mode 100755 TC/elm_ts/multibuttonentry/utc_UIFW_elm_multibuttonentry_label_get_func.c diff --git a/TC/elm_ts/multibuttonentry/Makefile b/TC/elm_ts/multibuttonentry/Makefile new file mode 100755 index 0000000..7253c8c --- /dev/null +++ b/TC/elm_ts/multibuttonentry/Makefile @@ -0,0 +1,40 @@ +CC ?= gcc + +TARGETS = utc_UIFW_elm_multibuttonentry_add_func \ + utc_UIFW_elm_multibuttonentry_label_get_func \ + utc_UIFW_elm_multibuttonentry_entry_get_func \ + utc_UIFW_elm_multibuttonentry_item_add_start_func \ + utc_UIFW_elm_multibuttonentry_item_add_end_func \ + utc_UIFW_elm_multibuttonentry_item_add_before_func \ + utc_UIFW_elm_multibuttonentry_item_add_after_func \ + utc_UIFW_elm_multibuttonentry_items_get_func \ + utc_UIFW_elm_multibuttonentry_item_first_get_func \ + utc_UIFW_elm_multibuttonentry_item_last_get_func \ + utc_UIFW_elm_multibuttonentry_item_selected_get_func \ + utc_UIFW_elm_multibuttonentry_item_del_func \ + utc_UIFW_elm_multibuttonentry_items_del_func \ + utc_UIFW_elm_multibuttonentry_item_label_get_func \ + utc_UIFW_elm_multibuttonentry_item_prev_func \ + utc_UIFW_elm_multibuttonentry_item_next_func \ + utc_UIFW_elm_multibuttonentry_item_data_get_func + +PKGS = elementary + +LDFLAGS = `pkg-config --libs $(PKGS)` +LDFLAGS += $(TET_ROOT)/lib/tet3/tcm_s.o +LDFLAGS += -L$(TET_ROOT)/lib/tet3 -ltcm_s +LDFLAGS += -L$(TET_ROOT)/lib/tet3 -lapi_s + +CFLAGS = -I. `pkg-config --cflags $(PKGS)` +CFLAGS += -I$(TET_ROOT)/inc/tet3 +CFLAGS += -Wall + +all: $(TARGETS) + +$(TARGET): %: %.c + $(CC) -o $@ $< $(CFLAGS) $(LDFLAGS) + +clean: + rm -f $(TARGETS) + rm -f tet_captured + rm -f *~ diff --git a/TC/elm_ts/multibuttonentry/tc_gen.sh b/TC/elm_ts/multibuttonentry/tc_gen.sh new file mode 100755 index 0000000..a55200a --- /dev/null +++ b/TC/elm_ts/multibuttonentry/tc_gen.sh @@ -0,0 +1,32 @@ +#!/bin/sh + +TMPSTR=$0 +SCRIPT=${TMPSTR##*/} + +if [ $# -lt 3 ]; then + echo "Usage) $SCRIPT module_name winset_name api_name" + exit 1 +fi + +MODULE=$1 +WINSET=$2 +API=$3 +TEMPLATE=utc_MODULE_API_func.c.in +TESTCASE=utc_${MODULE}_${API}_func + +sed -e ' + s^@API@^'"$API"'^g + s^@MODULE@^'"$MODULE"'^g + ' $TEMPLATE > $TESTCASE.c + +if [ ! -e "$TESTCASE.c" ]; then + echo "Failed" + exit 1 +fi + +echo "/elm_ts/$WINSET/$TESTCASE" >> tslist + +echo "Testcase file is $TESTCASE.c" +echo "$TESTCASE is added to tslist" +echo "Done" +echo "please put \"$TESTCASE\" as Target in Makefile" diff --git a/TC/elm_ts/multibuttonentry/tslist b/TC/elm_ts/multibuttonentry/tslist new file mode 100755 index 0000000..54718d3 --- /dev/null +++ b/TC/elm_ts/multibuttonentry/tslist @@ -0,0 +1,17 @@ +/elm_ts/multibuttonentry/utc_UIFW_elm_multibuttonentry_add_func +/elm_ts/multibuttonentry/utc_UIFW_elm_multibuttonentry_label_get_func +/elm_ts/multibuttonentry/utc_UIFW_elm_multibuttonentry_entry_get_func +/elm_ts/multibuttonentry/utc_UIFW_elm_multibuttonentry_item_add_start_func +/elm_ts/multibuttonentry/utc_UIFW_elm_multibuttonentry_item_add_end_func +/elm_ts/multibuttonentry/utc_UIFW_elm_multibuttonentry_item_add_before_func +/elm_ts/multibuttonentry/utc_UIFW_elm_multibuttonentry_item_add_after_func +/elm_ts/multibuttonentry/utc_UIFW_elm_multibuttonentry_items_get_func +/elm_ts/multibuttonentry/utc_UIFW_elm_multibuttonentry_item_first_get_func +/elm_ts/multibuttonentry/utc_UIFW_elm_multibuttonentry_item_last_get_func +/elm_ts/multibuttonentry/utc_UIFW_elm_multibuttonentry_item_selected_get_func +/elm_ts/multibuttonentry/utc_UIFW_elm_multibuttonentry_item_del_func +/elm_ts/multibuttonentry/utc_UIFW_elm_multibuttonentry_items_del_func +/elm_ts/multibuttonentry/utc_UIFW_elm_multibuttonentry_item_label_get_func +/elm_ts/multibuttonentry/utc_UIFW_elm_multibuttonentry_item_prev_func +/elm_ts/multibuttonentry/utc_UIFW_elm_multibuttonentry_item_next_func +/elm_ts/multibuttonentry/utc_UIFW_elm_multibuttonentry_item_data_get_func diff --git a/TC/elm_ts/multibuttonentry/utc_MODULE_API_func.c.in b/TC/elm_ts/multibuttonentry/utc_MODULE_API_func.c.in new file mode 100755 index 0000000..6c6febe --- /dev/null +++ b/TC/elm_ts/multibuttonentry/utc_MODULE_API_func.c.in @@ -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; \ + } \ +} + + +Evas_Object *main_win; + +static void startup(void); +static void cleanup(void); + +void (*tet_startup)(void) = startup; +void (*tet_cleanup)(void) = cleanup; + +static void utc_@MODULE@_@API@_func_01(void); +static void utc_@MODULE@_@API@_func_02(void); + +enum { + POSITIVE_TC_IDX = 0x01, + NEGATIVE_TC_IDX, +}; + +struct tet_testlist tet_testlist[] = { + { utc_@MODULE@_@API@_func_01, POSITIVE_TC_IDX }, + { utc_@MODULE@_@API@_func_02, NEGATIVE_TC_IDX }, + { NULL, 0 } +}; + +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 != main_win ) { + evas_object_del(main_win); + main_win = NULL; + } + elm_shutdown(); + tet_infoline("[[ TET_MSG ]]:: ============ Cleanup ============ "); +} + +/** + * @brief Positive test case of @API@() + */ +static void utc_@MODULE@_@API@_func_01(void) +{ + int r = 0; + +/* + r = @API@(...); +*/ + if (!r) { + tet_infoline("@API@() failed in positive test case"); + tet_result(TET_FAIL); + return; + } + tet_result(TET_PASS); +} + +/** + * @brief Negative test case of ug_init @API@() + */ +static void utc_@MODULE@_@API@_func_02(void) +{ + int r = 0; + +/* + r = @API@(...); +*/ + if (r) { + tet_infoline("@API@() failed in negative test case"); + tet_result(TET_FAIL); + return; + } + tet_result(TET_PASS); +} diff --git a/TC/elm_ts/multibuttonentry/utc_UIFW_elm_multibuttonentry_add_func.c b/TC/elm_ts/multibuttonentry/utc_UIFW_elm_multibuttonentry_add_func.c new file mode 100755 index 0000000..0083496 --- /dev/null +++ b/TC/elm_ts/multibuttonentry/utc_UIFW_elm_multibuttonentry_add_func.c @@ -0,0 +1,176 @@ +#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; \ + } \ +} + + +Evas_Object *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_multibuttonentry_add_func_01(void); +static void utc_UIFW_elm_multibuttonentry_add_func_02(void); + +enum { + POSITIVE_TC_IDX = 0x01, + NEGATIVE_TC_IDX, +}; + +struct tet_testlist tet_testlist[] = { + { utc_UIFW_elm_multibuttonentry_add_func_01, POSITIVE_TC_IDX }, + { utc_UIFW_elm_multibuttonentry_add_func_02, NEGATIVE_TC_IDX }, + { NULL, 0 } +}; + +// Declare the global variables +Evas_Object *main_win, *main_bg; +Evas_Object *test_win, *test_bg; +Evas_Object *test_eo = NULL; +// Declare internal functions +void _elm_precondition(void); +static void _win_del(void *data, Evas_Object *obj, void *event_info); + + +// Delete main window +static void _win_del(void *data, Evas_Object *obj, void *event_info) +{ + elm_exit(); +} + +// Do precondition. +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); + elm_win_resize_object_add(main_win, main_bg); + evas_object_show(main_bg); + + // set an initial window size + evas_object_resize(main_win, 320, 480); + // show the window + evas_object_show(main_win); + + //elm_run(); +} + +// Start up function for each test purpose +static void +startup() +{ + tet_infoline("[[ TET_MSG ]]:: ============ Startup ============ "); + + // Elm precondition + _elm_precondition(); + + // Test precondition + test_win = elm_win_add(NULL, "Multi Button Entry", ELM_WIN_BASIC); + elm_win_title_set(test_win, "Multi Button Entry"); + 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); + + tet_infoline("[[ TET_MSG ]]:: Completing startup"); +} + +// Clean up function for each test purpose +static void +cleanup() +{ + tet_infoline("[[ TET_MSG ]]:: ============ Cleanup ============ "); + + // Clean up the used resources. + if ( NULL != main_win ) { + evas_object_del(main_win); + main_win = NULL; + } + + if ( NULL != main_bg ) { + evas_object_del(main_bg); + main_bg = NULL; + } + + if ( NULL != test_win ) { + evas_object_del(test_win); + test_win = NULL; + } + + if ( NULL != test_bg ) { + evas_object_del(test_bg); + test_bg = NULL; + } + + if ( NULL != test_eo ) { + evas_object_del(test_eo); + test_eo = NULL; + } + + // clean up and shut down + elm_shutdown(); ; + + tet_infoline("[[ TET_MSG ]]:: ========= TC COMPLETE ========== "); +} + + +/** + * @brief Positive test case of elm_multibuttonentry_add() + */ +static void utc_UIFW_elm_multibuttonentry_add_func_01(void) +{ + test_eo = elm_multibuttonentry_add(test_win); + TET_CHECK_PASS(NULL, test_eo); + + tet_result(TET_PASS); + tet_infoline("[[ TET_MSG ]]::[ID]:TC_01, [TYPE]: Positive, [RESULT]:PASS, elm_multibuttonentry_add()."); +} + + +/** + * @brief Negative test case of ug_init elm_multibuttonentry_add() + */ +static void utc_UIFW_elm_multibuttonentry_add_func_02(void) +{ + test_eo = elm_multibuttonentry_add(NULL); + TET_CHECK_FAIL(NULL, test_eo); + + tet_result(TET_PASS); + tet_infoline("[[ TET_MSG ]]::[ID]:TC_02, [TYPE]: Negative, [RESULT]:PASS, elm_multibuttonentry_add()."); +} + diff --git a/TC/elm_ts/multibuttonentry/utc_UIFW_elm_multibuttonentry_entry_get_func.c b/TC/elm_ts/multibuttonentry/utc_UIFW_elm_multibuttonentry_entry_get_func.c new file mode 100755 index 0000000..df6a489 --- /dev/null +++ b/TC/elm_ts/multibuttonentry/utc_UIFW_elm_multibuttonentry_entry_get_func.c @@ -0,0 +1,182 @@ +#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; \ + } \ +} + + +Evas_Object *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_multibuttonentry_entry_get_func_01(void); +static void utc_UIFW_elm_multibuttonentry_entry_get_func_02(void); + +enum { + POSITIVE_TC_IDX = 0x01, + NEGATIVE_TC_IDX, +}; + +struct tet_testlist tet_testlist[] = { + { utc_UIFW_elm_multibuttonentry_entry_get_func_01, POSITIVE_TC_IDX }, + { utc_UIFW_elm_multibuttonentry_entry_get_func_02, NEGATIVE_TC_IDX }, + { NULL, 0 } +}; + +// Declare the global variables +Evas_Object *main_win, *main_bg; +Evas_Object *test_win, *test_bg; +Evas_Object *test_eo = NULL; +// Declare internal functions +void _elm_precondition(void); +static void _win_del(void *data, Evas_Object *obj, void *event_info); + + +// Delete main window +static void _win_del(void *data, Evas_Object *obj, void *event_info) +{ + elm_exit(); +} + +// Do precondition. +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); + elm_win_resize_object_add(main_win, main_bg); + evas_object_show(main_bg); + + // set an initial window size + evas_object_resize(main_win, 320, 480); + // show the window + evas_object_show(main_win); + + //elm_run(); +} + +// Start up function for each test purpose +static void +startup() +{ + tet_infoline("[[ TET_MSG ]]:: ============ Startup ============ "); + + // Elm precondition + _elm_precondition(); + + // Test precondition + test_win = elm_win_add(NULL, "Multi Button Entry", ELM_WIN_BASIC); + elm_win_title_set(test_win, "Multi Button Entry"); + 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); + + tet_infoline("[[ TET_MSG ]]:: Completing startup"); +} + +// Clean up function for each test purpose +static void +cleanup() +{ + tet_infoline("[[ TET_MSG ]]:: ============ Cleanup ============ "); + + // Clean up the used resources. + if ( NULL != main_win ) { + evas_object_del(main_win); + main_win = NULL; + } + + if ( NULL != main_bg ) { + evas_object_del(main_bg); + main_bg = NULL; + } + + if ( NULL != test_win ) { + evas_object_del(test_win); + test_win = NULL; + } + + if ( NULL != test_bg ) { + evas_object_del(test_bg); + test_bg = NULL; + } + + if ( NULL != test_eo ) { + evas_object_del(test_eo); + test_eo = NULL; + } + + // clean up and shut down + elm_shutdown(); ; + + tet_infoline("[[ TET_MSG ]]:: ========= TC COMPLETE ========== "); +} + + +/** + * @brief Positive test case of elm_multibuttonentry_entry_get() + */ +static void utc_UIFW_elm_multibuttonentry_entry_get_func_01(void) +{ + Evas_Object *entry = NULL; + + test_eo = elm_multibuttonentry_add(test_win); + entry = elm_multibuttonentry_entry_get(test_eo); + TET_CHECK_PASS(NULL, entry); + + tet_result(TET_PASS); + tet_infoline("[[ TET_MSG ]]::[ID]:TC_01, [TYPE]: Positive, [RESULT]:PASS, elm_multibuttonentry_entry_get()."); +} + + +/** + * @brief Negative test case of ug_init elm_multibuttonentry_entry_get() + */ +static void utc_UIFW_elm_multibuttonentry_entry_get_func_02(void) +{ + Evas_Object *entry = NULL; + + test_eo = elm_multibuttonentry_add(test_win); + entry = elm_multibuttonentry_entry_get(NULL); + TET_CHECK_FAIL(NULL, entry); + + tet_result(TET_PASS); + tet_infoline("[[ TET_MSG ]]::[ID]:TC_02, [TYPE]: Negative, [RESULT]:PASS, elm_multibuttonentry_entry_get()."); +} + diff --git a/TC/elm_ts/multibuttonentry/utc_UIFW_elm_multibuttonentry_item_add_after_func.c b/TC/elm_ts/multibuttonentry/utc_UIFW_elm_multibuttonentry_item_add_after_func.c new file mode 100755 index 0000000..aa04ec9 --- /dev/null +++ b/TC/elm_ts/multibuttonentry/utc_UIFW_elm_multibuttonentry_item_add_after_func.c @@ -0,0 +1,191 @@ +#include +#include + +// Definitions +// For checking the result of the positive test case. +#define TET_CHECK_PASS(x1, y...) \ +{ \ + Elm_Multibuttonentry_Item *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...) \ +{ \ + Elm_Multibuttonentry_Item *err = y; \ + if (err != (x1)) \ + { \ + tet_printf("[TET_CHECK_FAIL]:: %s[%d] : Test has failed..", __FILE__,__LINE__); \ + tet_result(TET_FAIL); \ + return; \ + } \ +} + + +Evas_Object *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_multibuttonentry_item_add_after_func_01(void); +static void utc_UIFW_elm_multibuttonentry_item_add_after_func_02(void); + +enum { + POSITIVE_TC_IDX = 0x01, + NEGATIVE_TC_IDX, +}; + +struct tet_testlist tet_testlist[] = { + { utc_UIFW_elm_multibuttonentry_item_add_after_func_01, POSITIVE_TC_IDX }, + { utc_UIFW_elm_multibuttonentry_item_add_after_func_02, NEGATIVE_TC_IDX }, + { NULL, 0 } +}; + +// Declare the global variables +Evas_Object *main_win, *main_bg; +Evas_Object *test_win, *test_bg; +Evas_Object *test_eo = NULL; +// Declare internal functions +void _elm_precondition(void); +static void _win_del(void *data, Evas_Object *obj, void *event_info); + + +// Delete main window +static void _win_del(void *data, Evas_Object *obj, void *event_info) +{ + elm_exit(); +} + +// Do precondition. +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); + elm_win_resize_object_add(main_win, main_bg); + evas_object_show(main_bg); + + // set an initial window size + evas_object_resize(main_win, 320, 480); + // show the window + evas_object_show(main_win); + + //elm_run(); +} + +// Start up function for each test purpose +static void +startup() +{ + tet_infoline("[[ TET_MSG ]]:: ============ Startup ============ "); + + // Elm precondition + _elm_precondition(); + + // Test precondition + test_win = elm_win_add(NULL, "Multi Button Entry", ELM_WIN_BASIC); + elm_win_title_set(test_win, "Multi Button Entry"); + 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); + + tet_infoline("[[ TET_MSG ]]:: Completing startup"); +} + +// Clean up function for each test purpose +static void +cleanup() +{ + tet_infoline("[[ TET_MSG ]]:: ============ Cleanup ============ "); + + // Clean up the used resources. + if ( NULL != main_win ) { + evas_object_del(main_win); + main_win = NULL; + } + + if ( NULL != main_bg ) { + evas_object_del(main_bg); + main_bg = NULL; + } + + if ( NULL != test_win ) { + evas_object_del(test_win); + test_win = NULL; + } + + if ( NULL != test_bg ) { + evas_object_del(test_bg); + test_bg = NULL; + } + + if ( NULL != test_eo ) { + evas_object_del(test_eo); + test_eo = NULL; + } + + // clean up and shut down + elm_shutdown(); ; + + tet_infoline("[[ TET_MSG ]]:: ========= TC COMPLETE ========== "); +} + + +/** + * @brief Positive test case of elm_multibuttonentry_item_add_after() + */ +static void utc_UIFW_elm_multibuttonentry_item_add_after_func_01(void) +{ + Elm_Multibuttonentry_Item *added_item1 = NULL, *added_item2 = NULL, *after_item = NULL; + + test_eo = elm_multibuttonentry_add(test_win); + added_item1 = elm_multibuttonentry_item_add_start(test_eo, "item1", NULL); + added_item2 = elm_multibuttonentry_item_add_after(test_eo, "item2", added_item1, NULL); + TET_CHECK_PASS(NULL, added_item2); + + after_item = elm_multibuttonentry_item_next(added_item1); + if (added_item2 != after_item) { + tet_infoline("elm_multibuttonentry_item_add_after() failed in positive test case"); + tet_result(TET_FAIL); + return; + } + + tet_result(TET_PASS); + tet_infoline("[[ TET_MSG ]]::[ID]:TC_01, [TYPE]: Positive, [RESULT]:PASS, elm_multibuttonentry_item_add_after()."); +} + + +/** + * @brief Negative test case of ug_init elm_multibuttonentry_item_add_after() + */ +static void utc_UIFW_elm_multibuttonentry_item_add_after_func_02(void) +{ + Elm_Multibuttonentry_Item *added_item1 = NULL, *added_item2 = NULL; + + test_eo = elm_multibuttonentry_add(NULL); + added_item1 = elm_multibuttonentry_item_add_start(test_eo, "item1", NULL); + added_item2 = elm_multibuttonentry_item_add_after(test_eo, NULL, added_item1, NULL); + TET_CHECK_FAIL(NULL, added_item2); + + tet_result(TET_PASS); + tet_infoline("[[ TET_MSG ]]::[ID]:TC_02, [TYPE]: Negative, [RESULT]:PASS, elm_multibuttonentry_item_add_after()."); +} + diff --git a/TC/elm_ts/multibuttonentry/utc_UIFW_elm_multibuttonentry_item_add_before_func.c b/TC/elm_ts/multibuttonentry/utc_UIFW_elm_multibuttonentry_item_add_before_func.c new file mode 100755 index 0000000..f2fe017 --- /dev/null +++ b/TC/elm_ts/multibuttonentry/utc_UIFW_elm_multibuttonentry_item_add_before_func.c @@ -0,0 +1,191 @@ +#include +#include + +// Definitions +// For checking the result of the positive test case. +#define TET_CHECK_PASS(x1, y...) \ +{ \ + Elm_Multibuttonentry_Item *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...) \ +{ \ + Elm_Multibuttonentry_Item *err = y; \ + if (err != (x1)) \ + { \ + tet_printf("[TET_CHECK_FAIL]:: %s[%d] : Test has failed..", __FILE__,__LINE__); \ + tet_result(TET_FAIL); \ + return; \ + } \ +} + + +Evas_Object *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_multibuttonentry_item_add_before_func_01(void); +static void utc_UIFW_elm_multibuttonentry_item_add_before_func_02(void); + +enum { + POSITIVE_TC_IDX = 0x01, + NEGATIVE_TC_IDX, +}; + +struct tet_testlist tet_testlist[] = { + { utc_UIFW_elm_multibuttonentry_item_add_before_func_01, POSITIVE_TC_IDX }, + { utc_UIFW_elm_multibuttonentry_item_add_before_func_02, NEGATIVE_TC_IDX }, + { NULL, 0 } +}; + +// Declare the global variables +Evas_Object *main_win, *main_bg; +Evas_Object *test_win, *test_bg; +Evas_Object *test_eo = NULL; +// Declare internal functions +void _elm_precondition(void); +static void _win_del(void *data, Evas_Object *obj, void *event_info); + + +// Delete main window +static void _win_del(void *data, Evas_Object *obj, void *event_info) +{ + elm_exit(); +} + +// Do precondition. +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); + elm_win_resize_object_add(main_win, main_bg); + evas_object_show(main_bg); + + // set an initial window size + evas_object_resize(main_win, 320, 480); + // show the window + evas_object_show(main_win); + + //elm_run(); +} + +// Start up function for each test purpose +static void +startup() +{ + tet_infoline("[[ TET_MSG ]]:: ============ Startup ============ "); + + // Elm precondition + _elm_precondition(); + + // Test precondition + test_win = elm_win_add(NULL, "Multi Button Entry", ELM_WIN_BASIC); + elm_win_title_set(test_win, "Multi Button Entry"); + 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); + + tet_infoline("[[ TET_MSG ]]:: Completing startup"); +} + +// Clean up function for each test purpose +static void +cleanup() +{ + tet_infoline("[[ TET_MSG ]]:: ============ Cleanup ============ "); + + // Clean up the used resources. + if ( NULL != main_win ) { + evas_object_del(main_win); + main_win = NULL; + } + + if ( NULL != main_bg ) { + evas_object_del(main_bg); + main_bg = NULL; + } + + if ( NULL != test_win ) { + evas_object_del(test_win); + test_win = NULL; + } + + if ( NULL != test_bg ) { + evas_object_del(test_bg); + test_bg = NULL; + } + + if ( NULL != test_eo ) { + evas_object_del(test_eo); + test_eo = NULL; + } + + // clean up and shut down + elm_shutdown(); ; + + tet_infoline("[[ TET_MSG ]]:: ========= TC COMPLETE ========== "); +} + + +/** + * @brief Positive test case of elm_multibuttonentry_item_add_before() + */ +static void utc_UIFW_elm_multibuttonentry_item_add_before_func_01(void) +{ + Elm_Multibuttonentry_Item *added_item1 = NULL, *added_item2 = NULL, *before_item = NULL; + + test_eo = elm_multibuttonentry_add(test_win); + added_item1 = elm_multibuttonentry_item_add_start(test_eo, "item1", NULL); + added_item2 = elm_multibuttonentry_item_add_before(test_eo, "item2", added_item1, NULL); + TET_CHECK_PASS(NULL, added_item2); + + before_item = elm_multibuttonentry_item_prev(added_item1); + if (added_item2 != before_item) { + tet_infoline("elm_multibuttonentry_item_add_before() failed in positive test case"); + tet_result(TET_FAIL); + return; + } + + tet_result(TET_PASS); + tet_infoline("[[ TET_MSG ]]::[ID]:TC_01, [TYPE]: Positive, [RESULT]:PASS, elm_multibuttonentry_item_add_before()."); +} + + +/** + * @brief Negative test case of ug_init elm_multibuttonentry_item_add_before() + */ +static void utc_UIFW_elm_multibuttonentry_item_add_before_func_02(void) +{ + Elm_Multibuttonentry_Item *added_item1 = NULL, *added_item2 = NULL; + + test_eo = elm_multibuttonentry_add(NULL); + added_item1 = elm_multibuttonentry_item_add_start(test_eo, "item1", NULL); + added_item2 = elm_multibuttonentry_item_add_before(test_eo, NULL, added_item1, NULL); + TET_CHECK_FAIL(NULL, added_item2); + + tet_result(TET_PASS); + tet_infoline("[[ TET_MSG ]]::[ID]:TC_02, [TYPE]: Negative, [RESULT]:PASS, elm_multibuttonentry_item_add_before()."); +} + diff --git a/TC/elm_ts/multibuttonentry/utc_UIFW_elm_multibuttonentry_item_add_end_func.c b/TC/elm_ts/multibuttonentry/utc_UIFW_elm_multibuttonentry_item_add_end_func.c new file mode 100755 index 0000000..81491df --- /dev/null +++ b/TC/elm_ts/multibuttonentry/utc_UIFW_elm_multibuttonentry_item_add_end_func.c @@ -0,0 +1,192 @@ +#include +#include + +// Definitions +// For checking the result of the positive test case. +#define TET_CHECK_PASS(x1, y...) \ +{ \ + Elm_Multibuttonentry_Item *err = y; \ + Elm_Multibuttonentry_Item *val = x1; \ + if (err == val) \ + { \ + 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...) \ +{ \ + Elm_Multibuttonentry_Item *err = y; \ + Elm_Multibuttonentry_Item *val = x1; \ + if (err != val) \ + { \ + tet_printf("[TET_CHECK_FAIL]:: %s[%d] : Test has failed..", __FILE__,__LINE__); \ + tet_result(TET_FAIL); \ + return; \ + } \ +} + + +Evas_Object *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_multibuttonentry_item_add_end_func_01(void); +static void utc_UIFW_elm_multibuttonentry_item_add_end_func_02(void); + +enum { + POSITIVE_TC_IDX = 0x01, + NEGATIVE_TC_IDX, +}; + +struct tet_testlist tet_testlist[] = { + { utc_UIFW_elm_multibuttonentry_item_add_end_func_01, POSITIVE_TC_IDX }, + { utc_UIFW_elm_multibuttonentry_item_add_end_func_02, NEGATIVE_TC_IDX }, + { NULL, 0 } +}; + +// Declare the global variables +Evas_Object *main_win, *main_bg; +Evas_Object *test_win, *test_bg; +Evas_Object *test_eo = NULL; +// Declare internal functions +void _elm_precondition(void); +static void _win_del(void *data, Evas_Object *obj, void *event_info); + + +// Delete main window +static void _win_del(void *data, Evas_Object *obj, void *event_info) +{ + elm_exit(); +} + +// Do precondition. +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); + elm_win_resize_object_add(main_win, main_bg); + evas_object_show(main_bg); + + // set an initial window size + evas_object_resize(main_win, 320, 480); + // show the window + evas_object_show(main_win); + + //elm_run(); +} + +// Start up function for each test purpose +static void +startup() +{ + tet_infoline("[[ TET_MSG ]]:: ============ Startup ============ "); + + // Elm precondition + _elm_precondition(); + + // Test precondition + test_win = elm_win_add(NULL, "Multi Button Entry", ELM_WIN_BASIC); + elm_win_title_set(test_win, "Multi Button Entry"); + 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); + + tet_infoline("[[ TET_MSG ]]:: Completing startup"); +} + +// Clean up function for each test purpose +static void +cleanup() +{ + tet_infoline("[[ TET_MSG ]]:: ============ Cleanup ============ "); + + // Clean up the used resources. + if ( NULL != main_win ) { + evas_object_del(main_win); + main_win = NULL; + } + + if ( NULL != main_bg ) { + evas_object_del(main_bg); + main_bg = NULL; + } + + if ( NULL != test_win ) { + evas_object_del(test_win); + test_win = NULL; + } + + if ( NULL != test_bg ) { + evas_object_del(test_bg); + test_bg = NULL; + } + + if ( NULL != test_eo ) { + evas_object_del(test_eo); + test_eo = NULL; + } + + // clean up and shut down + elm_shutdown(); ; + + tet_infoline("[[ TET_MSG ]]:: ========= TC COMPLETE ========== "); +} + + +/** + * @brief Positive test case of elm_multibuttonentry_item_add_end() + */ +static void utc_UIFW_elm_multibuttonentry_item_add_end_func_01(void) +{ + Elm_Multibuttonentry_Item *added_item = NULL, *last_item = NULL; + + test_eo = elm_multibuttonentry_add(test_win); + added_item = elm_multibuttonentry_item_add_end(test_eo, "item1", NULL); + TET_CHECK_PASS(NULL, added_item); + + last_item = elm_multibuttonentry_item_last_get(test_eo); + if (added_item != last_item) { + tet_infoline("elm_multibuttonentry_item_add_end() failed in positive test case"); + tet_result(TET_FAIL); + return; + } + + tet_result(TET_PASS); + tet_infoline("[[ TET_MSG ]]::[ID]:TC_01, [TYPE]: Positive, [RESULT]:PASS, elm_multibuttonentry_item_add_end()."); +} + + +/** + * @brief Negative test case of ug_init elm_multibuttonentry_item_add_end() + */ +static void utc_UIFW_elm_multibuttonentry_item_add_end_func_02(void) +{ + + Elm_Multibuttonentry_Item *added_item = NULL; + + test_eo = elm_multibuttonentry_add(test_win); + added_item = elm_multibuttonentry_item_add_end(test_eo, NULL, NULL); + TET_CHECK_FAIL(NULL, added_item); + + tet_result(TET_PASS); + tet_infoline("[[ TET_MSG ]]::[ID]:TC_02, [TYPE]: Negative, [RESULT]:PASS, elm_multibuttonentry_item_add_end()."); +} + diff --git a/TC/elm_ts/multibuttonentry/utc_UIFW_elm_multibuttonentry_item_add_start_func.c b/TC/elm_ts/multibuttonentry/utc_UIFW_elm_multibuttonentry_item_add_start_func.c new file mode 100755 index 0000000..38bfe7b --- /dev/null +++ b/TC/elm_ts/multibuttonentry/utc_UIFW_elm_multibuttonentry_item_add_start_func.c @@ -0,0 +1,191 @@ +#include +#include + +// Definitions +// For checking the result of the positive test case. +#define TET_CHECK_PASS(x1, y...) \ +{ \ + Elm_Multibuttonentry_Item *err = y; \ + Elm_Multibuttonentry_Item *val = x1; \ + if (err == val) \ + { \ + 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...) \ +{ \ + Elm_Multibuttonentry_Item *err = y; \ + Elm_Multibuttonentry_Item *val = x1; \ + if (err != val) \ + { \ + tet_printf("[TET_CHECK_FAIL]:: %s[%d] : Test has failed..", __FILE__,__LINE__); \ + tet_result(TET_FAIL); \ + return; \ + } \ +} + + +Evas_Object *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_multibuttonentry_item_add_start_func_01(void); +static void utc_UIFW_elm_multibuttonentry_item_add_start_func_02(void); + +enum { + POSITIVE_TC_IDX = 0x01, + NEGATIVE_TC_IDX, +}; + +struct tet_testlist tet_testlist[] = { + { utc_UIFW_elm_multibuttonentry_item_add_start_func_01, POSITIVE_TC_IDX }, + { utc_UIFW_elm_multibuttonentry_item_add_start_func_02, NEGATIVE_TC_IDX }, + { NULL, 0 } +}; + +// Declare the global variables +Evas_Object *main_win, *main_bg; +Evas_Object *test_win, *test_bg; +Evas_Object *test_eo = NULL; +// Declare internal functions +void _elm_precondition(void); +static void _win_del(void *data, Evas_Object *obj, void *event_info); + + +// Delete main window +static void _win_del(void *data, Evas_Object *obj, void *event_info) +{ + elm_exit(); +} + +// Do precondition. +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); + elm_win_resize_object_add(main_win, main_bg); + evas_object_show(main_bg); + + // set an initial window size + evas_object_resize(main_win, 320, 480); + // show the window + evas_object_show(main_win); + + //elm_run(); +} + +// Start up function for each test purpose +static void +startup() +{ + tet_infoline("[[ TET_MSG ]]:: ============ Startup ============ "); + + // Elm precondition + _elm_precondition(); + + // Test precondition + test_win = elm_win_add(NULL, "Multi Button Entry", ELM_WIN_BASIC); + elm_win_title_set(test_win, "Multi Button Entry"); + 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); + + tet_infoline("[[ TET_MSG ]]:: Completing startup"); +} + +// Clean up function for each test purpose +static void +cleanup() +{ + tet_infoline("[[ TET_MSG ]]:: ============ Cleanup ============ "); + + // Clean up the used resources. + if ( NULL != main_win ) { + evas_object_del(main_win); + main_win = NULL; + } + + if ( NULL != main_bg ) { + evas_object_del(main_bg); + main_bg = NULL; + } + + if ( NULL != test_win ) { + evas_object_del(test_win); + test_win = NULL; + } + + if ( NULL != test_bg ) { + evas_object_del(test_bg); + test_bg = NULL; + } + + if ( NULL != test_eo ) { + evas_object_del(test_eo); + test_eo = NULL; + } + + // clean up and shut down + elm_shutdown(); ; + + tet_infoline("[[ TET_MSG ]]:: ========= TC COMPLETE ========== "); +} + + +/** + * @brief Positive test case of elm_multibuttonentry_item_add_start() + */ +static void utc_UIFW_elm_multibuttonentry_item_add_start_func_01(void) +{ + Elm_Multibuttonentry_Item *added_item = NULL, *first_item = NULL; + + test_eo = elm_multibuttonentry_add(test_win); + added_item = elm_multibuttonentry_item_add_start(test_eo, "item1", NULL); + TET_CHECK_PASS(NULL, added_item); + + first_item = elm_multibuttonentry_item_first_get(test_eo); + if (added_item != first_item) { + tet_infoline("elm_multibuttonentry_item_add_start() failed in positive test case"); + tet_result(TET_FAIL); + return; + } + + tet_result(TET_PASS); + tet_infoline("[[ TET_MSG ]]::[ID]:TC_01, [TYPE]: Positive, [RESULT]:PASS, elm_multibuttonentry_item_add_start()."); +} + + +/** + * @brief Negative test case of ug_init elm_multibuttonentry_item_add_start() + */ +static void utc_UIFW_elm_multibuttonentry_item_add_start_func_02(void) +{ + Elm_Multibuttonentry_Item *added_item = NULL; + + test_eo = elm_multibuttonentry_add(test_win); + added_item = elm_multibuttonentry_item_add_start(test_eo, NULL, NULL); + TET_CHECK_FAIL(NULL, added_item); + + tet_result(TET_PASS); + tet_infoline("[[ TET_MSG ]]::[ID]:TC_02, [TYPE]: Negative, [RESULT]:PASS, elm_multibuttonentry_item_add_start()."); +} + diff --git a/TC/elm_ts/multibuttonentry/utc_UIFW_elm_multibuttonentry_item_data_get_func.c b/TC/elm_ts/multibuttonentry/utc_UIFW_elm_multibuttonentry_item_data_get_func.c new file mode 100755 index 0000000..6fe1f02 --- /dev/null +++ b/TC/elm_ts/multibuttonentry/utc_UIFW_elm_multibuttonentry_item_data_get_func.c @@ -0,0 +1,176 @@ +#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; \ + } \ +} + + +Evas_Object *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_multibuttonentry_item_data_get_func_01(void); +static void utc_UIFW_elm_multibuttonentry_item_data_get_func_02(void); + +enum { + POSITIVE_TC_IDX = 0x01, + NEGATIVE_TC_IDX, +}; + +struct tet_testlist tet_testlist[] = { + { utc_UIFW_elm_multibuttonentry_item_data_get_func_01, POSITIVE_TC_IDX }, + { utc_UIFW_elm_multibuttonentry_item_data_get_func_02, NEGATIVE_TC_IDX }, + { NULL, 0 } +}; + +// Declare the global variables +Evas_Object *main_win, *main_bg; +Evas_Object *test_win, *test_bg; +Evas_Object *test_eo = NULL; +// Declare internal functions +void _elm_precondition(void); +static void _win_del(void *data, Evas_Object *obj, void *event_info); + + +// Delete main window +static void _win_del(void *data, Evas_Object *obj, void *event_info) +{ + elm_exit(); +} + +// Do precondition. +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); + elm_win_resize_object_add(main_win, main_bg); + evas_object_show(main_bg); + + // set an initial window size + evas_object_resize(main_win, 320, 480); + // show the window + evas_object_show(main_win); + + //elm_run(); +} + +// Start up function for each test purpose +static void +startup() +{ + tet_infoline("[[ TET_MSG ]]:: ============ Startup ============ "); + + // Elm precondition + _elm_precondition(); + + // Test precondition + test_win = elm_win_add(NULL, "Multi Button Entry", ELM_WIN_BASIC); + elm_win_title_set(test_win, "Multi Button Entry"); + 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); + + tet_infoline("[[ TET_MSG ]]:: Completing startup"); +} + +// Clean up function for each test purpose +static void +cleanup() +{ + tet_infoline("[[ TET_MSG ]]:: ============ Cleanup ============ "); + + // Clean up the used resources. + if ( NULL != main_win ) { + evas_object_del(main_win); + main_win = NULL; + } + + if ( NULL != main_bg ) { + evas_object_del(main_bg); + main_bg = NULL; + } + + if ( NULL != test_win ) { + evas_object_del(test_win); + test_win = NULL; + } + + if ( NULL != test_bg ) { + evas_object_del(test_bg); + test_bg = NULL; + } + + if ( NULL != test_eo ) { + evas_object_del(test_eo); + test_eo = NULL; + } + + // clean up and shut down + elm_shutdown(); ; + + tet_infoline("[[ TET_MSG ]]:: ========= TC COMPLETE ========== "); +} + + +/** + * @brief Positive test case of elm_multibuttonentry_item_data_get() + */ +static void utc_UIFW_elm_multibuttonentry_item_data_get_func_01(void) +{ + test_eo = elm_multibuttonentry_add(test_win); + TET_CHECK_PASS(NULL, test_eo); + + tet_result(TET_PASS); + tet_infoline("[[ TET_MSG ]]::[ID]:TC_01, [TYPE]: Positive, [RESULT]:PASS, An Multi Button Entry is added successfully."); +} + + +/** + * @brief Negative test case of ug_init elm_multibuttonentry_item_data_get() + */ +static void utc_UIFW_elm_multibuttonentry_item_data_get_func_02(void) +{ + test_eo = elm_multibuttonentry_add(NULL); + TET_CHECK_FAIL(NULL, test_eo); + + tet_result(TET_PASS); + tet_infoline("[[ TET_MSG ]]::[ID]:TC_02, [TYPE]: Negative, [RESULT]:PASS, Adding an Multi Button Entry has failed."); +} + diff --git a/TC/elm_ts/multibuttonentry/utc_UIFW_elm_multibuttonentry_item_del_func.c b/TC/elm_ts/multibuttonentry/utc_UIFW_elm_multibuttonentry_item_del_func.c new file mode 100755 index 0000000..ec58d35 --- /dev/null +++ b/TC/elm_ts/multibuttonentry/utc_UIFW_elm_multibuttonentry_item_del_func.c @@ -0,0 +1,196 @@ +#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; \ + } \ +} + + +Evas_Object *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_multibuttonentry_item_del_func_01(void); +static void utc_UIFW_elm_multibuttonentry_item_del_func_02(void); + +enum { + POSITIVE_TC_IDX = 0x01, + NEGATIVE_TC_IDX, +}; + +struct tet_testlist tet_testlist[] = { + { utc_UIFW_elm_multibuttonentry_item_del_func_01, POSITIVE_TC_IDX }, + { utc_UIFW_elm_multibuttonentry_item_del_func_02, NEGATIVE_TC_IDX }, + { NULL, 0 } +}; + +// Declare the global variables +Evas_Object *main_win, *main_bg; +Evas_Object *test_win, *test_bg; +Evas_Object *test_eo = NULL; +// Declare internal functions +void _elm_precondition(void); +static void _win_del(void *data, Evas_Object *obj, void *event_info); + + +// Delete main window +static void _win_del(void *data, Evas_Object *obj, void *event_info) +{ + elm_exit(); +} + +// Do precondition. +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); + elm_win_resize_object_add(main_win, main_bg); + evas_object_show(main_bg); + + // set an initial window size + evas_object_resize(main_win, 320, 480); + // show the window + evas_object_show(main_win); + + //elm_run(); +} + +// Start up function for each test purpose +static void +startup() +{ + tet_infoline("[[ TET_MSG ]]:: ============ Startup ============ "); + + // Elm precondition + _elm_precondition(); + + // Test precondition + test_win = elm_win_add(NULL, "Multi Button Entry", ELM_WIN_BASIC); + elm_win_title_set(test_win, "Multi Button Entry"); + 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); + + tet_infoline("[[ TET_MSG ]]:: Completing startup"); +} + +// Clean up function for each test purpose +static void +cleanup() +{ + tet_infoline("[[ TET_MSG ]]:: ============ Cleanup ============ "); + + // Clean up the used resources. + if ( NULL != main_win ) { + evas_object_del(main_win); + main_win = NULL; + } + + if ( NULL != main_bg ) { + evas_object_del(main_bg); + main_bg = NULL; + } + + if ( NULL != test_win ) { + evas_object_del(test_win); + test_win = NULL; + } + + if ( NULL != test_bg ) { + evas_object_del(test_bg); + test_bg = NULL; + } + + if ( NULL != test_eo ) { + evas_object_del(test_eo); + test_eo = NULL; + } + + // clean up and shut down + elm_shutdown(); ; + + tet_infoline("[[ TET_MSG ]]:: ========= TC COMPLETE ========== "); +} + + +/** + * @brief Positive test case of elm_multibuttonentry_item_del() + */ +static void utc_UIFW_elm_multibuttonentry_item_del_func_01(void) +{ + Elm_Multibuttonentry_Item *added_item1 = NULL, *added_item2 = NULL, *first_item = NULL; + + test_eo = elm_multibuttonentry_add(test_win); + added_item1 = elm_multibuttonentry_item_add_end(test_eo, "item1", NULL); + added_item2 = elm_multibuttonentry_item_add_end(test_eo, "item2", NULL); + elm_multibuttonentry_item_del(added_item1); + first_item = elm_multibuttonentry_item_first_get(test_eo); + if (first_item != added_item2) { + tet_infoline("elm_multibuttonentry_item_del() failed in positive test case"); + tet_result(TET_FAIL); + return; + } + + tet_result(TET_PASS); + tet_infoline("[[ TET_MSG ]]::[ID]:TC_01, [TYPE]: Positive, [RESULT]:PASS, elm_multibuttonentry_item_del()."); +} + + +/** + * @brief Negative test case of ug_init elm_multibuttonentry_item_del() + */ +static void utc_UIFW_elm_multibuttonentry_item_del_func_02(void) +{ + Elm_Multibuttonentry_Item *added_item1 = NULL; + const Eina_List *items = NULL; + + test_eo = elm_multibuttonentry_add(test_win); + added_item1 = elm_multibuttonentry_item_add_end(test_eo, "item1", NULL); + elm_multibuttonentry_item_del(NULL); + items = elm_multibuttonentry_items_get(test_eo); + if (!items) { + tet_infoline("elm_multibuttonentry_item_del() failed in negative test case"); + tet_result(TET_FAIL); + return; + } + + tet_result(TET_PASS); + tet_infoline("[[ TET_MSG ]]::[ID]:TC_02, [TYPE]: Negative, [RESULT]:PASS, elm_multibuttonentry_item_del()."); +} + diff --git a/TC/elm_ts/multibuttonentry/utc_UIFW_elm_multibuttonentry_item_first_get_func.c b/TC/elm_ts/multibuttonentry/utc_UIFW_elm_multibuttonentry_item_first_get_func.c new file mode 100755 index 0000000..d021860 --- /dev/null +++ b/TC/elm_ts/multibuttonentry/utc_UIFW_elm_multibuttonentry_item_first_get_func.c @@ -0,0 +1,192 @@ +#include +#include + +// Definitions +// For checking the result of the positive test case. +#define TET_CHECK_PASS(x1, y...) \ +{ \ + Elm_Multibuttonentry_Item *err = y; \ + Elm_Multibuttonentry_Item *val = x1; \ + if (err == val) \ + { \ + 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...) \ +{ \ + Elm_Multibuttonentry_Item *err = y; \ + Elm_Multibuttonentry_Item *val = x1; \ + if (err != val) \ + { \ + tet_printf("[TET_CHECK_FAIL]:: %s[%d] : Test has failed..", __FILE__,__LINE__); \ + tet_result(TET_FAIL); \ + return; \ + } \ +} + + +Evas_Object *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_multibuttonentry_item_first_get_func_01(void); +static void utc_UIFW_elm_multibuttonentry_item_first_get_func_02(void); + +enum { + POSITIVE_TC_IDX = 0x01, + NEGATIVE_TC_IDX, +}; + +struct tet_testlist tet_testlist[] = { + { utc_UIFW_elm_multibuttonentry_item_first_get_func_01, POSITIVE_TC_IDX }, + { utc_UIFW_elm_multibuttonentry_item_first_get_func_02, NEGATIVE_TC_IDX }, + { NULL, 0 } +}; + +// Declare the global variables +Evas_Object *main_win, *main_bg; +Evas_Object *test_win, *test_bg; +Evas_Object *test_eo = NULL; +// Declare internal functions +void _elm_precondition(void); +static void _win_del(void *data, Evas_Object *obj, void *event_info); + + +// Delete main window +static void _win_del(void *data, Evas_Object *obj, void *event_info) +{ + elm_exit(); +} + +// Do precondition. +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); + elm_win_resize_object_add(main_win, main_bg); + evas_object_show(main_bg); + + // set an initial window size + evas_object_resize(main_win, 320, 480); + // show the window + evas_object_show(main_win); + + //elm_run(); +} + +// Start up function for each test purpose +static void +startup() +{ + tet_infoline("[[ TET_MSG ]]:: ============ Startup ============ "); + + // Elm precondition + _elm_precondition(); + + // Test precondition + test_win = elm_win_add(NULL, "Multi Button Entry", ELM_WIN_BASIC); + elm_win_title_set(test_win, "Multi Button Entry"); + 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); + + tet_infoline("[[ TET_MSG ]]:: Completing startup"); +} + +// Clean up function for each test purpose +static void +cleanup() +{ + tet_infoline("[[ TET_MSG ]]:: ============ Cleanup ============ "); + + // Clean up the used resources. + if ( NULL != main_win ) { + evas_object_del(main_win); + main_win = NULL; + } + + if ( NULL != main_bg ) { + evas_object_del(main_bg); + main_bg = NULL; + } + + if ( NULL != test_win ) { + evas_object_del(test_win); + test_win = NULL; + } + + if ( NULL != test_bg ) { + evas_object_del(test_bg); + test_bg = NULL; + } + + if ( NULL != test_eo ) { + evas_object_del(test_eo); + test_eo = NULL; + } + + // clean up and shut down + elm_shutdown(); ; + + tet_infoline("[[ TET_MSG ]]:: ========= TC COMPLETE ========== "); +} + + +/** + * @brief Positive test case of elm_multibuttonentry_item_first_get() + */ +static void utc_UIFW_elm_multibuttonentry_item_first_get_func_01(void) +{ + Elm_Multibuttonentry_Item *added_item1 = NULL, *added_item2 = NULL, *first_item = NULL; + + test_eo = elm_multibuttonentry_add(test_win); + added_item1 = elm_multibuttonentry_item_add_end(test_eo, "item1", NULL); + added_item2 = elm_multibuttonentry_item_add_end(test_eo, "item2", NULL); + first_item = elm_multibuttonentry_item_first_get(test_eo); + if (first_item != added_item1) { + tet_infoline("elm_multibuttonentry_item_first_get() failed in positive test case"); + tet_result(TET_FAIL); + return; + } + + tet_result(TET_PASS); + tet_infoline("[[ TET_MSG ]]::[ID]:TC_01, [TYPE]: Positive, [RESULT]:PASS, elm_multibuttonentry_item_first_get()."); +} + + +/** + * @brief Negative test case of ug_init elm_multibuttonentry_item_first_get() + */ +static void utc_UIFW_elm_multibuttonentry_item_first_get_func_02(void) +{ + Elm_Multibuttonentry_Item *added_item1 = NULL, *added_item2 = NULL, *first_item = NULL; + + test_eo = elm_multibuttonentry_add(test_win); + added_item1 = elm_multibuttonentry_item_add_end(test_eo, "item1", NULL); + added_item2 = elm_multibuttonentry_item_add_end(test_eo, "item2", NULL); + first_item = elm_multibuttonentry_item_first_get(test_win); + TET_CHECK_FAIL(NULL, first_item); + + tet_result(TET_PASS); + tet_infoline("[[ TET_MSG ]]::[ID]:TC_02, [TYPE]: Negative, [RESULT]:PASS, elm_multibuttonentry_item_first_get()."); +} + diff --git a/TC/elm_ts/multibuttonentry/utc_UIFW_elm_multibuttonentry_item_label_get_func.c b/TC/elm_ts/multibuttonentry/utc_UIFW_elm_multibuttonentry_item_label_get_func.c new file mode 100755 index 0000000..275ad10 --- /dev/null +++ b/TC/elm_ts/multibuttonentry/utc_UIFW_elm_multibuttonentry_item_label_get_func.c @@ -0,0 +1,184 @@ +#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; \ + } \ +} + + +Evas_Object *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_multibuttonentry_item_label_get_func_01(void); +static void utc_UIFW_elm_multibuttonentry_item_label_get_func_02(void); + +enum { + POSITIVE_TC_IDX = 0x01, + NEGATIVE_TC_IDX, +}; + +struct tet_testlist tet_testlist[] = { + { utc_UIFW_elm_multibuttonentry_item_label_get_func_01, POSITIVE_TC_IDX }, + { utc_UIFW_elm_multibuttonentry_item_label_get_func_02, NEGATIVE_TC_IDX }, + { NULL, 0 } +}; + +// Declare the global variables +Evas_Object *main_win, *main_bg; +Evas_Object *test_win, *test_bg; +Evas_Object *test_eo = NULL; +// Declare internal functions +void _elm_precondition(void); +static void _win_del(void *data, Evas_Object *obj, void *event_info); + + +// Delete main window +static void _win_del(void *data, Evas_Object *obj, void *event_info) +{ + elm_exit(); +} + +// Do precondition. +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); + elm_win_resize_object_add(main_win, main_bg); + evas_object_show(main_bg); + + // set an initial window size + evas_object_resize(main_win, 320, 480); + // show the window + evas_object_show(main_win); + + //elm_run(); +} + +// Start up function for each test purpose +static void +startup() +{ + tet_infoline("[[ TET_MSG ]]:: ============ Startup ============ "); + + // Elm precondition + _elm_precondition(); + + // Test precondition + test_win = elm_win_add(NULL, "Multi Button Entry", ELM_WIN_BASIC); + elm_win_title_set(test_win, "Multi Button Entry"); + 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); + + tet_infoline("[[ TET_MSG ]]:: Completing startup"); +} + +// Clean up function for each test purpose +static void +cleanup() +{ + tet_infoline("[[ TET_MSG ]]:: ============ Cleanup ============ "); + + // Clean up the used resources. + if ( NULL != main_win ) { + evas_object_del(main_win); + main_win = NULL; + } + + if ( NULL != main_bg ) { + evas_object_del(main_bg); + main_bg = NULL; + } + + if ( NULL != test_win ) { + evas_object_del(test_win); + test_win = NULL; + } + + if ( NULL != test_bg ) { + evas_object_del(test_bg); + test_bg = NULL; + } + + if ( NULL != test_eo ) { + evas_object_del(test_eo); + test_eo = NULL; + } + + // clean up and shut down + elm_shutdown(); ; + + tet_infoline("[[ TET_MSG ]]:: ========= TC COMPLETE ========== "); +} + + +/** + * @brief Positive test case of elm_multibuttonentry_item_label_get() + */ +static void utc_UIFW_elm_multibuttonentry_item_label_get_func_01(void) +{ + char *ret_str = NULL; + + test_eo = elm_multibuttonentry_add(test_win); + elm_multibuttonentry_label_set(test_eo, "test"); + ret_str = elm_multibuttonentry_label_get(test_eo); + TET_CHECK_PASS(NULL, ret_str); + + tet_result(TET_PASS); + tet_infoline("[[ TET_MSG ]]::[ID]:TC_01, [TYPE]: Positive, [RESULT]:PASS, An Multi Button Entry is added successfully."); +} + + +/** + * @brief Negative test case of ug_init elm_multibuttonentry_item_label_get() + */ +static void utc_UIFW_elm_multibuttonentry_item_label_get_func_02(void) +{ + char *ret_str = NULL; + + test_eo = elm_multibuttonentry_add(test_win); + elm_multibuttonentry_label_set(test_eo, NULL); + ret_str = elm_multibuttonentry_label_get(test_eo); + TET_CHECK_FAIL(NULL, ret_str); + + tet_result(TET_PASS); + tet_infoline("[[ TET_MSG ]]::[ID]:TC_02, [TYPE]: Negative, [RESULT]:PASS, Adding an Multi Button Entry has failed."); +} + diff --git a/TC/elm_ts/multibuttonentry/utc_UIFW_elm_multibuttonentry_item_last_get_func.c b/TC/elm_ts/multibuttonentry/utc_UIFW_elm_multibuttonentry_item_last_get_func.c new file mode 100755 index 0000000..0241e05 --- /dev/null +++ b/TC/elm_ts/multibuttonentry/utc_UIFW_elm_multibuttonentry_item_last_get_func.c @@ -0,0 +1,192 @@ +#include +#include + +// Definitions +// For checking the result of the positive test case. +#define TET_CHECK_PASS(x1, y...) \ +{ \ + Elm_Multibuttonentry_Item *err = y; \ + Elm_Multibuttonentry_Item *val = x1; \ + if (err == val) \ + { \ + 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...) \ +{ \ + Elm_Multibuttonentry_Item *err = y; \ + Elm_Multibuttonentry_Item *val = x1; \ + if (err != val) \ + { \ + tet_printf("[TET_CHECK_FAIL]:: %s[%d] : Test has failed..", __FILE__,__LINE__); \ + tet_result(TET_FAIL); \ + return; \ + } \ +} + + +Evas_Object *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_multibuttonentry_item_last_get_func_01(void); +static void utc_UIFW_elm_multibuttonentry_item_last_get_func_02(void); + +enum { + POSITIVE_TC_IDX = 0x01, + NEGATIVE_TC_IDX, +}; + +struct tet_testlist tet_testlist[] = { + { utc_UIFW_elm_multibuttonentry_item_last_get_func_01, POSITIVE_TC_IDX }, + { utc_UIFW_elm_multibuttonentry_item_last_get_func_02, NEGATIVE_TC_IDX }, + { NULL, 0 } +}; + +// Declare the global variables +Evas_Object *main_win, *main_bg; +Evas_Object *test_win, *test_bg; +Evas_Object *test_eo = NULL; +// Declare internal functions +void _elm_precondition(void); +static void _win_del(void *data, Evas_Object *obj, void *event_info); + + +// Delete main window +static void _win_del(void *data, Evas_Object *obj, void *event_info) +{ + elm_exit(); +} + +// Do precondition. +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); + elm_win_resize_object_add(main_win, main_bg); + evas_object_show(main_bg); + + // set an initial window size + evas_object_resize(main_win, 320, 480); + // show the window + evas_object_show(main_win); + + //elm_run(); +} + +// Start up function for each test purpose +static void +startup() +{ + tet_infoline("[[ TET_MSG ]]:: ============ Startup ============ "); + + // Elm precondition + _elm_precondition(); + + // Test precondition + test_win = elm_win_add(NULL, "Multi Button Entry", ELM_WIN_BASIC); + elm_win_title_set(test_win, "Multi Button Entry"); + 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); + + tet_infoline("[[ TET_MSG ]]:: Completing startup"); +} + +// Clean up function for each test purpose +static void +cleanup() +{ + tet_infoline("[[ TET_MSG ]]:: ============ Cleanup ============ "); + + // Clean up the used resources. + if ( NULL != main_win ) { + evas_object_del(main_win); + main_win = NULL; + } + + if ( NULL != main_bg ) { + evas_object_del(main_bg); + main_bg = NULL; + } + + if ( NULL != test_win ) { + evas_object_del(test_win); + test_win = NULL; + } + + if ( NULL != test_bg ) { + evas_object_del(test_bg); + test_bg = NULL; + } + + if ( NULL != test_eo ) { + evas_object_del(test_eo); + test_eo = NULL; + } + + // clean up and shut down + elm_shutdown(); ; + + tet_infoline("[[ TET_MSG ]]:: ========= TC COMPLETE ========== "); +} + + +/** + * @brief Positive test case of elm_multibuttonentry_item_last_get() + */ +static void utc_UIFW_elm_multibuttonentry_item_last_get_func_01(void) +{ + Elm_Multibuttonentry_Item *added_item1 = NULL, *added_item2 = NULL, *last_item = NULL; + + test_eo = elm_multibuttonentry_add(test_win); + added_item1 = elm_multibuttonentry_item_add_end(test_eo, "item1", NULL); + added_item2 = elm_multibuttonentry_item_add_end(test_eo, "item2", NULL); + last_item = elm_multibuttonentry_item_last_get(test_eo); + if (last_item != added_item2) { + tet_infoline("elm_multibuttonentry_item_last_get() failed in positive test case"); + tet_result(TET_FAIL); + return; + } + + tet_result(TET_PASS); + tet_infoline("[[ TET_MSG ]]::[ID]:TC_01, [TYPE]: Positive, [RESULT]:PASS, elm_multibuttonentry_item_last_get()."); +} + + +/** + * @brief Negative test case of ug_init elm_multibuttonentry_item_last_get() + */ +static void utc_UIFW_elm_multibuttonentry_item_last_get_func_02(void) +{ + Elm_Multibuttonentry_Item *added_item1 = NULL, *added_item2 = NULL, *last_item = NULL; + + test_eo = elm_multibuttonentry_add(test_win); + added_item1 = elm_multibuttonentry_item_add_end(test_eo, "item1", NULL); + added_item2 = elm_multibuttonentry_item_add_end(test_eo, "item2", NULL); + last_item = elm_multibuttonentry_item_last_get(test_win); + TET_CHECK_FAIL(NULL, last_item); + + tet_result(TET_PASS); + tet_infoline("[[ TET_MSG ]]::[ID]:TC_02, [TYPE]: Negative, [RESULT]:PASS, elm_multibuttonentry_item_last_get()."); +} + diff --git a/TC/elm_ts/multibuttonentry/utc_UIFW_elm_multibuttonentry_item_next_func.c b/TC/elm_ts/multibuttonentry/utc_UIFW_elm_multibuttonentry_item_next_func.c new file mode 100755 index 0000000..d970066 --- /dev/null +++ b/TC/elm_ts/multibuttonentry/utc_UIFW_elm_multibuttonentry_item_next_func.c @@ -0,0 +1,176 @@ +#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; \ + } \ +} + + +Evas_Object *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_multibuttonentry_item_next_func_01(void); +static void utc_UIFW_elm_multibuttonentry_item_next_func_02(void); + +enum { + POSITIVE_TC_IDX = 0x01, + NEGATIVE_TC_IDX, +}; + +struct tet_testlist tet_testlist[] = { + { utc_UIFW_elm_multibuttonentry_item_next_func_01, POSITIVE_TC_IDX }, + { utc_UIFW_elm_multibuttonentry_item_next_func_02, NEGATIVE_TC_IDX }, + { NULL, 0 } +}; + +// Declare the global variables +Evas_Object *main_win, *main_bg; +Evas_Object *test_win, *test_bg; +Evas_Object *test_eo = NULL; +// Declare internal functions +void _elm_precondition(void); +static void _win_del(void *data, Evas_Object *obj, void *event_info); + + +// Delete main window +static void _win_del(void *data, Evas_Object *obj, void *event_info) +{ + elm_exit(); +} + +// Do precondition. +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); + elm_win_resize_object_add(main_win, main_bg); + evas_object_show(main_bg); + + // set an initial window size + evas_object_resize(main_win, 320, 480); + // show the window + evas_object_show(main_win); + + //elm_run(); +} + +// Start up function for each test purpose +static void +startup() +{ + tet_infoline("[[ TET_MSG ]]:: ============ Startup ============ "); + + // Elm precondition + _elm_precondition(); + + // Test precondition + test_win = elm_win_add(NULL, "Multi Button Entry", ELM_WIN_BASIC); + elm_win_title_set(test_win, "Multi Button Entry"); + 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); + + tet_infoline("[[ TET_MSG ]]:: Completing startup"); +} + +// Clean up function for each test purpose +static void +cleanup() +{ + tet_infoline("[[ TET_MSG ]]:: ============ Cleanup ============ "); + + // Clean up the used resources. + if ( NULL != main_win ) { + evas_object_del(main_win); + main_win = NULL; + } + + if ( NULL != main_bg ) { + evas_object_del(main_bg); + main_bg = NULL; + } + + if ( NULL != test_win ) { + evas_object_del(test_win); + test_win = NULL; + } + + if ( NULL != test_bg ) { + evas_object_del(test_bg); + test_bg = NULL; + } + + if ( NULL != test_eo ) { + evas_object_del(test_eo); + test_eo = NULL; + } + + // clean up and shut down + elm_shutdown(); ; + + tet_infoline("[[ TET_MSG ]]:: ========= TC COMPLETE ========== "); +} + + +/** + * @brief Positive test case of elm_multibuttonentry_item_next() + */ +static void utc_UIFW_elm_multibuttonentry_item_next_func_01(void) +{ + test_eo = elm_multibuttonentry_add(test_win); + TET_CHECK_PASS(NULL, test_eo); + + tet_result(TET_PASS); + tet_infoline("[[ TET_MSG ]]::[ID]:TC_01, [TYPE]: Positive, [RESULT]:PASS, An Multi Button Entry is added successfully."); +} + + +/** + * @brief Negative test case of ug_init elm_multibuttonentry_item_next() + */ +static void utc_UIFW_elm_multibuttonentry_item_next_func_02(void) +{ + test_eo = elm_multibuttonentry_add(NULL); + TET_CHECK_FAIL(NULL, test_eo); + + tet_result(TET_PASS); + tet_infoline("[[ TET_MSG ]]::[ID]:TC_02, [TYPE]: Negative, [RESULT]:PASS, Adding an Multi Button Entry has failed."); +} + diff --git a/TC/elm_ts/multibuttonentry/utc_UIFW_elm_multibuttonentry_item_prev_func.c b/TC/elm_ts/multibuttonentry/utc_UIFW_elm_multibuttonentry_item_prev_func.c new file mode 100755 index 0000000..9309677 --- /dev/null +++ b/TC/elm_ts/multibuttonentry/utc_UIFW_elm_multibuttonentry_item_prev_func.c @@ -0,0 +1,176 @@ +#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; \ + } \ +} + + +Evas_Object *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_multibuttonentry_item_prev_func_01(void); +static void utc_UIFW_elm_multibuttonentry_item_prev_func_02(void); + +enum { + POSITIVE_TC_IDX = 0x01, + NEGATIVE_TC_IDX, +}; + +struct tet_testlist tet_testlist[] = { + { utc_UIFW_elm_multibuttonentry_item_prev_func_01, POSITIVE_TC_IDX }, + { utc_UIFW_elm_multibuttonentry_item_prev_func_02, NEGATIVE_TC_IDX }, + { NULL, 0 } +}; + +// Declare the global variables +Evas_Object *main_win, *main_bg; +Evas_Object *test_win, *test_bg; +Evas_Object *test_eo = NULL; +// Declare internal functions +void _elm_precondition(void); +static void _win_del(void *data, Evas_Object *obj, void *event_info); + + +// Delete main window +static void _win_del(void *data, Evas_Object *obj, void *event_info) +{ + elm_exit(); +} + +// Do precondition. +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); + elm_win_resize_object_add(main_win, main_bg); + evas_object_show(main_bg); + + // set an initial window size + evas_object_resize(main_win, 320, 480); + // show the window + evas_object_show(main_win); + + //elm_run(); +} + +// Start up function for each test purpose +static void +startup() +{ + tet_infoline("[[ TET_MSG ]]:: ============ Startup ============ "); + + // Elm precondition + _elm_precondition(); + + // Test precondition + test_win = elm_win_add(NULL, "Multi Button Entry", ELM_WIN_BASIC); + elm_win_title_set(test_win, "Multi Button Entry"); + 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); + + tet_infoline("[[ TET_MSG ]]:: Completing startup"); +} + +// Clean up function for each test purpose +static void +cleanup() +{ + tet_infoline("[[ TET_MSG ]]:: ============ Cleanup ============ "); + + // Clean up the used resources. + if ( NULL != main_win ) { + evas_object_del(main_win); + main_win = NULL; + } + + if ( NULL != main_bg ) { + evas_object_del(main_bg); + main_bg = NULL; + } + + if ( NULL != test_win ) { + evas_object_del(test_win); + test_win = NULL; + } + + if ( NULL != test_bg ) { + evas_object_del(test_bg); + test_bg = NULL; + } + + if ( NULL != test_eo ) { + evas_object_del(test_eo); + test_eo = NULL; + } + + // clean up and shut down + elm_shutdown(); ; + + tet_infoline("[[ TET_MSG ]]:: ========= TC COMPLETE ========== "); +} + + +/** + * @brief Positive test case of elm_multibuttonentry_item_prev() + */ +static void utc_UIFW_elm_multibuttonentry_item_prev_func_01(void) +{ + test_eo = elm_multibuttonentry_add(test_win); + TET_CHECK_PASS(NULL, test_eo); + + tet_result(TET_PASS); + tet_infoline("[[ TET_MSG ]]::[ID]:TC_01, [TYPE]: Positive, [RESULT]:PASS, An Multi Button Entry is added successfully."); +} + + +/** + * @brief Negative test case of ug_init elm_multibuttonentry_item_prev() + */ +static void utc_UIFW_elm_multibuttonentry_item_prev_func_02(void) +{ + test_eo = elm_multibuttonentry_add(NULL); + TET_CHECK_FAIL(NULL, test_eo); + + tet_result(TET_PASS); + tet_infoline("[[ TET_MSG ]]::[ID]:TC_02, [TYPE]: Negative, [RESULT]:PASS, Adding an Multi Button Entry has failed."); +} + diff --git a/TC/elm_ts/multibuttonentry/utc_UIFW_elm_multibuttonentry_item_selected_get_func.c b/TC/elm_ts/multibuttonentry/utc_UIFW_elm_multibuttonentry_item_selected_get_func.c new file mode 100755 index 0000000..5620a13 --- /dev/null +++ b/TC/elm_ts/multibuttonentry/utc_UIFW_elm_multibuttonentry_item_selected_get_func.c @@ -0,0 +1,191 @@ +#include +#include + +// Definitions +// For checking the result of the positive test case. +#define TET_CHECK_PASS(x1, y...) \ +{ \ + Elm_Multibuttonentry_Item *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...) \ +{ \ + Elm_Multibuttonentry_Item *err = y; \ + if (err != (x1)) \ + { \ + tet_printf("[TET_CHECK_FAIL]:: %s[%d] : Test has failed..", __FILE__,__LINE__); \ + tet_result(TET_FAIL); \ + return; \ + } \ +} + + +Evas_Object *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_multibuttonentry_item_selected_get_func_01(void); +static void utc_UIFW_elm_multibuttonentry_item_selected_get_func_02(void); + +enum { + POSITIVE_TC_IDX = 0x01, + NEGATIVE_TC_IDX, +}; + +struct tet_testlist tet_testlist[] = { + { utc_UIFW_elm_multibuttonentry_item_selected_get_func_01, POSITIVE_TC_IDX }, + { utc_UIFW_elm_multibuttonentry_item_selected_get_func_02, NEGATIVE_TC_IDX }, + { NULL, 0 } +}; + +// Declare the global variables +Evas_Object *main_win, *main_bg; +Evas_Object *test_win, *test_bg; +Evas_Object *test_eo = NULL; +// Declare internal functions +void _elm_precondition(void); +static void _win_del(void *data, Evas_Object *obj, void *event_info); + + +// Delete main window +static void _win_del(void *data, Evas_Object *obj, void *event_info) +{ + elm_exit(); +} + +// Do precondition. +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); + elm_win_resize_object_add(main_win, main_bg); + evas_object_show(main_bg); + + // set an initial window size + evas_object_resize(main_win, 320, 480); + // show the window + evas_object_show(main_win); + + //elm_run(); +} + +// Start up function for each test purpose +static void +startup() +{ + tet_infoline("[[ TET_MSG ]]:: ============ Startup ============ "); + + // Elm precondition + _elm_precondition(); + + // Test precondition + test_win = elm_win_add(NULL, "Multi Button Entry", ELM_WIN_BASIC); + elm_win_title_set(test_win, "Multi Button Entry"); + 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); + + tet_infoline("[[ TET_MSG ]]:: Completing startup"); +} + +// Clean up function for each test purpose +static void +cleanup() +{ + tet_infoline("[[ TET_MSG ]]:: ============ Cleanup ============ "); + + // Clean up the used resources. + if ( NULL != main_win ) { + evas_object_del(main_win); + main_win = NULL; + } + + if ( NULL != main_bg ) { + evas_object_del(main_bg); + main_bg = NULL; + } + + if ( NULL != test_win ) { + evas_object_del(test_win); + test_win = NULL; + } + + if ( NULL != test_bg ) { + evas_object_del(test_bg); + test_bg = NULL; + } + + if ( NULL != test_eo ) { + evas_object_del(test_eo); + test_eo = NULL; + } + + // clean up and shut down + elm_shutdown(); ; + + tet_infoline("[[ TET_MSG ]]:: ========= TC COMPLETE ========== "); +} + + +/** + * @brief Positive test case of elm_multibuttonentry_item_selected_get() + */ +static void utc_UIFW_elm_multibuttonentry_item_selected_get_func_01(void) +{ + Elm_Multibuttonentry_Item *added_item1 = NULL, *added_item2 = NULL, *selected_item = NULL; + + test_eo = elm_multibuttonentry_add(test_win); + added_item1 = elm_multibuttonentry_item_add_end(test_eo, "item1", NULL); + added_item2 = elm_multibuttonentry_item_add_end(test_eo, "item2", NULL); + elm_multibuttonentry_item_selected_set(added_item1); + selected_item = elm_multibuttonentry_item_selected_get(test_eo); + if (selected_item != added_item1) { + tet_infoline("elm_multibuttonentry_item_selected_get() failed in positive test case"); + tet_result(TET_FAIL); + return; + } + + tet_result(TET_PASS); + tet_infoline("[[ TET_MSG ]]::[ID]:TC_01, [TYPE]: Positive, [RESULT]:PASS, elm_multibuttonentry_item_selected_get()."); +} + + +/** + * @brief Negative test case of ug_init elm_multibuttonentry_item_selected_get() + */ +static void utc_UIFW_elm_multibuttonentry_item_selected_get_func_02(void) +{ + Elm_Multibuttonentry_Item *added_item1 = NULL, *added_item2 = NULL, *selected_item = NULL; + + test_eo = elm_multibuttonentry_add(NULL); + added_item1 = elm_multibuttonentry_item_add_end(test_eo, "item1", NULL); + added_item2 = elm_multibuttonentry_item_add_end(test_eo, "item2", NULL); + selected_item = elm_multibuttonentry_item_selected_get(test_eo); + TET_CHECK_FAIL(NULL, selected_item); + + tet_result(TET_PASS); + tet_infoline("[[ TET_MSG ]]::[ID]:TC_02, [TYPE]: Negative, [RESULT]:PASS, elm_multibuttonentry_item_selected_get()."); +} + diff --git a/TC/elm_ts/multibuttonentry/utc_UIFW_elm_multibuttonentry_items_del_func.c b/TC/elm_ts/multibuttonentry/utc_UIFW_elm_multibuttonentry_items_del_func.c new file mode 100755 index 0000000..7e9ae24 --- /dev/null +++ b/TC/elm_ts/multibuttonentry/utc_UIFW_elm_multibuttonentry_items_del_func.c @@ -0,0 +1,176 @@ +#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; \ + } \ +} + + +Evas_Object *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_multibuttonentry_items_del_func_01(void); +static void utc_UIFW_elm_multibuttonentry_items_del_func_02(void); + +enum { + POSITIVE_TC_IDX = 0x01, + NEGATIVE_TC_IDX, +}; + +struct tet_testlist tet_testlist[] = { + { utc_UIFW_elm_multibuttonentry_items_del_func_01, POSITIVE_TC_IDX }, + { utc_UIFW_elm_multibuttonentry_items_del_func_02, NEGATIVE_TC_IDX }, + { NULL, 0 } +}; + +// Declare the global variables +Evas_Object *main_win, *main_bg; +Evas_Object *test_win, *test_bg; +Evas_Object *test_eo = NULL; +// Declare internal functions +void _elm_precondition(void); +static void _win_del(void *data, Evas_Object *obj, void *event_info); + + +// Delete main window +static void _win_del(void *data, Evas_Object *obj, void *event_info) +{ + elm_exit(); +} + +// Do precondition. +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); + elm_win_resize_object_add(main_win, main_bg); + evas_object_show(main_bg); + + // set an initial window size + evas_object_resize(main_win, 320, 480); + // show the window + evas_object_show(main_win); + + //elm_run(); +} + +// Start up function for each test purpose +static void +startup() +{ + tet_infoline("[[ TET_MSG ]]:: ============ Startup ============ "); + + // Elm precondition + _elm_precondition(); + + // Test precondition + test_win = elm_win_add(NULL, "Multi Button Entry", ELM_WIN_BASIC); + elm_win_title_set(test_win, "Multi Button Entry"); + 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); + + tet_infoline("[[ TET_MSG ]]:: Completing startup"); +} + +// Clean up function for each test purpose +static void +cleanup() +{ + tet_infoline("[[ TET_MSG ]]:: ============ Cleanup ============ "); + + // Clean up the used resources. + if ( NULL != main_win ) { + evas_object_del(main_win); + main_win = NULL; + } + + if ( NULL != main_bg ) { + evas_object_del(main_bg); + main_bg = NULL; + } + + if ( NULL != test_win ) { + evas_object_del(test_win); + test_win = NULL; + } + + if ( NULL != test_bg ) { + evas_object_del(test_bg); + test_bg = NULL; + } + + if ( NULL != test_eo ) { + evas_object_del(test_eo); + test_eo = NULL; + } + + // clean up and shut down + elm_shutdown(); ; + + tet_infoline("[[ TET_MSG ]]:: ========= TC COMPLETE ========== "); +} + + +/** + * @brief Positive test case of elm_multibuttonentry_items_del() + */ +static void utc_UIFW_elm_multibuttonentry_items_del_func_01(void) +{ + test_eo = elm_multibuttonentry_add(test_win); + TET_CHECK_PASS(NULL, test_eo); + + tet_result(TET_PASS); + tet_infoline("[[ TET_MSG ]]::[ID]:TC_01, [TYPE]: Positive, [RESULT]:PASS, An Multi Button Entry is added successfully."); +} + + +/** + * @brief Negative test case of ug_init elm_multibuttonentry_items_del() + */ +static void utc_UIFW_elm_multibuttonentry_items_del_func_02(void) +{ + test_eo = elm_multibuttonentry_add(NULL); + TET_CHECK_FAIL(NULL, test_eo); + + tet_result(TET_PASS); + tet_infoline("[[ TET_MSG ]]::[ID]:TC_02, [TYPE]: Negative, [RESULT]:PASS, Adding an Multi Button Entry has failed."); +} + diff --git a/TC/elm_ts/multibuttonentry/utc_UIFW_elm_multibuttonentry_items_get_func.c b/TC/elm_ts/multibuttonentry/utc_UIFW_elm_multibuttonentry_items_get_func.c new file mode 100755 index 0000000..76b55d3 --- /dev/null +++ b/TC/elm_ts/multibuttonentry/utc_UIFW_elm_multibuttonentry_items_get_func.c @@ -0,0 +1,212 @@ +#include +#include + +// Definitions +// For checking the result of the positive test case. +#define TET_CHECK_PASS(x1, y...) \ +{ \ + Eina_List *err = y; \ + Eina_List *val = x1; \ + if (err == val) \ + { \ + 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...) \ +{ \ + Eina_List *err = y; \ + Eina_List *val = x1; \ + if (err != val) \ + { \ + tet_printf("[TET_CHECK_FAIL]:: %s[%d] : Test has failed..", __FILE__,__LINE__); \ + tet_result(TET_FAIL); \ + return; \ + } \ +} + + +Evas_Object *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_multibuttonentry_items_get_func_01(void); +static void utc_UIFW_elm_multibuttonentry_items_get_func_02(void); + +enum { + POSITIVE_TC_IDX = 0x01, + NEGATIVE_TC_IDX, +}; + +struct tet_testlist tet_testlist[] = { + { utc_UIFW_elm_multibuttonentry_items_get_func_01, POSITIVE_TC_IDX }, + { utc_UIFW_elm_multibuttonentry_items_get_func_02, NEGATIVE_TC_IDX }, + { NULL, 0 } +}; + +// Declare the global variables +Evas_Object *main_win, *main_bg; +Evas_Object *test_win, *test_bg; +Evas_Object *test_eo = NULL; +// Declare internal functions +void _elm_precondition(void); +static void _win_del(void *data, Evas_Object *obj, void *event_info); + + +// Delete main window +static void _win_del(void *data, Evas_Object *obj, void *event_info) +{ + elm_exit(); +} + +// Do precondition. +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); + elm_win_resize_object_add(main_win, main_bg); + evas_object_show(main_bg); + + // set an initial window size + evas_object_resize(main_win, 320, 480); + // show the window + evas_object_show(main_win); + + //elm_run(); +} + +// Start up function for each test purpose +static void +startup() +{ + tet_infoline("[[ TET_MSG ]]:: ============ Startup ============ "); + + // Elm precondition + _elm_precondition(); + + // Test precondition + test_win = elm_win_add(NULL, "Multi Button Entry", ELM_WIN_BASIC); + elm_win_title_set(test_win, "Multi Button Entry"); + 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); + + tet_infoline("[[ TET_MSG ]]:: Completing startup"); +} + +// Clean up function for each test purpose +static void +cleanup() +{ + tet_infoline("[[ TET_MSG ]]:: ============ Cleanup ============ "); + + // Clean up the used resources. + if ( NULL != main_win ) { + evas_object_del(main_win); + main_win = NULL; + } + + if ( NULL != main_bg ) { + evas_object_del(main_bg); + main_bg = NULL; + } + + if ( NULL != test_win ) { + evas_object_del(test_win); + test_win = NULL; + } + + if ( NULL != test_bg ) { + evas_object_del(test_bg); + test_bg = NULL; + } + + if ( NULL != test_eo ) { + evas_object_del(test_eo); + test_eo = NULL; + } + + // clean up and shut down + elm_shutdown(); ; + + tet_infoline("[[ TET_MSG ]]:: ========= TC COMPLETE ========== "); +} + + +/** + * @brief Positive test case of elm_multibuttonentry_items_get() + */ +static void utc_UIFW_elm_multibuttonentry_items_get_func_01(void) +{ + const Eina_List *items = NULL; + int i=0; + unsigned int count = 0; + + test_eo = elm_multibuttonentry_add(test_win); + + // test 1 + items = elm_multibuttonentry_items_get(test_eo); + if (items) { + tet_infoline("elm_multibuttonentry_items_get() failed in positive test case"); + tet_result(TET_FAIL); + return; + } + + for(i=0; i< 5; i++){ + elm_multibuttonentry_item_add_end(test_eo, "item", NULL); + } + + // test 2 + items = elm_multibuttonentry_items_get(test_eo); + TET_CHECK_PASS(NULL, items); + + // test 3 + count = eina_list_count(items); + if (count != 5) { + tet_infoline("elm_multibuttonentry_items_get() failed in positive test case"); + tet_result(TET_FAIL); + return; + } + + tet_result(TET_PASS); + tet_infoline("[[ TET_MSG ]]::[ID]:TC_01, [TYPE]: Positive, [RESULT]:PASS, elm_multibuttonentry_items_get()."); +} + + +/** + * @brief Negative test case of ug_init elm_multibuttonentry_items_get() + */ +static void utc_UIFW_elm_multibuttonentry_items_get_func_02(void) +{ + Eina_List *items = NULL; + int i=0; + + test_eo = elm_multibuttonentry_add(NULL); + for(i=0; i< 5; i++){ + elm_multibuttonentry_item_add_end(test_eo, "item", NULL); + } + items = elm_multibuttonentry_items_get(NULL); + TET_CHECK_FAIL(NULL, items); + + tet_result(TET_PASS); + tet_infoline("[[ TET_MSG ]]::[ID]:TC_02, [TYPE]: Negative, [RESULT]:PASS, Adding an Multi Button Entry has failed."); +} + diff --git a/TC/elm_ts/multibuttonentry/utc_UIFW_elm_multibuttonentry_label_get_func.c b/TC/elm_ts/multibuttonentry/utc_UIFW_elm_multibuttonentry_label_get_func.c new file mode 100755 index 0000000..d4eb059 --- /dev/null +++ b/TC/elm_ts/multibuttonentry/utc_UIFW_elm_multibuttonentry_label_get_func.c @@ -0,0 +1,185 @@ +#include +#include + +// Definitions +// For checking the result of the positive test case. +#define TET_CHECK_PASS(x1, y...) \ +{ \ + const char *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...) \ +{ \ + const char *err = y; \ + if (err != (x1)) \ + { \ + tet_printf("[TET_CHECK_FAIL]:: %s[%d] : Test has failed..", __FILE__,__LINE__); \ + tet_result(TET_FAIL); \ + return; \ + } \ +} + + +Evas_Object *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_multibuttonentry_label_get_func_01(void); +static void utc_UIFW_elm_multibuttonentry_label_get_func_02(void); + +enum { + POSITIVE_TC_IDX = 0x01, + NEGATIVE_TC_IDX, +}; + +struct tet_testlist tet_testlist[] = { + { utc_UIFW_elm_multibuttonentry_label_get_func_01, POSITIVE_TC_IDX }, + { utc_UIFW_elm_multibuttonentry_label_get_func_02, NEGATIVE_TC_IDX }, + { NULL, 0 } +}; + +// Declare the global variables +Evas_Object *main_win, *main_bg; +Evas_Object *test_win, *test_bg; +Evas_Object *test_eo = NULL; +// Declare internal functions +void _elm_precondition(void); +static void _win_del(void *data, Evas_Object *obj, void *event_info); + + +// Delete main window +static void _win_del(void *data, Evas_Object *obj, void *event_info) +{ + elm_exit(); +} + +// Do precondition. +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); + elm_win_resize_object_add(main_win, main_bg); + evas_object_show(main_bg); + + // set an initial window size + evas_object_resize(main_win, 320, 480); + // show the window + evas_object_show(main_win); + + //elm_run(); +} + +// Start up function for each test purpose +static void +startup() +{ + tet_infoline("[[ TET_MSG ]]:: ============ Startup ============ "); + + // Elm precondition + _elm_precondition(); + + // Test precondition + test_win = elm_win_add(NULL, "Multi Button Entry", ELM_WIN_BASIC); + elm_win_title_set(test_win, "Multi Button Entry"); + 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); + + tet_infoline("[[ TET_MSG ]]:: Completing startup"); +} + +// Clean up function for each test purpose +static void +cleanup() +{ + tet_infoline("[[ TET_MSG ]]:: ============ Cleanup ============ "); + + // Clean up the used resources. + if ( NULL != main_win ) { + evas_object_del(main_win); + main_win = NULL; + } + + if ( NULL != main_bg ) { + evas_object_del(main_bg); + main_bg = NULL; + } + + if ( NULL != test_win ) { + evas_object_del(test_win); + test_win = NULL; + } + + if ( NULL != test_bg ) { + evas_object_del(test_bg); + test_bg = NULL; + } + + if ( NULL != test_eo ) { + evas_object_del(test_eo); + test_eo = NULL; + } + + // clean up and shut down + elm_shutdown(); ; + + tet_infoline("[[ TET_MSG ]]:: ========= TC COMPLETE ========== "); +} + +/** + * @brief Positive test case of elm_multibuttonentry_label_get() + */ +static void utc_UIFW_elm_multibuttonentry_label_get_func_01(void) +{ + const char *ret_str = NULL; + + test_eo = elm_multibuttonentry_add(test_win); + elm_multibuttonentry_label_set(test_eo, "test"); + ret_str = elm_multibuttonentry_label_get(test_eo); + TET_CHECK_PASS(NULL, ret_str); + + tet_result(TET_PASS); + tet_infoline("[[ TET_MSG ]]::[ID]:TC_01, [TYPE]: Positive, [RESULT]:PASS, elm_multibuttonentry_label_get()."); +} + + + +/** + * @brief Negative test case of ug_init elm_multibuttonentry_label_get() + */ +static void utc_UIFW_elm_multibuttonentry_label_get_func_02(void) +{ + const char *ret_str = NULL; + + test_eo = elm_multibuttonentry_add(test_win); + elm_multibuttonentry_label_set(test_eo, NULL); + ret_str = elm_multibuttonentry_label_get(test_eo); + TET_CHECK_FAIL(NULL, ret_str); + + tet_result(TET_PASS); + tet_infoline("[[ TET_MSG ]]::[ID]:TC_02, [TYPE]: Negative, [RESULT]:PASS, elm_multibuttonentry_label_get()."); +} + + -- 2.7.4