elm_popup: add elm_popup_scrollable_set/get api tcs 41/235941/1 tizen_4.0
authorTaehyub Kim <taehyub.kim@samsung.com>
Thu, 11 Jun 2020 06:42:54 +0000 (15:42 +0900)
committerTaehyub Kim <taehyub.kim@samsung.com>
Thu, 11 Jun 2020 06:45:46 +0000 (15:45 +0900)
Change-Id: Icad423e1108135149105a5487208a871891bad64

TC/elementary/popup/tslist
TC/elementary/popup/tslist_fhub
TC/elementary/popup/tslist_mobile
TC/elementary/popup/tslist_tv
TC/elementary/popup/tslist_wear
TC/elementary/popup/utc_elm_popup_scrollable_get_set.c [new file with mode: 0644]

index 2d49d7584adcbd1d34ae442fcdd55aee381317c4..ff6a9371e1ec7a88c63214c4e801bc8a215b4854 100644 (file)
@@ -11,3 +11,4 @@ utc_elm_popup_timeout_set.c
 utc_elm_popup_align_get.c
 utc_elm_popup_align_set.c
 utc_elm_popup_dismiss.c
+utc_elm_popup_scrollable_get_set.c
index 2d49d7584adcbd1d34ae442fcdd55aee381317c4..ff6a9371e1ec7a88c63214c4e801bc8a215b4854 100644 (file)
@@ -11,3 +11,4 @@ utc_elm_popup_timeout_set.c
 utc_elm_popup_align_get.c
 utc_elm_popup_align_set.c
 utc_elm_popup_dismiss.c
+utc_elm_popup_scrollable_get_set.c
index 2d49d7584adcbd1d34ae442fcdd55aee381317c4..ff6a9371e1ec7a88c63214c4e801bc8a215b4854 100644 (file)
@@ -11,3 +11,4 @@ utc_elm_popup_timeout_set.c
 utc_elm_popup_align_get.c
 utc_elm_popup_align_set.c
 utc_elm_popup_dismiss.c
+utc_elm_popup_scrollable_get_set.c
index 30f9ee440517e2ca0510ea98a74777d18a74222b..65bb3dc379ad9539c91573d715844fca3134ee33 100644 (file)
@@ -11,3 +11,4 @@ utc_elm_popup_timeout_set.c
 utc_elm_popup_align_get.c
 utc_elm_popup_align_set.c
 #utc_elm_popup_dismiss.c
+utc_elm_popup_scrollable_get_set.c
index 2d49d7584adcbd1d34ae442fcdd55aee381317c4..ff6a9371e1ec7a88c63214c4e801bc8a215b4854 100644 (file)
@@ -11,3 +11,4 @@ utc_elm_popup_timeout_set.c
 utc_elm_popup_align_get.c
 utc_elm_popup_align_set.c
 utc_elm_popup_dismiss.c
+utc_elm_popup_scrollable_get_set.c
diff --git a/TC/elementary/popup/utc_elm_popup_scrollable_get_set.c b/TC/elementary/popup/utc_elm_popup_scrollable_get_set.c
new file mode 100644 (file)
index 0000000..0d70c8e
--- /dev/null
@@ -0,0 +1,153 @@
+#include <check.h>
+#include <Elementary.h>
+#include "../../utc_negative_unitest.h"
+Evas_Object *main_win = NULL, *popup = NULL;
+
+/**
+ * @addtogroup elm_popup
+ * @{
+ * @defgroup elm_popup_scrollable_set elm_popup_scrollable_set()
+ *
+ * @precondition
+ * @step 1 Initialize Elementary
+ * @step 2 Create and show main window
+ * @step 3 Add a popup to the main window
+ */
+
+static void
+setup(void)
+{
+   printf(" ============ Startup ============ \n");
+   elm_init(0, NULL);
+   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__);
+        return;
+     }
+   evas_object_show(main_win);
+   popup = elm_popup_add(main_win);
+   if (popup == NULL)
+     {
+        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Unable to add a box to the main window..", __FILE__, __LINE__);
+        return;
+     }
+}
+
+static void
+teardown(void)
+{
+   if (main_win != NULL)
+     {
+        evas_object_del(main_win);
+        main_win = NULL;
+     }
+   elm_shutdown();
+   printf(" ============ Cleanup ============ \n");
+}
+
+/**
+ * @addtogroup elm_popup_scrollable_set
+ * @{
+ * @objective Positive Test case p_1 checks if function call with valid values to set the scroller
+ * of the popup object works properly and without segmentation fault
+ * @n Input Data:
+ * @li the popup object
+ * @li the scroller value
+ *
+ * @procedure
+ * @step 1 Call elm_popup_scrollable_set with valid values
+ * @step 2 Get the scroll value of the popup object
+ *
+ * @passcondition Test passes if returned value is same as specified value and there is no segmentation fault
+ * @}
+ */
+
+START_TEST(utc_elm_popup_scrollable_get_set_p_1)
+{
+   if (main_win == NULL || popup == NULL)
+     {
+        return;
+     }
+
+   elm_popup_scrollable_set(popup, EINA_TRUE);
+   Eina_Bool ret = elm_popup_scrollable_get(popup);
+   if (!ret)
+     {
+        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
+        return;
+     }
+   printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
+}
+END_TEST
+
+/**
+ * @addtogroup elm_popup_scrollable_set
+ * @{
+ * @objective Negative Test case n_1 checks if function call with invalid value to get the scroller
+ * of the popup object works properly and without segmentation fault
+ * @n Input Data:
+ * @li NULL instead of the popup object
+ *
+ * @procedure
+ * @step 1 Call elm_popup_scrollable_get_set with invalid value instead of the popup object
+ *
+ * @passcondition Test passes if there is no segmentation fault
+ * @}
+ */
+
+START_TEST(utc_elm_popup_scrollable_get_n_1)
+{
+   if (main_win == NULL || popup == NULL)
+     {
+        return;
+     }
+
+   Eina_Bool ret = elm_popup_scrollable_get(NULL);
+   if (ret)
+     {
+        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
+        return;
+     }
+   printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
+}
+END_TEST
+
+/**
+ * @addtogroup elm_popup_scrollable_set
+ * @{
+ * @objective Negative Test case n_1 checks if function call with invalid value to set the scroller
+ * of the popup object works properly and without segmentation fault
+ * @n Input Data:
+ * @li NULL instead of the popup object
+ *
+ * @procedure
+ * @step 1 Call elm_popup_scrollable_set with invalid value instead of the popup object
+ *
+ * @passcondition Test passes if there is no segmentation fault
+ * @}
+ */
+
+START_TEST(utc_elm_popup_scrollable_set_n_1)
+{
+   if (main_win == NULL || popup == NULL)
+     {
+        return;
+     }
+
+   elm_popup_scrollable_set(NULL, EINA_TRUE);
+   printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
+}
+END_TEST
+
+
+TCase * _utc_elm_popup_scrollable_get_set()
+{
+   TCase *tcase = tcase_create("utc_elm_popup_scrollable_get_set");
+   tcase_set_timeout(tcase, 30);
+   tcase_add_checked_fixture(tcase, setup, teardown);
+   tcase_add_test(tcase, utc_elm_popup_scrollable_get_set_p_1);
+   tcase_add_test(tcase, utc_elm_popup_scrollable_get_n_1);
+   tcase_add_test(tcase, utc_elm_popup_scrollable_set_n_1);
+   return tcase;
+}