utc_elm_textpath_xxx: add test cases for elm_textpath 27/194427/1
authorYoungbok Shin <youngb.shin@samsung.com>
Tue, 4 Dec 2018 09:32:18 +0000 (18:32 +0900)
committerYoungbok Shin <youngb.shin@samsung.com>
Tue, 4 Dec 2018 09:33:25 +0000 (18:33 +0900)
Change-Id: I227f17adee38d7753a53d3f82a399c2df84c0a09
Signed-off-by: Youngbok Shin <youngb.shin@samsung.com>
TC/elementary/textpath/Makefile [new file with mode: 0644]
TC/elementary/textpath/tslist [new file with mode: 0644]
TC/elementary/textpath/tslist_fhub [new file with mode: 0644]
TC/elementary/textpath/tslist_mobile [new file with mode: 0644]
TC/elementary/textpath/tslist_tv [new file with mode: 0644]
TC/elementary/textpath/tslist_wear [new file with mode: 0644]
TC/elementary/textpath/utc_elm_textpath_circle_set.c [new file with mode: 0644]
TC/elementary/textpath/utc_elm_textpath_ellipsis_get_set.c [new file with mode: 0644]
TC/tet_scen

diff --git a/TC/elementary/textpath/Makefile b/TC/elementary/textpath/Makefile
new file mode 100644 (file)
index 0000000..45610e7
--- /dev/null
@@ -0,0 +1,21 @@
+CC ?= gcc
+
+C_FILES = $(shell cat tslist)
+
+PKGS = elementary check
+
+LDFLAGS = `pkg-config --libs $(PKGS)`
+
+CFLAGS = -I. `pkg-config --cflags $(PKGS)`
+CFLAGS += -Wall
+
+#TARGETS = $(C_FILES:%.c=tc-%)
+TCS := $(shell cat tslist | cut -d. -f1)
+
+all: $(TCS)
+
+%: %.c
+       $(CC) -c $< $(CFLAGS) $(LDFLAGS)
+
+clean:
+       rm -f $(TCS)
diff --git a/TC/elementary/textpath/tslist b/TC/elementary/textpath/tslist
new file mode 100644 (file)
index 0000000..40da30e
--- /dev/null
@@ -0,0 +1,2 @@
+utc_elm_textpath_circle_set.c
+utc_elm_textpath_ellipsis_get_set.c
diff --git a/TC/elementary/textpath/tslist_fhub b/TC/elementary/textpath/tslist_fhub
new file mode 100644 (file)
index 0000000..40da30e
--- /dev/null
@@ -0,0 +1,2 @@
+utc_elm_textpath_circle_set.c
+utc_elm_textpath_ellipsis_get_set.c
diff --git a/TC/elementary/textpath/tslist_mobile b/TC/elementary/textpath/tslist_mobile
new file mode 100644 (file)
index 0000000..40da30e
--- /dev/null
@@ -0,0 +1,2 @@
+utc_elm_textpath_circle_set.c
+utc_elm_textpath_ellipsis_get_set.c
diff --git a/TC/elementary/textpath/tslist_tv b/TC/elementary/textpath/tslist_tv
new file mode 100644 (file)
index 0000000..40da30e
--- /dev/null
@@ -0,0 +1,2 @@
+utc_elm_textpath_circle_set.c
+utc_elm_textpath_ellipsis_get_set.c
diff --git a/TC/elementary/textpath/tslist_wear b/TC/elementary/textpath/tslist_wear
new file mode 100644 (file)
index 0000000..40da30e
--- /dev/null
@@ -0,0 +1,2 @@
+utc_elm_textpath_circle_set.c
+utc_elm_textpath_ellipsis_get_set.c
diff --git a/TC/elementary/textpath/utc_elm_textpath_circle_set.c b/TC/elementary/textpath/utc_elm_textpath_circle_set.c
new file mode 100644 (file)
index 0000000..be0271a
--- /dev/null
@@ -0,0 +1,169 @@
+#include <check.h>
+#include <Elementary.h>
+#include "../utc_elm_common.h"
+#include "../../utc_negative_unitest.h"
+
+static Evas_Object *main_win = NULL, *textpath = NULL;
+
+/**
+ * @addtogroup elm_textpath
+ * @{
+ * @defgroup elm_textpath_circle_set elm_textpath_circle_set()
+ *
+ * @precondition
+ * @step 1 Initialize Elementary
+ * @step 2 Create and show main window
+ * @step 3 Add a textpath to the main window
+ */
+
+static void
+setup(void)
+{
+   printf(" ============ Startup ============ \n");
+   UTC_ELM_INIT();
+   main_win = elm_win_add(NULL, "main", ELM_WIN_BASIC);
+   if (main_win == NULL)
+     {
+        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Unable to create a main window..", __FILE__, __LINE__);
+     }
+   evas_object_show(main_win);
+   textpath = elm_textpath_add(main_win);
+   if (textpath == NULL)
+     {
+        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Unable to add a textpath widget to the main window..", __FILE__, __LINE__);
+     }
+}
+
+static void
+teardown(void)
+{
+   if (main_win != NULL)
+     {
+        evas_object_del(main_win);
+        main_win = NULL;
+     }
+   elm_shutdown();
+   printf(" ============ Cleanup ============ \n");
+}
+
+/**
+ * @addtogroup elm_textpath_circle_set
+ * @{
+ * @objective Positive Test case checks if function call with valid values
+ * works properly and without segmentation fault
+ * @n Input Data:
+ * @li the textpath object
+ * @li X coordinate of center
+ * @li Y coordinate of center
+ * @li Radius of the circle
+ * @li Start angle of the circle
+ * @li Direction of text
+ *
+ * @procedure
+ * @step 1 Set the values to the textpath object
+ * @step 2 Resize, move and show the textpath object
+ * @step 3 Set another values to the textpath object
+ * @step 4 Resize and move the textpath object
+ *
+ * @passcondition
+ * @li Test passes if there is no segmentation fault
+ * @}
+ */
+START_TEST(utc_elm_textpath_circle_set_p)
+{
+   double x = 100.0;
+   double y = 100.0;
+   double radius = 50.0;
+   double start_angle = 30.0;
+   Efl_Ui_Textpath_Direction direction = EFL_UI_TEXTPATH_DIRECTION_CW;
+
+   elm_textpath_circle_set(textpath, x, y, radius, start_angle, direction);
+   evas_object_resize(textpath, 100, 100);
+   evas_object_move(textpath, 50, 50);
+   evas_object_show(textpath);
+
+   x = 50.0;
+   y = 150.0;
+   radius = 30.0;
+   start_angle = 210.0;
+   direction = EFL_UI_TEXTPATH_DIRECTION_CCW;
+   elm_textpath_circle_set(textpath, x, y, radius, start_angle, direction);
+   evas_object_resize(textpath, 70, 100);
+   evas_object_move(textpath, 30, 70);
+
+   printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
+}
+END_TEST
+
+/**
+ * @addtogroup elm_textpath_circle_set
+ * @{
+ * @objective Negative Test case checks if function call with invalid value
+ * works properly and without segmentation fault
+ * @n Input Data:
+ * @li NULL instead of the textpath object
+ * @li X coordinate of center
+ * @li Y coordinate of center
+ * @li Radius of the circle
+ * @li Start angle of the circle
+ * @li Direction of text
+ *
+ * @procedure
+ * @step 1 Call elm_textpath_circle_set with invalid value instead of the textpath object
+ *
+ * @passcondition
+ * @li There is no segmentation fault
+ * @}
+ */
+START_TEST(utc_elm_textpath_circle_set_n)
+{
+   double x = 100.0;
+   double y = 100.0;
+   double radius = 50.0;
+   double start_angle = 30.0;
+   Efl_Ui_Textpath_Direction direction = EFL_UI_TEXTPATH_DIRECTION_CW;
+
+   elm_textpath_circle_set(NULL, x, y, radius, start_angle, direction);
+   printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
+}
+END_TEST
+
+/**
+ * @addtogroup elm_textpath_add
+ * @{
+ * @objective Negative Test case checks if function call with invalid value to add a new textpath widget
+ * to the parent's canvas works properly and without segmentation fault
+ * @n Input Data:
+ * @li NULL instead of the window object
+ *
+ * @procedure
+ * @step 1 Call elm_textpath_add with invalid value instead of the window object
+ *
+ * @passcondition
+ * @li Test passes if returned value is NULL and there is no segmentation fault
+ * @}
+ */
+START_TEST(utc_elm_textpath_add_n)
+{
+   if (TEST_FAIL == UNITEST_FUNC_NEG_RET(NULL, elm_textpath_add, main_win))
+     {
+        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
+     }
+   printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__,__LINE__);
+}
+END_TEST
+
+/**
+ *@}
+ */
+
+TCase * _utc_elm_textpath_circle_set()
+{
+   TCase *tcase = tcase_create("utc_elm_textpath_circle_set");
+   tcase_set_timeout(tcase, 30);
+   tcase_add_checked_fixture(tcase, setup, teardown);
+   tcase_add_test(tcase, utc_elm_textpath_circle_set_p);
+   tcase_add_test(tcase, utc_elm_textpath_circle_set_n);
+   tcase_add_test(tcase, utc_elm_textpath_add_n);
+   return tcase;
+}
diff --git a/TC/elementary/textpath/utc_elm_textpath_ellipsis_get_set.c b/TC/elementary/textpath/utc_elm_textpath_ellipsis_get_set.c
new file mode 100644 (file)
index 0000000..0c1155b
--- /dev/null
@@ -0,0 +1,118 @@
+#include <check.h>
+#include <Elementary.h>
+#include "../utc_elm_common.h"
+#include "../../utc_negative_unitest.h"
+
+static Evas_Object *main_win = NULL, *textpath = NULL;
+
+/**
+ * @addtogroup elm_textpath
+ * @{
+ * @defgroup elm_textpath_ellipsis_get elm_textpath_ellipsis_get()
+ *
+ * @precondition
+ * @step 1 Initialize Elementary
+ * @step 2 Create and show main window
+ * @step 3 Add a textpath to the main window
+ */
+
+static void
+setup(void)
+{
+   printf(" ============ Startup ============ \n");
+   UTC_ELM_INIT();
+   main_win = elm_win_add(NULL, "main", ELM_WIN_BASIC);
+   if (main_win == NULL)
+     {
+        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Unable to create a main window..", __FILE__, __LINE__);
+     }
+   evas_object_show(main_win);
+   textpath = elm_textpath_add(main_win);
+   if (textpath == NULL)
+     {
+        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Unable to add a textpath widget to the main window..", __FILE__, __LINE__);
+     }
+}
+
+static void
+teardown(void)
+{
+   if (main_win != NULL)
+     {
+        evas_object_del(main_win);
+        main_win = NULL;
+     }
+   elm_shutdown();
+   printf(" ============ Cleanup ============ \n");
+}
+
+/**
+ * @addtogroup elm_textpath_ellipsis_get
+ * @{
+ * @objective Positive Test case checks if function call with valid values
+ * works properly and without segmentation fault
+ * @n Input Data:
+ * @li the textpath object
+ *
+ * @procedure
+ * @step 1 Set the ellipsis of text
+ * @step 2 Call elm_textpath_ellipsis_get and check returned value
+ *
+ * @passcondition
+ * @li Test passes if returned value is same as it was before function call and there is no segmentation fault
+ * @}
+ */
+START_TEST(utc_elm_textpath_ellipsis_get_p)
+{
+   Eina_Bool ellipsis = EINA_FALSE;
+
+   elm_textpath_ellipsis_set(textpath, ellipsis);
+   if (elm_textpath_ellipsis_get(textpath) != EINA_FALSE) {
+      ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__,__LINE__);
+   }
+
+   printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
+}
+END_TEST
+
+/**
+ * @addtogroup elm_textpath_ellipsis_get
+ * @{
+ * @objective Negative Test case checks if function call with invalid value
+ * works properly and without segmentation fault
+ * @n Input Data:
+ * @li NULL instead of the textpath object
+ *
+ * @procedure
+ * @step 1 Call elm_textpath_ellipsis_set with invalid value instead of the textpath object
+ * @step 2 Call elm_textpath_ellipsis_get with invalid value instead of the textpath object
+ *
+ * @passcondition
+ * @li There is no segmentation fault
+ * @}
+ */
+START_TEST(utc_elm_textpath_ellipsis_get_n)
+{
+   elm_textpath_ellipsis_set(NULL, EINA_FALSE);
+
+   if (elm_textpath_ellipsis_get(NULL) == EINA_TRUE) {
+      ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__,__LINE__);
+   }
+
+   printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
+}
+END_TEST
+
+/**
+ *@}
+ */
+
+TCase * _utc_elm_textpath_ellipsis_get_set()
+{
+   TCase *tcase = tcase_create("utc_elm_textpath_ellipsis_get_set");
+   tcase_set_timeout(tcase, 30);
+   tcase_add_checked_fixture(tcase, setup, teardown);
+   tcase_add_test(tcase, utc_elm_textpath_ellipsis_get_p);
+   tcase_add_test(tcase, utc_elm_textpath_ellipsis_get_n);
+   return tcase;
+}
index b259eb64bb7f2a149df717021d72fac1ef712dbf..b877440cb9552bedf82fcefae81c729e821ec3c4 100644 (file)
@@ -287,6 +287,7 @@ ELEMENTARY-build
 /elementary/spinner/tslist
 #/elementary/store/tslist
 /elementary/table/tslist
+/elementary/textpath/tslist
 /elementary/theme/tslist
 #/elementary/thumb/tslist
 /elementary/toolbar/tslist
@@ -560,6 +561,7 @@ ELEMENTARY-mobile
 /elementary/spinner/tslist_mobile
 #/elementary/store/tslist_mobile
 /elementary/table/tslist_mobile
+/elementary/textpath/tslist_mobile
 /elementary/theme/tslist_mobile
 #/elementary/thumb/tslist_mobile
 /elementary/toolbar/tslist_mobile
@@ -831,6 +833,7 @@ ELEMENTARY-wear
 #/elementary/spinner/tslist_wear
 #/elementary/store/tslist_wear
 /elementary/table/tslist_wear
+/elementary/textpath/tslist_wear
 /elementary/theme/tslist_wear
 #/elementary/thumb/tslist_wear
 #/elementary/toolbar/tslist_wear
@@ -1102,6 +1105,7 @@ ELEMENTARY-tv
 /elementary/spinner/tslist_tv
 #/elementary/store/tslist_tv
 /elementary/table/tslist_tv
+/elementary/textpath/tslist_tv
 /elementary/theme/tslist_tv
 #/elementary/thumb/tslist_tv
 /elementary/toolbar/tslist_tv
@@ -1375,6 +1379,7 @@ ELEMENTARY-fhub
 /elementary/spinner/tslist_fhub
 #/elementary/store/tslist_fhub
 /elementary/table/tslist_fhub
+/elementary/textpath/tslist_fhub
 /elementary/theme/tslist_fhub
 #/elementary/thumb/tslist_fhub
 /elementary/toolbar/tslist_fhub