From 738b49a6e107658088aebe3e54f0d7920fa3b6f5 Mon Sep 17 00:00:00 2001 From: shilpa singh Date: Wed, 8 Sep 2010 21:07:11 +0900 Subject: [PATCH] test cases added for popup --- TC/elm_ts/popup/Makefile | 40 +++++++ TC/elm_ts/popup/tc_gen.sh | 32 ++++++ TC/elm_ts/popup/tslist | 18 +++ TC/elm_ts/popup/utc_MODULE_API_func.c.in | 103 +++++++++++++++++ TC/elm_ts/popup/utc_UIFW_elm_popup_add_func.c | 103 +++++++++++++++++ .../popup/utc_UIFW_elm_popup_buttons_add_func.c | 92 ++++++++++++++++ .../popup/utc_UIFW_elm_popup_content_get_func.c | 103 +++++++++++++++++ .../popup/utc_UIFW_elm_popup_content_set_func.c | 105 ++++++++++++++++++ TC/elm_ts/popup/utc_UIFW_elm_popup_desc_get_func.c | 104 ++++++++++++++++++ TC/elm_ts/popup/utc_UIFW_elm_popup_desc_set_func.c | 91 +++++++++++++++ TC/elm_ts/popup/utc_UIFW_elm_popup_mode_set_func.c | 92 ++++++++++++++++ .../popup/utc_UIFW_elm_popup_orient_set_func.c | 92 ++++++++++++++++ TC/elm_ts/popup/utc_UIFW_elm_popup_response_func.c | 90 +++++++++++++++ .../popup/utc_UIFW_elm_popup_rotation_set_func.c | 92 ++++++++++++++++ TC/elm_ts/popup/utc_UIFW_elm_popup_run_func.c | 122 +++++++++++++++++++++ .../popup/utc_UIFW_elm_popup_timeout_set_func.c | 91 +++++++++++++++ .../popup/utc_UIFW_elm_popup_title_icon_get_func.c | 107 ++++++++++++++++++ .../popup/utc_UIFW_elm_popup_title_icon_set_func.c | 109 ++++++++++++++++++ .../utc_UIFW_elm_popup_title_label_get_func.c | 105 ++++++++++++++++++ .../utc_UIFW_elm_popup_title_label_set_func.c | 91 +++++++++++++++ .../utc_UIFW_elm_popup_with_buttons_add_func.c | 99 +++++++++++++++++ TC/tet_scen_arm | 1 + TC/tet_scen_i686 | 2 + 23 files changed, 1884 insertions(+) create mode 100755 TC/elm_ts/popup/Makefile create mode 100755 TC/elm_ts/popup/tc_gen.sh create mode 100644 TC/elm_ts/popup/tslist create mode 100755 TC/elm_ts/popup/utc_MODULE_API_func.c.in create mode 100644 TC/elm_ts/popup/utc_UIFW_elm_popup_add_func.c create mode 100644 TC/elm_ts/popup/utc_UIFW_elm_popup_buttons_add_func.c create mode 100644 TC/elm_ts/popup/utc_UIFW_elm_popup_content_get_func.c create mode 100644 TC/elm_ts/popup/utc_UIFW_elm_popup_content_set_func.c create mode 100644 TC/elm_ts/popup/utc_UIFW_elm_popup_desc_get_func.c create mode 100644 TC/elm_ts/popup/utc_UIFW_elm_popup_desc_set_func.c create mode 100644 TC/elm_ts/popup/utc_UIFW_elm_popup_mode_set_func.c create mode 100644 TC/elm_ts/popup/utc_UIFW_elm_popup_orient_set_func.c create mode 100644 TC/elm_ts/popup/utc_UIFW_elm_popup_response_func.c create mode 100644 TC/elm_ts/popup/utc_UIFW_elm_popup_rotation_set_func.c create mode 100644 TC/elm_ts/popup/utc_UIFW_elm_popup_run_func.c create mode 100644 TC/elm_ts/popup/utc_UIFW_elm_popup_timeout_set_func.c create mode 100644 TC/elm_ts/popup/utc_UIFW_elm_popup_title_icon_get_func.c create mode 100644 TC/elm_ts/popup/utc_UIFW_elm_popup_title_icon_set_func.c create mode 100644 TC/elm_ts/popup/utc_UIFW_elm_popup_title_label_get_func.c create mode 100644 TC/elm_ts/popup/utc_UIFW_elm_popup_title_label_set_func.c create mode 100644 TC/elm_ts/popup/utc_UIFW_elm_popup_with_buttons_add_func.c diff --git a/TC/elm_ts/popup/Makefile b/TC/elm_ts/popup/Makefile new file mode 100755 index 0000000..ace7a7c --- /dev/null +++ b/TC/elm_ts/popup/Makefile @@ -0,0 +1,40 @@ +CC ?= gcc + +TARGETS = utc_UIFW_elm_popup_add_func \ + utc_UIFW_elm_popup_with_buttons_add_func \ + utc_UIFW_elm_popup_desc_set_func \ + utc_UIFW_elm_popup_desc_get_func \ + utc_UIFW_elm_popup_title_label_set_func \ + utc_UIFW_elm_popup_title_label_get_func \ + utc_UIFW_elm_popup_title_icon_set_func \ + utc_UIFW_elm_popup_title_icon_get_func \ + utc_UIFW_elm_popup_content_set_func \ + utc_UIFW_elm_popup_content_get_func \ + utc_UIFW_elm_popup_buttons_add_func \ + utc_UIFW_elm_popup_timeout_set_func \ + utc_UIFW_elm_popup_mode_set_func \ + utc_UIFW_elm_popup_response_func \ + utc_UIFW_elm_popup_orient_set_func \ + utc_UIFW_elm_popup_rotation_set_func \ + utc_UIFW_elm_popup_run_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/popup/tc_gen.sh b/TC/elm_ts/popup/tc_gen.sh new file mode 100755 index 0000000..a55200a --- /dev/null +++ b/TC/elm_ts/popup/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/popup/tslist b/TC/elm_ts/popup/tslist new file mode 100644 index 0000000..e8fdbe3 --- /dev/null +++ b/TC/elm_ts/popup/tslist @@ -0,0 +1,18 @@ +/elm_ts/imageslider/utc_UIFW_elm_imageslider_add_func +/elm_ts/popup/utc_UIFW_elm_popup_add_func +/elm_ts/popup/utc_UIFW_elm_popup_with_buttons_add_func +/elm_ts/popup/utc_UIFW_elm_popup_desc_set_func +/elm_ts/popup/utc_UIFW_elm_popup_desc_get_func +/elm_ts/popup/utc_UIFW_elm_popup_title_label_set_func +/elm_ts/popup/utc_UIFW_elm_popup_title_label_get_func +/elm_ts/popup/utc_UIFW_elm_popup_title_icon_set_func +/elm_ts/popup/utc_UIFW_elm_popup_title_icon_get_func +/elm_ts/popup/utc_UIFW_elm_popup_content_set_func +/elm_ts/popup/utc_UIFW_elm_popup_content_get_func +/elm_ts/popup/utc_UIFW_elm_popup_buttons_add_func +/elm_ts/popup/utc_UIFW_elm_popup_timeout_set_func +/elm_ts/popup/utc_UIFW_elm_popup_mode_set_func +/elm_ts/popup/utc_UIFW_elm_popup_response_func +/elm_ts/popup/utc_UIFW_elm_popup_orient_set_func +/elm_ts/popup/utc_UIFW_elm_popup_rotation_set_func +/elm_ts/popup/utc_UIFW_elm_popup_run_func diff --git a/TC/elm_ts/popup/utc_MODULE_API_func.c.in b/TC/elm_ts/popup/utc_MODULE_API_func.c.in new file mode 100755 index 0000000..710e5a1 --- /dev/null +++ b/TC/elm_ts/popup/utc_MODULE_API_func.c.in @@ -0,0 +1,103 @@ +#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 }, +}; + +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/popup/utc_UIFW_elm_popup_add_func.c b/TC/elm_ts/popup/utc_UIFW_elm_popup_add_func.c new file mode 100644 index 0000000..4338455 --- /dev/null +++ b/TC/elm_ts/popup/utc_UIFW_elm_popup_add_func.c @@ -0,0 +1,103 @@ +#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_popup_add_func_01(void); +static void utc_UIFW_elm_popup_add_func_02(void); + +enum { + POSITIVE_TC_IDX = 0x01, + NEGATIVE_TC_IDX, +}; + +struct tet_testlist tet_testlist[] = { + { utc_UIFW_elm_popup_add_func_01, POSITIVE_TC_IDX }, + { utc_UIFW_elm_popup_add_func_02, NEGATIVE_TC_IDX }, +}; + +static void startup(void) +{ + tet_infoline("[[ TET_MSG ]]:: ============ Startup ============ "); + elm_init(0, NULL); + main_win = elm_win_add(NULL, "main", ELM_WIN_BASIC); + evas_object_show(main_win); +} + +static void cleanup(void) +{ + if ( NULL != main_win ) { + evas_object_del(main_win); + main_win = NULL; + } + elm_shutdown(); + tet_infoline("[[ TET_MSG ]]:: ============ Cleanup ============ "); +} + +/** + * @brief Positive test case of elm_popup_add() + */ +static void utc_UIFW_elm_popup_add_func_01(void) +{ + Evas_Object *popup = NULL; + + + popup = elm_popup_add(main_win); + + if (!popup) { + tet_infoline("elm_popup_add() failed in positive test case"); + tet_result(TET_FAIL); + return; + } + tet_result(TET_PASS); +} + +/** + * @brief Negative test case of ug_init elm_popup_add() + */ +static void utc_UIFW_elm_popup_add_func_02(void) +{ + Evas_Object *popup = NULL; + + + popup = elm_popup_add(NULL); + + if (!popup) { + tet_infoline("elm_popup_add() with parent as NULL failed in positive test case"); + tet_result(TET_FAIL); + return; + } + tet_result(TET_PASS); +} diff --git a/TC/elm_ts/popup/utc_UIFW_elm_popup_buttons_add_func.c b/TC/elm_ts/popup/utc_UIFW_elm_popup_buttons_add_func.c new file mode 100644 index 0000000..f36db48 --- /dev/null +++ b/TC/elm_ts/popup/utc_UIFW_elm_popup_buttons_add_func.c @@ -0,0 +1,92 @@ +#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, *popup; + + +static void startup(void); +static void cleanup(void); + +void (*tet_startup)(void) = startup; +void (*tet_cleanup)(void) = cleanup; + +static void utc_UIFW_elm_popup_buttons_add_func_01(void); +static void utc_UIFW_elm_popup_buttons_add_func_02(void); + +enum { + POSITIVE_TC_IDX = 0x01, + NEGATIVE_TC_IDX, +}; + +struct tet_testlist tet_testlist[] = { + { utc_UIFW_elm_popup_buttons_add_func_01, POSITIVE_TC_IDX }, + { utc_UIFW_elm_popup_buttons_add_func_02, NEGATIVE_TC_IDX }, +}; + +static void startup(void) +{ + tet_infoline("[[ TET_MSG ]]:: ============ Startup ============ "); + elm_init(0, NULL); + main_win = elm_win_add(NULL, "main", ELM_WIN_BASIC); + evas_object_show(main_win); + popup = elm_popup_add(main_win); + evas_object_show(popup); +} + +static void cleanup(void) +{ + if ( NULL != main_win ) { + evas_object_del(main_win); + main_win = NULL; + } + if ( NULL != popup ) { + evas_object_del(popup); + popup = NULL; + } + elm_shutdown(); + tet_infoline("[[ TET_MSG ]]:: ============ Cleanup ============ "); +} + +/** + * @brief Positive test case of elm_popup_buttons_add() + */ +static void utc_UIFW_elm_popup_buttons_add_func_01(void) +{ + elm_popup_buttons_add(popup, 1, "Ok", ELM_POPUP_RESPONSE_OK, NULL); + tet_result(TET_PASS); +} + +/** + * @brief Negative test case of ug_init elm_popup_buttons_add() + */ +static void utc_UIFW_elm_popup_buttons_add_func_02(void) +{ + elm_popup_buttons_add(NULL, 1, "Ok", ELM_POPUP_RESPONSE_OK, NULL); + tet_result(TET_PASS); +} diff --git a/TC/elm_ts/popup/utc_UIFW_elm_popup_content_get_func.c b/TC/elm_ts/popup/utc_UIFW_elm_popup_content_get_func.c new file mode 100644 index 0000000..57fc708 --- /dev/null +++ b/TC/elm_ts/popup/utc_UIFW_elm_popup_content_get_func.c @@ -0,0 +1,103 @@ +#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, *popup; + +static void startup(void); +static void cleanup(void); + +void (*tet_startup)(void) = startup; +void (*tet_cleanup)(void) = cleanup; + +static void utc_UIFW_elm_popup_content_get_func_01(void); +static void utc_UIFW_elm_popup_content_get_func_02(void); + +enum { + POSITIVE_TC_IDX = 0x01, + NEGATIVE_TC_IDX, +}; + +struct tet_testlist tet_testlist[] = { + { utc_UIFW_elm_popup_content_get_func_01, POSITIVE_TC_IDX }, + { utc_UIFW_elm_popup_content_get_func_02, NEGATIVE_TC_IDX }, +}; + +static void startup(void) +{ + tet_infoline("[[ TET_MSG ]]:: ============ Startup ============ "); + elm_init(0, NULL); + main_win = elm_win_add(NULL, "main", ELM_WIN_BASIC); + evas_object_show(main_win); + popup = elm_popup_add(main_win); + evas_object_show(popup); +} + +static void cleanup(void) +{ + if ( NULL != main_win ) { + evas_object_del(main_win); + main_win = NULL; + } + if ( NULL != popup ) { + evas_object_del(popup); + popup = NULL; + } + elm_shutdown(); + tet_infoline("[[ TET_MSG ]]:: ============ Cleanup ============ "); +} + +/** + * @brief Positive test case of elm_popup_content_get() + */ +static void utc_UIFW_elm_popup_content_get_func_01(void) +{ + Evas_Object *content = NULL; + content = elm_popup_content_get(popup); + if (!content) { + tet_infoline("elm_popup_content_get() failed in positive test case"); + tet_result(TET_FAIL); + return; + } + tet_result(TET_PASS); +} + +/** + * @brief Negative test case of ug_init elm_popup_content_get() + */ +static void utc_UIFW_elm_popup_content_get_func_02(void) +{ + Evas_Object *content = NULL; + content = elm_popup_content_get(NULL); + if (content) { + tet_infoline("elm_popup_content_get() failed in negative test case"); + tet_result(TET_FAIL); + return; + } + tet_result(TET_PASS); +} diff --git a/TC/elm_ts/popup/utc_UIFW_elm_popup_content_set_func.c b/TC/elm_ts/popup/utc_UIFW_elm_popup_content_set_func.c new file mode 100644 index 0000000..f414af7 --- /dev/null +++ b/TC/elm_ts/popup/utc_UIFW_elm_popup_content_set_func.c @@ -0,0 +1,105 @@ +#include +#include +#define ICON_DIR "usr/share/beat_winset_test/icon" + +// 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, *popup; +char buf[4096]; + +static void startup(void); +static void cleanup(void); + +void (*tet_startup)(void) = startup; +void (*tet_cleanup)(void) = cleanup; + +static void utc_UIFW_elm_popup_content_set_func_01(void); +static void utc_UIFW_elm_popup_content_set_func_02(void); + +enum { + POSITIVE_TC_IDX = 0x01, + NEGATIVE_TC_IDX, +}; + +struct tet_testlist tet_testlist[] = { + { utc_UIFW_elm_popup_content_set_func_01, POSITIVE_TC_IDX }, + { utc_UIFW_elm_popup_content_set_func_02, NEGATIVE_TC_IDX }, +}; + +static void startup(void) +{ + tet_infoline("[[ TET_MSG ]]:: ============ Startup ============ "); + elm_init(0, NULL); + main_win = elm_win_add(NULL, "main", ELM_WIN_BASIC); + evas_object_show(main_win); + popup = elm_popup_add(main_win); + evas_object_show(popup); +} + +static void cleanup(void) +{ + if ( NULL != main_win ) { + evas_object_del(main_win); + main_win = NULL; + } + if ( NULL != popup ) { + evas_object_del(popup); + popup = NULL; + } + elm_shutdown(); + tet_infoline("[[ TET_MSG ]]:: ============ Cleanup ============ "); +} + +/** + * @brief Positive test case of elm_popup_content_set() + */ +static void utc_UIFW_elm_popup_content_set_func_01(void) +{ + Evas_Object *icon = elm_icon_add(popup); + snprintf(buf, sizeof(buf), "%s/00_volume_icon.png", ICON_DIR); + elm_icon_file_set(icon, buf, NULL); + evas_object_size_hint_aspect_set(icon, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1); + elm_icon_scale_set(icon, 1, 1); + + elm_popup_content_set(popup,icon); + tet_result(TET_PASS); +} + +/** + * @brief Negative test case of ug_init elm_popup_content_set() + */ +static void utc_UIFW_elm_popup_content_set_func_02(void) +{ + Evas_Object *icon = elm_icon_add(popup); + snprintf(buf, sizeof(buf), "%s/00_volume_icon.png", ICON_DIR); + elm_icon_file_set(icon, buf, NULL); + evas_object_size_hint_aspect_set(icon, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1); + elm_icon_scale_set(icon, 1, 1); + + elm_popup_content_set(NULL,icon); + tet_result(TET_PASS); +} diff --git a/TC/elm_ts/popup/utc_UIFW_elm_popup_desc_get_func.c b/TC/elm_ts/popup/utc_UIFW_elm_popup_desc_get_func.c new file mode 100644 index 0000000..3c671cf --- /dev/null +++ b/TC/elm_ts/popup/utc_UIFW_elm_popup_desc_get_func.c @@ -0,0 +1,104 @@ +#include +#include + +// Definitions +// For checking the result of the positive test case. +#define TET_CHECK_PASS(x1, y...) \ +{ \ + Evas_Object *err = y; \ + if (err == (x1)) \ + { \ + tet_printf("[TET_CHECK_PASS]:: %s[%d] : Test has failed..", __FILE__,__LINE__); \ + tet_result(TET_FAIL); \ + return; \ + } \ +} + +// For checking the result of the negative test case. +#define TET_CHECK_FAIL(x1, y...) \ +{ \ + Evas_Object *err = y; \ + if (err != (x1)) \ + { \ + tet_printf("[TET_CHECK_FAIL]:: %s[%d] : Test has failed..", __FILE__,__LINE__); \ + tet_result(TET_FAIL); \ + return; \ + } \ +} + + +Evas_Object *main_win, *popup; + +static void startup(void); +static void cleanup(void); + +void (*tet_startup)(void) = startup; +void (*tet_cleanup)(void) = cleanup; + +static void utc_UIFW_elm_popup_desc_get_func_01(void); +static void utc_UIFW_elm_popup_desc_get_func_02(void); + +enum { + POSITIVE_TC_IDX = 0x01, + NEGATIVE_TC_IDX, +}; + +struct tet_testlist tet_testlist[] = { + { utc_UIFW_elm_popup_desc_get_func_01, POSITIVE_TC_IDX }, + { utc_UIFW_elm_popup_desc_get_func_02, NEGATIVE_TC_IDX }, +}; + +static void startup(void) +{ + tet_infoline("[[ TET_MSG ]]:: ============ Startup ============ "); + elm_init(0, NULL); + main_win = elm_win_add(NULL, "main", ELM_WIN_BASIC); + evas_object_show(main_win); + popup = elm_popup_add(main_win); + evas_object_show(popup); +} + +static void cleanup(void) +{ + if ( NULL != main_win ) { + evas_object_del(main_win); + main_win = NULL; + } + if ( NULL != popup ) { + evas_object_del(popup); + popup = NULL; + } + elm_shutdown(); + tet_infoline("[[ TET_MSG ]]:: ============ Cleanup ============ "); +} + +/** + * @brief Positive test case of elm_popup_desc_get() + */ +static void utc_UIFW_elm_popup_desc_get_func_01(void) +{ + const char *text = NULL; + text = elm_popup_desc_get(popup); + + if (!text) { + tet_infoline("elm_popup_desc_get() failed in positive test case"); + tet_result(TET_FAIL); + return; + } + tet_result(TET_PASS); +} + +/** + * @brief Negative test case of ug_init elm_popup_desc_get() + */ +static void utc_UIFW_elm_popup_desc_get_func_02(void) +{ + const char *text = NULL; + text = elm_popup_desc_get(popup); + if (text) { + tet_infoline("elm_popup_desc_get() failed in negative test case"); + tet_result(TET_FAIL); + return; + } + tet_result(TET_PASS); +} diff --git a/TC/elm_ts/popup/utc_UIFW_elm_popup_desc_set_func.c b/TC/elm_ts/popup/utc_UIFW_elm_popup_desc_set_func.c new file mode 100644 index 0000000..a12604d --- /dev/null +++ b/TC/elm_ts/popup/utc_UIFW_elm_popup_desc_set_func.c @@ -0,0 +1,91 @@ +#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, *popup; + +static void startup(void); +static void cleanup(void); + +void (*tet_startup)(void) = startup; +void (*tet_cleanup)(void) = cleanup; + +static void utc_UIFW_elm_popup_desc_set_func_01(void); +static void utc_UIFW_elm_popup_desc_set_func_02(void); + +enum { + POSITIVE_TC_IDX = 0x01, + NEGATIVE_TC_IDX, +}; + +struct tet_testlist tet_testlist[] = { + { utc_UIFW_elm_popup_desc_set_func_01, POSITIVE_TC_IDX }, + { utc_UIFW_elm_popup_desc_set_func_02, NEGATIVE_TC_IDX }, +}; + +static void startup(void) +{ + tet_infoline("[[ TET_MSG ]]:: ============ Startup ============ "); + elm_init(0, NULL); + main_win = elm_win_add(NULL, "main", ELM_WIN_BASIC); + evas_object_show(main_win); + popup = elm_popup_add(main_win); + evas_object_show(popup); +} + +static void cleanup(void) +{ + if ( NULL != main_win ) { + evas_object_del(main_win); + main_win = NULL; + } + if ( NULL != popup ) { + evas_object_del(popup); + popup = NULL; + } + elm_shutdown(); + tet_infoline("[[ TET_MSG ]]:: ============ Cleanup ============ "); +} + +/** + * @brief Positive test case of elm_popup_desc_set() + */ +static void utc_UIFW_elm_popup_desc_set_func_01(void) +{ + elm_popup_desc_set(popup, "This is Popup"); + tet_result(TET_PASS); +} + +/** + * @brief Negative test case of ug_init elm_popup_desc_set() + */ +static void utc_UIFW_elm_popup_desc_set_func_02(void) +{ + elm_popup_desc_set(NULL, "This is Popup"); + tet_result(TET_PASS); +} diff --git a/TC/elm_ts/popup/utc_UIFW_elm_popup_mode_set_func.c b/TC/elm_ts/popup/utc_UIFW_elm_popup_mode_set_func.c new file mode 100644 index 0000000..b4ce033 --- /dev/null +++ b/TC/elm_ts/popup/utc_UIFW_elm_popup_mode_set_func.c @@ -0,0 +1,92 @@ +#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, *popup; + + +static void startup(void); +static void cleanup(void); + +void (*tet_startup)(void) = startup; +void (*tet_cleanup)(void) = cleanup; + +static void utc_UIFW_elm_popup_mode_set_func_01(void); +static void utc_UIFW_elm_popup_mode_set_func_02(void); + +enum { + POSITIVE_TC_IDX = 0x01, + NEGATIVE_TC_IDX, +}; + +struct tet_testlist tet_testlist[] = { + { utc_UIFW_elm_popup_mode_set_func_01, POSITIVE_TC_IDX }, + { utc_UIFW_elm_popup_mode_set_func_02, NEGATIVE_TC_IDX }, +}; + +static void startup(void) +{ + tet_infoline("[[ TET_MSG ]]:: ============ Startup ============ "); + elm_init(0, NULL); + main_win = elm_win_add(NULL, "main", ELM_WIN_BASIC); + evas_object_show(main_win); + popup = elm_popup_add(main_win); + evas_object_show(popup); +} + +static void cleanup(void) +{ + if ( NULL != main_win ) { + evas_object_del(main_win); + main_win = NULL; + } + if ( NULL != popup ) { + evas_object_del(popup); + popup = NULL; + } + elm_shutdown(); + tet_infoline("[[ TET_MSG ]]:: ============ Cleanup ============ "); +} + +/** + * @brief Positive test case of elm_popup_mode_set() + */ +static void utc_UIFW_elm_popup_mode_set_func_01(void) +{ + elm_popup_mode_set(popup, ELM_POPUP_TYPE_ALERT); + tet_result(TET_PASS); +} + +/** + * @brief Negative test case of ug_init elm_popup_mode_set() + */ +static void utc_UIFW_elm_popup_mode_set_func_02(void) +{ + elm_popup_mode_set(NULL, ELM_POPUP_TYPE_ALERT); + tet_result(TET_PASS); +} diff --git a/TC/elm_ts/popup/utc_UIFW_elm_popup_orient_set_func.c b/TC/elm_ts/popup/utc_UIFW_elm_popup_orient_set_func.c new file mode 100644 index 0000000..0929abe --- /dev/null +++ b/TC/elm_ts/popup/utc_UIFW_elm_popup_orient_set_func.c @@ -0,0 +1,92 @@ +#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, *popup; + + +static void startup(void); +static void cleanup(void); + +void (*tet_startup)(void) = startup; +void (*tet_cleanup)(void) = cleanup; + +static void utc_UIFW_elm_popup_orient_set_func_01(void); +static void utc_UIFW_elm_popup_orient_set_func_02(void); + +enum { + POSITIVE_TC_IDX = 0x01, + NEGATIVE_TC_IDX, +}; + +struct tet_testlist tet_testlist[] = { + { utc_UIFW_elm_popup_orient_set_func_01, POSITIVE_TC_IDX }, + { utc_UIFW_elm_popup_orient_set_func_02, NEGATIVE_TC_IDX }, +}; + +static void startup(void) +{ + tet_infoline("[[ TET_MSG ]]:: ============ Startup ============ "); + elm_init(0, NULL); + main_win = elm_win_add(NULL, "main", ELM_WIN_BASIC); + evas_object_show(main_win); + popup = elm_popup_add(main_win); + evas_object_show(popup); +} + +static void cleanup(void) +{ + if ( NULL != main_win ) { + evas_object_del(main_win); + main_win = NULL; + } + if ( NULL != popup ) { + evas_object_del(popup); + popup = NULL; + } + elm_shutdown(); + tet_infoline("[[ TET_MSG ]]:: ============ Cleanup ============ "); +} + +/** + * @brief Positive test case of elm_popup_orient_set() + */ +static void utc_UIFW_elm_popup_orient_set_func_01(void) +{ + elm_popup_orient_set(popup, ELM_POPUP_ORIENT_TOP); + tet_result(TET_PASS); +} + +/** + * @brief Negative test case of ug_init elm_popup_orient_set() + */ +static void utc_UIFW_elm_popup_orient_set_func_02(void) +{ + elm_popup_orient_set(NULL, ELM_POPUP_ORIENT_TOP); + tet_result(TET_PASS); +} diff --git a/TC/elm_ts/popup/utc_UIFW_elm_popup_response_func.c b/TC/elm_ts/popup/utc_UIFW_elm_popup_response_func.c new file mode 100644 index 0000000..2b5ee34 --- /dev/null +++ b/TC/elm_ts/popup/utc_UIFW_elm_popup_response_func.c @@ -0,0 +1,90 @@ +#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, *popup; + +static void startup(void); +static void cleanup(void); + +void (*tet_startup)(void) = startup; +void (*tet_cleanup)(void) = cleanup; + +static void utc_UIFW_elm_popup_response_func_01(void); +static void utc_UIFW_elm_popup_response_func_02(void); + +enum { + POSITIVE_TC_IDX = 0x01, + NEGATIVE_TC_IDX, +}; + +struct tet_testlist tet_testlist[] = { + { utc_UIFW_elm_popup_response_func_01, POSITIVE_TC_IDX }, + { utc_UIFW_elm_popup_response_func_02, NEGATIVE_TC_IDX }, +}; + +static void startup(void) +{ + tet_infoline("[[ TET_MSG ]]:: ============ Startup ============ "); + elm_init(0, NULL); + main_win = elm_win_add(NULL, "main", ELM_WIN_BASIC); + evas_object_show(main_win); + popup = elm_popup_add(main_win); + evas_object_show(popup); +} + +static void cleanup(void) +{ + if ( NULL != main_win ) { + evas_object_del(main_win); + main_win = NULL; + } + if ( NULL != popup ) { + evas_object_del(popup); + popup = NULL; + } + elm_shutdown(); + tet_infoline("[[ TET_MSG ]]:: ============ Cleanup ============ "); +} + +/** + * @brief Positive test case of elm_popup_response() + */ +static void utc_UIFW_elm_popup_response_func_01(void) +{ + elm_popup_response(popup, ELM_POPUP_RESPONSE_OK); + tet_result(TET_PASS); +} + +/** + * @brief Negative test case of ug_init elm_popup_response() + */ +static void utc_UIFW_elm_popup_response_func_02(void) +{ + elm_popup_response(NULL, ELM_POPUP_RESPONSE_OK); + tet_result(TET_PASS); +} diff --git a/TC/elm_ts/popup/utc_UIFW_elm_popup_rotation_set_func.c b/TC/elm_ts/popup/utc_UIFW_elm_popup_rotation_set_func.c new file mode 100644 index 0000000..b114d73 --- /dev/null +++ b/TC/elm_ts/popup/utc_UIFW_elm_popup_rotation_set_func.c @@ -0,0 +1,92 @@ +#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, *popup; + + +static void startup(void); +static void cleanup(void); + +void (*tet_startup)(void) = startup; +void (*tet_cleanup)(void) = cleanup; + +static void utc_UIFW_elm_popup_rotation_set_func_01(void); +static void utc_UIFW_elm_popup_rotation_set_func_02(void); + +enum { + POSITIVE_TC_IDX = 0x01, + NEGATIVE_TC_IDX, +}; + +struct tet_testlist tet_testlist[] = { + { utc_UIFW_elm_popup_rotation_set_func_01, POSITIVE_TC_IDX }, + { utc_UIFW_elm_popup_rotation_set_func_02, NEGATIVE_TC_IDX }, +}; + +static void startup(void) +{ + tet_infoline("[[ TET_MSG ]]:: ============ Startup ============ "); + elm_init(0, NULL); + main_win = elm_win_add(NULL, "main", ELM_WIN_BASIC); + evas_object_show(main_win); + popup = elm_popup_add(main_win); + evas_object_show(popup); +} + +static void cleanup(void) +{ + if ( NULL != main_win ) { + evas_object_del(main_win); + main_win = NULL; + } + if ( NULL != popup ) { + evas_object_del(popup); + popup = NULL; + } + elm_shutdown(); + tet_infoline("[[ TET_MSG ]]:: ============ Cleanup ============ "); +} + +/** + * @brief Positive test case of elm_popup_rotation_set() + */ +static void utc_UIFW_elm_popup_rotation_set_func_01(void) +{ + elm_popup_rotation_set(popup,90); + tet_result(TET_PASS); +} + +/** + * @brief Negative test case of ug_init elm_popup_rotation_set() + */ +static void utc_UIFW_elm_popup_rotation_set_func_02(void) +{ + elm_popup_rotation_set(NULL,90); + tet_result(TET_PASS); +} diff --git a/TC/elm_ts/popup/utc_UIFW_elm_popup_run_func.c b/TC/elm_ts/popup/utc_UIFW_elm_popup_run_func.c new file mode 100644 index 0000000..d9c60a7 --- /dev/null +++ b/TC/elm_ts/popup/utc_UIFW_elm_popup_run_func.c @@ -0,0 +1,122 @@ +#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, *popup; + + +static void startup(void); +static void cleanup(void); + +void (*tet_startup)(void) = startup; +void (*tet_cleanup)(void) = cleanup; + +static void utc_UIFW_elm_popup_run_func_01(void); +static void utc_UIFW_elm_popup_run_func_02(void); + +enum { + POSITIVE_TC_IDX = 0x01, + NEGATIVE_TC_IDX, +}; + +struct tet_testlist tet_testlist[] = { + { utc_UIFW_elm_popup_run_func_01, POSITIVE_TC_IDX }, + { utc_UIFW_elm_popup_run_func_02, NEGATIVE_TC_IDX }, +}; + +static void startup(void) +{ + tet_infoline("[[ TET_MSG ]]:: ============ Startup ============ "); + elm_init(0, NULL); + main_win = elm_win_add(NULL, "main", ELM_WIN_BASIC); + evas_object_show(main_win); + popup = elm_popup_add(main_win); + evas_object_show(popup); +} + +static void cleanup(void) +{ + if ( NULL != main_win ) { + evas_object_del(main_win); + main_win = NULL; + } + if ( NULL != popup ) { + evas_object_del(popup); + popup = NULL; + } + elm_shutdown(); + tet_infoline("[[ TET_MSG ]]:: ============ Cleanup ============ "); +} + +static int +_exit_timer_popup(void *data) +{ + printf("\n\nexiting timer\n"); + elm_popup_response((Evas_Object *)data, ELM_POPUP_RESPONSE_NONE); + return 0; +} + + +/** + * @brief Positive test case of elm_popup_run() + */ +static void utc_UIFW_elm_popup_run_func_01(void) +{ + int r = 0; + + ecore_timer_add(1.0, _exit_timer_popup, popup); + r = elm_popup_run(popup); + + if (!r) { + tet_infoline("elm_popup_run() failed in positive test case"); + tet_result(TET_FAIL); + return; + } + else + { + evas_object_del(popup); + elm_exit(); + } + tet_result(TET_PASS); +} + +/** + * @brief Negative test case of ug_init elm_popup_run() + */ +static void utc_UIFW_elm_popup_run_func_02(void) +{ + int r = 0; + r = elm_popup_run(NULL); + + if (r) { + tet_infoline("elm_popup_run() failed in negative test case"); + tet_result(TET_FAIL); + return; + } + tet_result(TET_PASS); +} diff --git a/TC/elm_ts/popup/utc_UIFW_elm_popup_timeout_set_func.c b/TC/elm_ts/popup/utc_UIFW_elm_popup_timeout_set_func.c new file mode 100644 index 0000000..87f5739 --- /dev/null +++ b/TC/elm_ts/popup/utc_UIFW_elm_popup_timeout_set_func.c @@ -0,0 +1,91 @@ +#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, *popup; + +static void startup(void); +static void cleanup(void); + +void (*tet_startup)(void) = startup; +void (*tet_cleanup)(void) = cleanup; + +static void utc_UIFW_elm_popup_timeout_set_func_01(void); +static void utc_UIFW_elm_popup_timeout_set_func_02(void); + +enum { + POSITIVE_TC_IDX = 0x01, + NEGATIVE_TC_IDX, +}; + +struct tet_testlist tet_testlist[] = { + { utc_UIFW_elm_popup_timeout_set_func_01, POSITIVE_TC_IDX }, + { utc_UIFW_elm_popup_timeout_set_func_02, NEGATIVE_TC_IDX }, +}; + +static void startup(void) +{ + tet_infoline("[[ TET_MSG ]]:: ============ Startup ============ "); + elm_init(0, NULL); + main_win = elm_win_add(NULL, "main", ELM_WIN_BASIC); + evas_object_show(main_win); + popup = elm_popup_add(main_win); + evas_object_show(popup); +} + +static void cleanup(void) +{ + if ( NULL != main_win ) { + evas_object_del(main_win); + main_win = NULL; + } + if ( NULL != popup ) { + evas_object_del(popup); + popup = NULL; + } + elm_shutdown(); + tet_infoline("[[ TET_MSG ]]:: ============ Cleanup ============ "); +} + +/** + * @brief Positive test case of elm_popup_timeout_set() + */ +static void utc_UIFW_elm_popup_timeout_set_func_01(void) +{ + elm_popup_timeout_set(popup, 1); + tet_result(TET_PASS); +} + +/** + * @brief Negative test case of ug_init elm_popup_timeout_set() + */ +static void utc_UIFW_elm_popup_timeout_set_func_02(void) +{ + elm_popup_timeout_set(NULL, 1); + tet_result(TET_PASS); +} diff --git a/TC/elm_ts/popup/utc_UIFW_elm_popup_title_icon_get_func.c b/TC/elm_ts/popup/utc_UIFW_elm_popup_title_icon_get_func.c new file mode 100644 index 0000000..9d17a8a --- /dev/null +++ b/TC/elm_ts/popup/utc_UIFW_elm_popup_title_icon_get_func.c @@ -0,0 +1,107 @@ +#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, *popup; + + +static void startup(void); +static void cleanup(void); + +void (*tet_startup)(void) = startup; +void (*tet_cleanup)(void) = cleanup; + +static void utc_UIFW_elm_popup_title_icon_get_func_01(void); +static void utc_UIFW_elm_popup_title_icon_get_func_02(void); + +enum { + POSITIVE_TC_IDX = 0x01, + NEGATIVE_TC_IDX, +}; + +struct tet_testlist tet_testlist[] = { + { utc_UIFW_elm_popup_title_icon_get_func_01, POSITIVE_TC_IDX }, + { utc_UIFW_elm_popup_title_icon_get_func_02, NEGATIVE_TC_IDX }, +}; + +static void startup(void) +{ + tet_infoline("[[ TET_MSG ]]:: ============ Startup ============ "); + elm_init(0, NULL); + main_win = elm_win_add(NULL, "main", ELM_WIN_BASIC); + evas_object_show(main_win); + popup = elm_popup_add(main_win); + evas_object_show(popup); +} + +static void cleanup(void) +{ + if ( NULL != main_win ) { + evas_object_del(main_win); + main_win = NULL; + } + if ( NULL != popup ) { + evas_object_del(popup); + popup = NULL; + } + elm_shutdown(); + tet_infoline("[[ TET_MSG ]]:: ============ Cleanup ============ "); +} + +/** + * @brief Positive test case of elm_popup_title_icon_get() + */ +static void utc_UIFW_elm_popup_title_icon_get_func_01(void) +{ + + Evas_Object *icon = NULL; + icon = elm_popup_title_icon_get(popup); + + if (!icon) { + tet_infoline("elm_popup_title_icon_get() failed in positive test case"); + tet_result(TET_FAIL); + return; + } + tet_result(TET_PASS); +} + +/** + * @brief Negative test case of ug_init elm_popup_title_icon_get() + */ +static void utc_UIFW_elm_popup_title_icon_get_func_02(void) +{ + Evas_Object *icon = NULL; + icon = elm_popup_title_icon_get(NULL); + + if (icon) { + tet_infoline("elm_popup_title_icon_get() failed in negative test case"); + tet_result(TET_FAIL); + return; + } + tet_result(TET_PASS); +} diff --git a/TC/elm_ts/popup/utc_UIFW_elm_popup_title_icon_set_func.c b/TC/elm_ts/popup/utc_UIFW_elm_popup_title_icon_set_func.c new file mode 100644 index 0000000..e4a2c24 --- /dev/null +++ b/TC/elm_ts/popup/utc_UIFW_elm_popup_title_icon_set_func.c @@ -0,0 +1,109 @@ +#include +#include + +#define ICON_DIR "usr/share/beat_winset_test/icon" + +// 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, *popup; +char buf[4096]; + +static void startup(void); +static void cleanup(void); + +void (*tet_startup)(void) = startup; +void (*tet_cleanup)(void) = cleanup; + +static void utc_UIFW_elm_popup_title_icon_set_func_01(void); +static void utc_UIFW_elm_popup_title_icon_set_func_02(void); + +enum { + POSITIVE_TC_IDX = 0x01, + NEGATIVE_TC_IDX, +}; + +struct tet_testlist tet_testlist[] = { + { utc_UIFW_elm_popup_title_icon_set_func_01, POSITIVE_TC_IDX }, + { utc_UIFW_elm_popup_title_icon_set_func_02, NEGATIVE_TC_IDX }, +}; + +static void startup(void) +{ + tet_infoline("[[ TET_MSG ]]:: ============ Startup ============ "); + elm_init(0, NULL); + main_win = elm_win_add(NULL, "main", ELM_WIN_BASIC); + evas_object_show(main_win); + popup = elm_popup_add(main_win); + evas_object_show(popup); +} + +static void cleanup(void) +{ + if ( NULL != main_win ) { + evas_object_del(main_win); + main_win = NULL; + } + if ( NULL != popup ) { + evas_object_del(popup); + popup = NULL; + } + elm_shutdown(); + tet_infoline("[[ TET_MSG ]]:: ============ Cleanup ============ "); +} + +/** + * @brief Positive test case of elm_popup_title_icon_set() + */ +static void utc_UIFW_elm_popup_title_icon_set_func_01(void) +{ + + Evas_Object *icon = elm_icon_add(popup); + snprintf(buf, sizeof(buf), "%s/00_volume_icon.png", ICON_DIR); + elm_icon_file_set(icon, buf, NULL); + evas_object_size_hint_aspect_set(icon, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1); + elm_icon_scale_set(icon, 1, 1); + + elm_popup_title_icon_set(popup,icon); + tet_result(TET_PASS); +} + +/** + * @brief Negative test case of ug_init elm_popup_title_icon_set() + */ +static void utc_UIFW_elm_popup_title_icon_set_func_02(void) +{ + + Evas_Object *icon = elm_icon_add(popup); + snprintf(buf, sizeof(buf), "%s/00_volume_icon.png", ICON_DIR); + elm_icon_file_set(icon, buf, NULL); + evas_object_size_hint_aspect_set(icon, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1); + elm_icon_scale_set(icon, 1, 1); + + elm_popup_title_icon_set(NULL,icon); + tet_result(TET_PASS); + +} diff --git a/TC/elm_ts/popup/utc_UIFW_elm_popup_title_label_get_func.c b/TC/elm_ts/popup/utc_UIFW_elm_popup_title_label_get_func.c new file mode 100644 index 0000000..e6e3e1f --- /dev/null +++ b/TC/elm_ts/popup/utc_UIFW_elm_popup_title_label_get_func.c @@ -0,0 +1,105 @@ +#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, *popup; + + +static void startup(void); +static void cleanup(void); + +void (*tet_startup)(void) = startup; +void (*tet_cleanup)(void) = cleanup; + +static void utc_UIFW_elm_popup_title_label_get_func_01(void); +static void utc_UIFW_elm_popup_title_label_get_func_02(void); + +enum { + POSITIVE_TC_IDX = 0x01, + NEGATIVE_TC_IDX, +}; + +struct tet_testlist tet_testlist[] = { + { utc_UIFW_elm_popup_title_label_get_func_01, POSITIVE_TC_IDX }, + { utc_UIFW_elm_popup_title_label_get_func_02, NEGATIVE_TC_IDX }, +}; + +static void startup(void) +{ + tet_infoline("[[ TET_MSG ]]:: ============ Startup ============ "); + elm_init(0, NULL); + main_win = elm_win_add(NULL, "main", ELM_WIN_BASIC); + evas_object_show(main_win); + popup = elm_popup_add(main_win); + evas_object_show(popup); +} + +static void cleanup(void) +{ + if ( NULL != main_win ) { + evas_object_del(main_win); + main_win = NULL; + } + if ( NULL != popup ) { + evas_object_del(popup); + popup = NULL; + } + elm_shutdown(); + tet_infoline("[[ TET_MSG ]]:: ============ Cleanup ============ "); +} + +/** + * @brief Positive test case of elm_popup_title_label_get() + */ +static void utc_UIFW_elm_popup_title_label_get_func_01(void) +{ + const char *text = NULL; + text = elm_popup_title_label_get(popup); + + if (!text) { + tet_infoline("elm_popup_title_label_get() failed in positive test case"); + tet_result(TET_FAIL); + return; + } + tet_result(TET_PASS); +} + +/** + * @brief Negative test case of ug_init elm_popup_title_label_get() + */ +static void utc_UIFW_elm_popup_title_label_get_func_02(void) +{ + const char *text = NULL; + text = elm_popup_title_label_get(NULL); + if (text) { + tet_infoline("elm_popup_title_label_get() failed in negative test case"); + tet_result(TET_FAIL); + return; + } + tet_result(TET_PASS); +} diff --git a/TC/elm_ts/popup/utc_UIFW_elm_popup_title_label_set_func.c b/TC/elm_ts/popup/utc_UIFW_elm_popup_title_label_set_func.c new file mode 100644 index 0000000..d8f7c05 --- /dev/null +++ b/TC/elm_ts/popup/utc_UIFW_elm_popup_title_label_set_func.c @@ -0,0 +1,91 @@ +#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, *popup; + +static void startup(void); +static void cleanup(void); + +void (*tet_startup)(void) = startup; +void (*tet_cleanup)(void) = cleanup; + +static void utc_UIFW_elm_popup_title_label_set_func_01(void); +static void utc_UIFW_elm_popup_title_label_set_func_02(void); + +enum { + POSITIVE_TC_IDX = 0x01, + NEGATIVE_TC_IDX, +}; + +struct tet_testlist tet_testlist[] = { + { utc_UIFW_elm_popup_title_label_set_func_01, POSITIVE_TC_IDX }, + { utc_UIFW_elm_popup_title_label_set_func_02, NEGATIVE_TC_IDX }, +}; + +static void startup(void) +{ + tet_infoline("[[ TET_MSG ]]:: ============ Startup ============ "); + elm_init(0, NULL); + main_win = elm_win_add(NULL, "main", ELM_WIN_BASIC); + evas_object_show(main_win); + popup = elm_popup_add(main_win); + evas_object_show(popup); +} + +static void cleanup(void) +{ + if ( NULL != main_win ) { + evas_object_del(main_win); + main_win = NULL; + } + if ( NULL != popup ) { + evas_object_del(popup); + popup = NULL; + } + elm_shutdown(); + tet_infoline("[[ TET_MSG ]]:: ============ Cleanup ============ "); +} + +/** + * @brief Positive test case of elm_popup_title_label_set() + */ +static void utc_UIFW_elm_popup_title_label_set_func_01(void) +{ + elm_popup_title_label_set(popup, "This is Popup"); + tet_result(TET_PASS); +} + +/** + * @brief Negative test case of ug_init elm_popup_title_label_set() + */ +static void utc_UIFW_elm_popup_title_label_set_func_02(void) +{ + elm_popup_title_label_set(NULL, "This is Popup"); + tet_result(TET_PASS); +} diff --git a/TC/elm_ts/popup/utc_UIFW_elm_popup_with_buttons_add_func.c b/TC/elm_ts/popup/utc_UIFW_elm_popup_with_buttons_add_func.c new file mode 100644 index 0000000..1ba5ba8 --- /dev/null +++ b/TC/elm_ts/popup/utc_UIFW_elm_popup_with_buttons_add_func.c @@ -0,0 +1,99 @@ +#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_popup_with_buttons_add_func_01(void); +static void utc_UIFW_elm_popup_with_buttons_add_func_02(void); + +enum { + POSITIVE_TC_IDX = 0x01, + NEGATIVE_TC_IDX, +}; + +struct tet_testlist tet_testlist[] = { + { utc_UIFW_elm_popup_with_buttons_add_func_01, POSITIVE_TC_IDX }, + { utc_UIFW_elm_popup_with_buttons_add_func_02, NEGATIVE_TC_IDX }, +}; + +static void startup(void) +{ + tet_infoline("[[ TET_MSG ]]:: ============ Startup ============ "); + elm_init(0, NULL); + main_win = elm_win_add(NULL, "main", ELM_WIN_BASIC); + evas_object_show(main_win); +} + +static void cleanup(void) +{ + if ( NULL != main_win ) { + evas_object_del(main_win); + main_win = NULL; + } + elm_shutdown(); + tet_infoline("[[ TET_MSG ]]:: ============ Cleanup ============ "); +} + +/** + * @brief Positive test case of elm_popup_with_buttons_add() + */ +static void utc_UIFW_elm_popup_with_buttons_add_func_01(void) +{ + Evas_Object *popup = NULL; + popup = elm_popup_with_buttons_add(main_win, "title", "this is text", 1, "ok", ELM_POPUP_RESPONSE_OK, NULL); + + if (!popup) { + tet_infoline("elm_popup_with_buttons_add() failed in positive test case"); + tet_result(TET_FAIL); + return; + } + tet_result(TET_PASS); +} + +/** + * @brief Negative test case of ug_init elm_popup_with_buttons_add() + */ +static void utc_UIFW_elm_popup_with_buttons_add_func_02(void) +{ + Evas_Object *popup = NULL; + popup = elm_popup_with_buttons_add(NULL, "title", "this is text", 1, "ok", ELM_POPUP_RESPONSE_OK, NULL); + + if (!popup) { + tet_infoline("elm_popup_with_buttons_add() parent as NULL failed in positive test case"); + tet_result(TET_FAIL); + return; + } + tet_result(TET_PASS); +} diff --git a/TC/tet_scen_arm b/TC/tet_scen_arm index fa79bf2..2b14f00 100755 --- a/TC/tet_scen_arm +++ b/TC/tet_scen_arm @@ -14,6 +14,7 @@ elm :include:/elm_ts/pagecontrol/tslist :include:/elm_ts/selectioninfo/tslist :include:/elm_ts/button/tslist + :include:/elm_ts/popup/tslist #yhkim diff --git a/TC/tet_scen_i686 b/TC/tet_scen_i686 index 3363750..854c467 100755 --- a/TC/tet_scen_i686 +++ b/TC/tet_scen_i686 @@ -15,6 +15,8 @@ elm :include:/elm_ts/gengrid/tslist :include:/elm_ts/pagecontrol/tslist :include:/elm_ts/selectioninfo/tslist + :include:/elm_ts/popup/tslist + #yhkim ch -- 2.7.4