ACR: Add elm_atspi_component_highlight tests pack(2)
authorse.osadchy <se.osadchy@samsung.com>
Thu, 4 May 2017 09:14:29 +0000 (12:14 +0300)
committerse.osadchy <se.osadchy@samsung.com>
Thu, 4 May 2017 09:15:06 +0000 (12:15 +0300)
Change-Id: I3a3f1b9561414f71bcb6faa5222848ebe18e50a0
Signed-off-by: Sergey Osadchy <se.osadchy@samsung.com>
TC/elementary/atspi/tslist
TC/elementary/atspi/tslist_mobile
TC/elementary/atspi/tslist_tv
TC/elementary/atspi/tslist_wear
TC/elementary/atspi/utc_elm_atspi_component_highlight.c [new file with mode: 0644]

index 8b2c266788c1ae77a65d5cac5db82baf0a78af48..c57ca271807c687170b4aa35643321e9ec24340f 100644 (file)
@@ -11,3 +11,4 @@ utc_elm_atspi_accessible_translation_domain_set.c
 utc_elm_atspi_attributes.c
 utc_elm_atspi_bridge_connected_get.c
 utc_elm_atspi_relation.c
+utc_elm_atspi_component_highlight.c
index 8b2c266788c1ae77a65d5cac5db82baf0a78af48..c57ca271807c687170b4aa35643321e9ec24340f 100644 (file)
@@ -11,3 +11,4 @@ utc_elm_atspi_accessible_translation_domain_set.c
 utc_elm_atspi_attributes.c
 utc_elm_atspi_bridge_connected_get.c
 utc_elm_atspi_relation.c
+utc_elm_atspi_component_highlight.c
index c90183596eb9a36ab227fcb4c20b7c33d79047d2..63084f37c19927db5ce5caa7cdc1a65027700757 100644 (file)
@@ -11,3 +11,4 @@ utc_elm_atspi_accessible_translation_domain_set.c
 #utc_elm_atspi_attributes.c
 #utc_elm_atspi_bridge_connected_get.c
 #utc_elm_atspi_relation.c
+utc_elm_atspi_component_highlight.c
index 934efae1571315a61c23c4de6806f5cdd94ed32f..dd12e99debc37dd6b413984295b3d7d129dec1d4 100644 (file)
@@ -11,3 +11,4 @@ utc_elm_atspi_accessible_translation_domain_set.c
 #utc_elm_atspi_attributes.c
 #utc_elm_atspi_bridge_connected_get.c
 #utc_elm_atspi_relation.c
+utc_elm_atspi_component_highlight.c
diff --git a/TC/elementary/atspi/utc_elm_atspi_component_highlight.c b/TC/elementary/atspi/utc_elm_atspi_component_highlight.c
new file mode 100644 (file)
index 0000000..849000e
--- /dev/null
@@ -0,0 +1,120 @@
+#include <check.h>
+#define EFL_BETA_API_SUPPORT
+#include <Elementary.h>
+
+Evas_Object *main_win = NULL;
+
+/**
+ * @addtogroup elm_atspi
+ * @{
+ * @defgroup elm_atspi_component_highlight
+ * elm_atspi_component_highlight_grab
+ * elm_atspi_component_highlight_clear
+ *
+ * @precondition
+ * @step 1 Initialize Elementary
+ * @step 2 Create and show 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__);
+     }
+   evas_object_show(main_win);
+}
+
+static void
+teardown(void)
+{
+   if (main_win != NULL)
+     {
+        evas_object_del(main_win);
+        main_win = NULL;
+     }
+
+   elm_shutdown();
+   printf(" ============ Cleanup ============ \n");
+}
+
+/**
+ * @addtogroup elm_atspi_component_highlight
+ * @{
+ * @objective Positive test case check work of functions without errors
+ *
+ * @n Input Data:
+ * @li pointer to object.
+ *
+ * @procedure
+ * @step 1 Create button widget
+ * @step 2 Call elm_atspi_component_highlight_grab()
+ * @step 3 Call elm_atspi_component_highlight_clear()
+ * @step 4 Check results
+ *
+ * @passcondition : Functions worked and no segmentation fault
+ * @}
+ */
+START_TEST(utc_elm_atspi_component_highlight_p)
+{
+   Evas_Object *btn = NULL;
+   Eina_Bool clear = EINA_FALSE;
+   Eina_Bool grab = EINA_FALSE;
+
+   btn = elm_button_add(main_win);
+
+   grab = elm_atspi_component_highlight_grab(btn);
+   clear = elm_atspi_component_highlight_clear(btn);
+
+   /*TODO: Uncomment when will be possible to check
+   if (!clear)
+     {
+        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__,__LINE__);
+     }
+   if (!grab)
+     {
+        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
+
+/**
+ *@}
+ */
+Suite *
+test_suite(void)
+{
+   Suite *suite = suite_create("utc_elm_atspi_component_highlight");
+
+   TCase *tcase = tcase_create("TCase");
+   tcase_set_timeout(tcase, 30);
+   tcase_add_checked_fixture(tcase, setup, teardown);
+   tcase_add_test(tcase, utc_elm_atspi_component_highlight_p);
+   suite_add_tcase(suite, tcase);
+
+   return suite;
+}
+
+int
+main()
+{
+   int number_failed;
+
+   Suite *suite = test_suite();
+   SRunner *srunner = srunner_create(suite);
+   srunner_set_log(srunner, "utc_elm_atspi_component_highlight.log");
+   srunner_set_xml(srunner, "utc_elm_atspi_component_highlight.xml");
+   srunner_run_all(srunner, CK_NORMAL);
+   number_failed = srunner_ntests_failed(srunner);
+   srunner_free(srunner);
+
+   return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
+}