test cases are added to conformant
authorsumanth.m <sumanth.m@samsung.com>
Thu, 30 Sep 2010 06:21:52 +0000 (11:51 +0530)
committersumanth.m <sumanth.m@samsung.com>
Thu, 30 Sep 2010 06:21:52 +0000 (11:51 +0530)
TC/elm_ts/conformant/Makefile [new file with mode: 0755]
TC/elm_ts/conformant/tc_gen.sh [new file with mode: 0755]
TC/elm_ts/conformant/tslist [new file with mode: 0644]
TC/elm_ts/conformant/utc_UIFW_elm_conformant_add_func.c [new file with mode: 0644]
TC/elm_ts/conformant/utc_UIFW_elm_conformant_content_set_func.c [new file with mode: 0644]
TC/elm_ts/conformant/utc_UIFW_elm_conformant_content_unset_func.c [new file with mode: 0644]

diff --git a/TC/elm_ts/conformant/Makefile b/TC/elm_ts/conformant/Makefile
new file mode 100755 (executable)
index 0000000..657ed9f
--- /dev/null
@@ -0,0 +1,26 @@
+CC ?= gcc
+
+TARGETS = utc_UIFW_elm_conformant_add_func \
+         utc_UIFW_elm_conformant_content_set_func \
+         utc_UIFW_elm_conformant_content_unset_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/conformant/tc_gen.sh b/TC/elm_ts/conformant/tc_gen.sh
new file mode 100755 (executable)
index 0000000..a55200a
--- /dev/null
@@ -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/conformant/tslist b/TC/elm_ts/conformant/tslist
new file mode 100644 (file)
index 0000000..028e587
--- /dev/null
@@ -0,0 +1,4 @@
+/elm_ts/conformant/utc_UIFW_elm_conformant_add_func
+/elm_ts/conformant/utc_UIFW_elm_conformant_content_set_func
+/elm_ts/conformant/utc_UIFW_elm_conformant_content_unset_func
+
diff --git a/TC/elm_ts/conformant/utc_UIFW_elm_conformant_add_func.c b/TC/elm_ts/conformant/utc_UIFW_elm_conformant_add_func.c
new file mode 100644 (file)
index 0000000..9f06c44
--- /dev/null
@@ -0,0 +1,99 @@
+#include <tet_api.h>\r
+#include <Elementary.h>\r
+\r
+// Definitions\r
+// For checking the result of the positive test case.\r
+#define TET_CHECK_PASS(x1, y...) \\r
+{ \\r
+       Evas_Object *err = y; \\r
+       if (err == (x1)) \\r
+               { \\r
+                       tet_printf("[TET_CHECK_PASS]:: %s[%d] : Test has failed..", __FILE__,__LINE__); \\r
+                       tet_result(TET_FAIL); \\r
+                       return; \\r
+               } \\r
+}\r
+\r
+// For checking the result of the negative test case.\r
+#define TET_CHECK_FAIL(x1, y...) \\r
+{ \\r
+       Evas_Object *err = y; \\r
+       if (err != (x1)) \\r
+               { \\r
+                       tet_printf("[TET_CHECK_FAIL]:: %s[%d] : Test has failed..", __FILE__,__LINE__); \\r
+                       tet_result(TET_FAIL); \\r
+                       return; \\r
+               } \\r
+}\r
+\r
+\r
+Evas_Object *main_win;\r
+\r
+static void startup(void);\r
+static void cleanup(void);\r
+\r
+void (*tet_startup)(void) = startup;\r
+void (*tet_cleanup)(void) = cleanup;\r
+\r
+static void utc_UIFW_elm_conformant_add_func_01(void);\r
+static void utc_UIFW_elm_conformant_add_func_02(void);\r
+\r
+enum {\r
+       POSITIVE_TC_conf = 0x01,\r
+       NEGATIVE_TC_conf,\r
+};\r
+\r
+struct tet_testlist tet_testlist[] = {\r
+       { utc_UIFW_elm_conformant_add_func_01, POSITIVE_TC_conf },\r
+       { utc_UIFW_elm_conformant_add_func_02, NEGATIVE_TC_conf },\r
+};\r
+\r
+static void startup(void)\r
+{\r
+       tet_infoline("[[ TET_MSG ]]:: ============ Startup ============ ");\r
+       elm_init(0, NULL);\r
+       main_win = elm_win_add(NULL, "main", ELM_WIN_BASIC);\r
+       evas_object_show(main_win);     \r
+}\r
+\r
+static void cleanup(void)\r
+{\r
+       if ( NULL != main_win ) {\r
+               evas_object_del(main_win);\r
+               main_win = NULL;\r
+       }\r
+       elm_shutdown();\r
+       tet_infoline("[[ TET_MSG ]]:: ============ Cleanup ============ ");\r
+}\r
+\r
+/**\r
+ * @brief Positive test case of elm_conformant_add()\r
+ */\r
+static void utc_UIFW_elm_conformant_add_func_01(void)\r
+{\r
+       Evas_Object *conf = NULL;\r
+       conf = elm_conformant_add(main_win);\r
+       evas_object_show(conf);\r
+       if (!conf) {\r
+               tet_infoline("elm_conformant_add() failed in positive test case");\r
+               tet_result(TET_FAIL);\r
+               return;\r
+       }\r
+       tet_result(TET_PASS);\r
+}\r
+\r
+/**\r
+ * @brief Negative test case of elm_conformant_add()\r
+ */\r
+static void utc_UIFW_elm_conformant_add_func_02(void)\r
+{\r
+       Evas_Object *conf = NULL;\r
+       conf = elm_conformant_add(NULL);\r
+       evas_object_show(conf);\r
+       if (conf) {\r
+               tet_infoline("elm_conformant_add() failed in negative test case");\r
+               tet_result(TET_FAIL);\r
+               return;\r
+       }\r
+       tet_result(TET_PASS);\r
+}\r
diff --git a/TC/elm_ts/conformant/utc_UIFW_elm_conformant_content_set_func.c b/TC/elm_ts/conformant/utc_UIFW_elm_conformant_content_set_func.c
new file mode 100644 (file)
index 0000000..94c96dd
--- /dev/null
@@ -0,0 +1,109 @@
+#include <tet_api.h>\r
+#include <Elementary.h>\r
+\r
+// Definitions\r
+// For checking the result of the positive test case.\r
+#define TET_CHECK_PASS(x1, y...) \\r
+{ \\r
+       Evas_Object *err = y; \\r
+       if (err == (x1)) \\r
+               { \\r
+                       tet_printf("[TET_CHECK_PASS]:: %s[%d] : Test has failed..", __FILE__,__LINE__); \\r
+                       tet_result(TET_FAIL); \\r
+                       return; \\r
+               } \\r
+}\r
+\r
+// For checking the result of the negative test case.\r
+#define TET_CHECK_FAIL(x1, y...) \\r
+{ \\r
+       Evas_Object *err = y; \\r
+       if (err != (x1)) \\r
+               { \\r
+                       tet_printf("[TET_CHECK_FAIL]:: %s[%d] : Test has failed..", __FILE__,__LINE__); \\r
+                       tet_result(TET_FAIL); \\r
+                       return; \\r
+               } \\r
+}\r
+\r
+\r
+Evas_Object *main_win;\r
+\r
+static void startup(void);\r
+static void cleanup(void);\r
+\r
+void (*tet_startup)(void) = startup;\r
+void (*tet_cleanup)(void) = cleanup;\r
+\r
+static void utc_UIFW_elm_conformant_content_set_func_01(void);\r
+static void utc_UIFW_elm_conformant_content_set_func_02(void);\r
+\r
+enum {\r
+       POSITIVE_TC_conf = 0x01,\r
+       NEGATIVE_TC_conf,\r
+};\r
+\r
+struct tet_testlist tet_testlist[] = {\r
+       { utc_UIFW_elm_conformant_content_set_func_01, POSITIVE_TC_conf },\r
+       { utc_UIFW_elm_conformant_content_set_func_02, NEGATIVE_TC_conf },\r
+};\r
+\r
+static void startup(void)\r
+{\r
+       tet_infoline("[[ TET_MSG ]]:: ============ Startup ============ ");\r
+       elm_init(0, NULL);\r
+       main_win = elm_win_add(NULL, "main", ELM_WIN_BASIC);\r
+       evas_object_show(main_win);     \r
+}\r
+\r
+static void cleanup(void)\r
+{\r
+       if ( NULL != main_win ) {\r
+               evas_object_del(main_win);\r
+               main_win = NULL;\r
+       }\r
+       elm_shutdown();\r
+       tet_infoline("[[ TET_MSG ]]:: ============ Cleanup ============ ");\r
+}\r
+\r
+/**\r
+ * @brief Positive test case of elm_conformant_content_set()\r
+ */\r
+static void utc_UIFW_elm_conformant_content_set_func_01(void)\r
+{\r
+       Evas_Object *conf = NULL, *conform= NULL;
+        Evas_Object* entry = NULL;\r
+       conf = elm_conformant_add(main_win);\r
+       evas_object_show(conf);
+       entry = elm_scrolled_entry_add(main_win);
+       evas_object_show(entry);
+        elm_conformant_content_set(conf,entry);
+       conform = elm_object_parent_widget_get(entry);\r
+       if (!conform) {\r
+               tet_infoline("elm_conformant_content_set() failed in positive test case");\r
+               tet_result(TET_FAIL);\r
+               return;\r
+       }\r
+       tet_result(TET_PASS);\r
+}\r
+\r
+/**\r
+ * @brief Negative test case of elm_conformant_content_set()\r
+ */\r
+static void utc_UIFW_elm_conformant_content_set_func_02(void)\r
+{\r
+       Evas_Object *conf = NULL, *conform= NULL;
+        Evas_Object* entry = NULL;\r
+       conf = elm_conformant_add(main_win);\r
+       evas_object_show(conf);
+       entry = elm_scrolled_entry_add(NULL);
+       evas_object_show(entry);
+        elm_conformant_content_set(NULL,entry);
+       conform = elm_object_parent_widget_get(entry);\r
+       if (conform) {
+               tet_infoline("elm_conformant_content_set() failed in negative test case");\r
+               tet_result(TET_FAIL);\r
+               return;\r
+       }\r
+       tet_result(TET_PASS);\r
+}\r
diff --git a/TC/elm_ts/conformant/utc_UIFW_elm_conformant_content_unset_func.c b/TC/elm_ts/conformant/utc_UIFW_elm_conformant_content_unset_func.c
new file mode 100644 (file)
index 0000000..5f9e269
--- /dev/null
@@ -0,0 +1,111 @@
+#include <tet_api.h>\r
+#include <Elementary.h>\r
+\r
+// Definitions\r
+// For checking the result of the positive test case.\r
+#define TET_CHECK_PASS(x1, y...) \\r
+{ \\r
+       Evas_Object *err = y; \\r
+       if (err == (x1)) \\r
+               { \\r
+                       tet_printf("[TET_CHECK_PASS]:: %s[%d] : Test has failed..", __FILE__,__LINE__); \\r
+                       tet_result(TET_FAIL); \\r
+                       return; \\r
+               } \\r
+}\r
+\r
+// For checking the result of the negative test case.\r
+#define TET_CHECK_FAIL(x1, y...) \\r
+{ \\r
+       Evas_Object *err = y; \\r
+       if (err != (x1)) \\r
+               { \\r
+                       tet_printf("[TET_CHECK_FAIL]:: %s[%d] : Test has failed..", __FILE__,__LINE__); \\r
+                       tet_result(TET_FAIL); \\r
+                       return; \\r
+               } \\r
+}\r
+\r
+\r
+Evas_Object *main_win;\r
+\r
+static void startup(void);\r
+static void cleanup(void);\r
+\r
+void (*tet_startup)(void) = startup;\r
+void (*tet_cleanup)(void) = cleanup;\r
+\r
+static void utc_UIFW_elm_conformant_content_unset_func_01(void);\r
+static void utc_UIFW_elm_conformant_content_unset_func_02(void);\r
+\r
+enum {\r
+       POSITIVE_TC_conf = 0x01,\r
+       NEGATIVE_TC_conf,\r
+};\r
+\r
+struct tet_testlist tet_testlist[] = {\r
+       { utc_UIFW_elm_conformant_content_unset_func_01, POSITIVE_TC_conf },\r
+       { utc_UIFW_elm_conformant_content_unset_func_02, NEGATIVE_TC_conf },\r
+};\r
+\r
+static void startup(void)\r
+{\r
+       tet_infoline("[[ TET_MSG ]]:: ============ Startup ============ ");\r
+       elm_init(0, NULL);\r
+       main_win = elm_win_add(NULL, "main", ELM_WIN_BASIC);\r
+       evas_object_show(main_win);     \r
+}\r
+\r
+static void cleanup(void)\r
+{\r
+       if ( NULL != main_win ) {\r
+               evas_object_del(main_win);\r
+               main_win = NULL;\r
+       }\r
+       elm_shutdown();\r
+       tet_infoline("[[ TET_MSG ]]:: ============ Cleanup ============ ");\r
+}\r
+\r
+/**\r
+ * @brief Positive test case of elm_conformant_content_unset()\r
+ */\r
+static void utc_UIFW_elm_conformant_content_unset_func_01(void)\r
+{\r
+       Evas_Object *conf = NULL, *conform= NULL;
+        Evas_Object* entry = NULL;\r
+       conf = elm_conformant_add(main_win);\r
+       evas_object_show(conf);
+       entry = elm_scrolled_entry_add(NULL);
+       evas_object_show(entry);
+        elm_conformant_content_set(conf,entry);
+        elm_conformant_content_unset(conf);
+       conform = elm_object_parent_widget_get(entry);\r
+       if (conform) {
+               tet_infoline("elm_conformant_content_unset() failed in positive test case");\r
+               tet_result(TET_FAIL);\r
+               return;\r
+       }\r
+       tet_result(TET_PASS);\r
+}\r
+\r
+/**\r
+ * @brief Negative test case of elm_conformant_content_unset()\r
+ */\r
+static void utc_UIFW_elm_conformant_content_unset_func_02(void)\r
+{\r
+       Evas_Object *conf = NULL, *conform= NULL;
+        Evas_Object* entry = NULL;\r
+       conf = elm_conformant_add(main_win);\r
+       evas_object_show(conf);
+       entry = elm_scrolled_entry_add(main_win);
+       evas_object_show(entry);
+        elm_conformant_content_set(conf,entry);
+        elm_conformant_content_unset(NULL);
+       conform = elm_object_parent_widget_get(entry);\r
+       if (!conform) {\r
+               tet_infoline("elm_conformant_content_unset() failed in negative test case");    
+               tet_result(TET_FAIL);\r
+               return;\r
+       }\r
+       tet_result(TET_PASS);\r
+}\r