elm_object: Add elm_object_scroll_back_to_top_enabled_get_set TC 15/229915/1
authorJaehyun Cho <jae_hyun.cho@samsung.com>
Mon, 6 Apr 2020 08:14:58 +0000 (17:14 +0900)
committerJaehyun Cho <jae_hyun.cho@samsung.com>
Mon, 6 Apr 2020 10:55:20 +0000 (19:55 +0900)
Related to https://code.sec.samsung.net/jira/browse/ACR-1507

Change-Id: I13afe59cf1a210767e459038cafaa509f5f135b4

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

index db32555f2f8fcced757c7bb6b37f2b6fa7db93f9..698fd71cb16cada928bd9de6d7d21b9747a28b55 100644 (file)
@@ -94,3 +94,4 @@ utc_elm_object_item_color_class_color3_get_set.c
 utc_elm_object_item_color_class_del.c
 utc_elm_object_item_color_class_clear.c
 utc_elm_access_object.c
+utc_elm_object_scroll_back_to_top_enabled_get_set.c
index 2c1f9e086d28f125f2e1bf44e8a6c35f37a642c0..78b7ea3b8e832260aa5274281e33fdfc49410293 100644 (file)
@@ -94,3 +94,4 @@ utc_elm_object_item_color_class_color3_get_set.c
 utc_elm_object_item_color_class_del.c
 utc_elm_object_item_color_class_clear.c
 utc_elm_access_object.c
+#utc_elm_object_scroll_back_to_top_enabled_get_set.c
index 303d08e8e02970aa6a208d178dc0a29a34874f90..f6ed78c834a91183a3cbe67ae81c974dc198a0cd 100644 (file)
@@ -94,3 +94,4 @@ utc_elm_object_item_color_class_color3_get_set.c
 utc_elm_object_item_color_class_del.c
 utc_elm_object_item_color_class_clear.c
 utc_elm_access_object.c
+utc_elm_object_scroll_back_to_top_enabled_get_set.c
index d695f37fdccb0c9b8a1f4d656a76e62ec5726393..00796a296d5d305fda5f6837d167b3898c649922 100644 (file)
@@ -94,3 +94,4 @@ utc_elm_object_item_color_class_color3_get_set.c
 utc_elm_object_item_color_class_del.c
 utc_elm_object_item_color_class_clear.c
 utc_elm_access_object.c
+#utc_elm_object_scroll_back_to_top_enabled_get_set.c
index 7d730be654fe65d1c3e77b2fa738a2afc0f8c0c4..5e592f9cf4a9ceb2b6e78f3d099eaf8af3c0a6c5 100644 (file)
@@ -94,3 +94,4 @@ utc_elm_object_item_color_class_color3_get_set.c
 utc_elm_object_item_color_class_del.c
 utc_elm_object_item_color_class_clear.c
 utc_elm_access_object.c
+utc_elm_object_scroll_back_to_top_enabled_get_set.c
diff --git a/TC/elementary/elm_object/utc_elm_object_scroll_back_to_top_enabled_get_set.c b/TC/elementary/elm_object/utc_elm_object_scroll_back_to_top_enabled_get_set.c
new file mode 100644 (file)
index 0000000..665867c
--- /dev/null
@@ -0,0 +1,143 @@
+#include <check.h>
+#include <Elementary.h>
+#include "../utc_elm_common.h"
+
+
+/**
+* @addtogroup elm_object
+* @{
+* @defgroup elm_object_scroll_back_to_top_enabled_set elm_object_scroll_back_to_top_enabled_set()
+*
+* @precondition
+* @step 1 elm initialized with elm_init()
+* @step 2 a window object created and showed
+*/
+static void
+setup(void)
+{
+   printf (" ============ Startup ============ \n");
+   UTC_ELM_INIT();
+
+}
+
+static void
+teardown(void)
+{
+   elm_shutdown ();
+   printf (" ============ Cleanup ============ \n");
+}
+
+/**
+ * @addtogroup elm_object_scroll_back_to_top_enabled_set
+ * @{
+ * @objective Positive test case 01: Enable the back to top button of the given scrollable widget.
+ * @n Input data:
+ * @li the elementary scrollable object.
+ * @li EINA_TRUE/EINA_FALSE to enable/disable the back to top button.
+ *
+ * @procedure
+ * @step 1 Create a window object with text label and scroller.
+ * @step 2 Enable the back to top button of the scroller.
+ * @step 3 Get the state of the back to top button and compare it with EINA_TRUE (enabled back to top button).
+ * @step 4 Disable the back to top button of the scroller.
+ * @step 5 Get the state of the back to top button and compare it with EINA_FALSE (disabled back to top button).
+ *
+ * @passcondition: Get the state of the back to top button and compare it.
+ * @}
+ */
+START_TEST(utc_elm_object_scroll_back_to_top_enabled_set_p)
+{
+   const char *text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse bibendum,\
+         Vestibulum laoreet, leo ut sollicitudin viverra, odio enim tempor est, at ullamcorper augue massa sit ametlacus.\
+         Etiam dignissim libero sed velit rhoncus ultricies. Aenean porta erat sit amet orci auctor auctor. Suspendisse \
+         Phasellus risus sem, scelerisque sed vestibulum a, aliquam at sem. Sed venenatis tristique nisi id eleifend.";
+
+   Evas_Object *label = NULL;
+   Evas_Object *scroller = NULL;
+   Evas_Object *main_win;
+   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);
+   label = elm_label_add(main_win);
+   elm_object_text_set(label, text);
+   scroller = elm_scroller_add(main_win);
+
+   elm_object_scroll_back_to_top_enabled_set(scroller, EINA_TRUE);
+   if (elm_object_scroll_back_to_top_enabled_get(scroller))
+     {
+        elm_object_scroll_back_to_top_enabled_set(scroller, EINA_FALSE);
+        if (!elm_object_scroll_back_to_top_enabled_get(scroller))
+          {
+             printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
+             evas_object_del (main_win);
+             return;
+          }
+     }
+   evas_object_del (main_win);
+   ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
+}
+END_TEST
+
+/**
+ * @addtogroup elm_object_scroll_back_to_top_enabled_get
+ * @{
+ * @objective Negative test case 01: Get the state of the back to top button of a NULL Elementary scrollable object.
+ * @n Input Data:
+ * @li NULL as the elementary scrollable object.
+ *
+ * @procedure
+ * @step 1 Try to get the state of the back to top button of a NULL elementary scrollable object.
+ *
+ * @passcondition: Test passes if EINA_FALSE is returned and no segmentation fault.
+ * @}
+ */
+START_TEST(utc_elm_object_scroll_back_to_top_enabled_get_n)
+{
+   if (elm_object_scroll_back_to_top_enabled_get(NULL))
+     {
+        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_object_scroll_back_to_top_enabled_set
+ * @{
+ * @objective Negative test case 01: Try to enable the back to top button of a NULL elementary scrollable object.
+ * @n Input data:
+ * @li NULL as the elementary scrollable object;
+ * @li EINA_TRUE to enable the back to top button.
+ *
+ * @procedure
+ * @step 1 Try to enable the back to top button by passing a NULL elementary scrollable object.
+ *
+ * @passcondition: Return type of this API is void. Test passes if API completes successfully.
+ * @}
+ */
+START_TEST(utc_elm_object_scroll_back_to_top_enabled_set_n)
+{
+   elm_object_scroll_back_to_top_enabled_set(NULL, EINA_TRUE);
+
+   printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
+}
+END_TEST
+
+/**
+* @}
+*/
+
+TCase * _utc_elm_object_scroll_back_to_top_enabled_get_set()
+{
+   TCase *tcase = tcase_create("utc_elm_object_scroll_back_to_top_enabled_get_set");
+   tcase_set_timeout(tcase, 30);
+   tcase_add_checked_fixture(tcase, setup, teardown);
+   tcase_add_test(tcase, utc_elm_object_scroll_back_to_top_enabled_set_p);
+   tcase_add_test(tcase, utc_elm_object_scroll_back_to_top_enabled_set_n);
+   tcase_add_test(tcase, utc_elm_object_scroll_back_to_top_enabled_get_n);
+   return tcase;
+}