evas_vg_container_add: Remove children_get TC and add negative TC for _add() 05/234005/1
authorJunsuChoi <jsuya.choi@samsung.com>
Thu, 21 May 2020 04:54:59 +0000 (13:54 +0900)
committerJunsuChoi <jsuya.choi@samsung.com>
Thu, 21 May 2020 04:54:59 +0000 (13:54 +0900)
Change-Id: I58243f14b4cd7b34980146e90580877eaf422435

TC/evas/canvas/evas_vg/utc_evas_vg_container.c

index 4ade389e0f805e78cfeb0a9ab70246005fd1d551..e39fe14d197b4fcd5204d1adc1c177268fdb47ba 100644 (file)
@@ -97,90 +97,26 @@ START_TEST(utc_evas_vg_container_add_p)
 END_TEST
 
 /**
- * @addtogroup evas_vg_container
- * @{
- * @defgroup evas_vg_container_children_get evas_vg_container_children_get()
+ * @addtogroup evas_vg_container_add
  * @{
- * @objective Positive test case checks if functions gets the iterator for list child object from container object
- * and without segmentation fault.
- *
+ * @objective Negative Test case checks if calling function with invalid value won't cause segmentation fault
  * @n Input Data:
- * @li the vector container object
+ * @li NULL, evas_vg_container_add
  *
  * @procedure
- * @step 1 Call evas_object_vg_add function to create a new vector object
- * and check on not NULL
- * @step 2 Show vector object
- * @step 3 Call evas_object_vg_root_node_get function to get pointer on canvas root vector object
- * and check on not NULL
- * @step 4 Create a new vector container object and check on NULL
- * @step 5 Create a new vector rectangle object used container object how parent
- * @step 6 Set color {0, 0, 255, 255} to the rectangle object
- * @step 7 Get the iterator for list child object from container object
- * @step 8 Iterate over the list, and try to find rectangle object, if find check on expected color {0, 0, 255, 255}
+ * @step 1 Call testing function with NULL as a parent value
  *
- * @passcondition Function should get expected the iterator for list child object from container object and without segmentation fault.
- * @}
+ * @passcondition There is no segmentation fault
  * @}
  */
-START_TEST(utc_evas_vg_container_children_get_p)
-{
-   Evas_Object *vg = evas_object_vg_add(ecore_evas_get(ee));
-   if (!vg)
-     {
-        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed", __FILE__, __LINE__);
-     }
-   evas_object_resize(vg, WIDTH, HEIGHT);
-   evas_object_show(vg);
-   evas_object_vg_root_node_set(vg, evas_vg_container_add(vg));
-   Efl_VG *root = evas_object_vg_root_node_get(vg);
-   if (!root)
-     {
-        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed", __FILE__, __LINE__);
-     }
 
-   Efl_VG *container = evas_vg_container_add(root);
-   if (!container)
-     {
-        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed", __FILE__, __LINE__);
-     }
-
-   Efl_VG *child = evas_vg_shape_add(container);
-   if (!child)
-     {
-        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed", __FILE__, __LINE__);
-     }
-
-   evas_vg_shape_append_rect(child, 20, 20, 300, 300, 0, 0);
-   evas_vg_node_color_set(child, 0, 0, 255, 255);
-   evas_vg_shape_stroke_color_set(child, 128, 10,10, 128);
-   evas_vg_shape_stroke_width_set(child, 4.0);
-
-   Eina_Iterator *iterator = evas_vg_container_children_get(container);
-   if (!iterator)
-     {
-        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed", __FILE__, __LINE__);
-     }
-
-   Eina_Bool is_find = EINA_FALSE;
-   Efl_VG *child_object;
-   EINA_ITERATOR_FOREACH(iterator, child_object)
-     {
-        if (child_object == child)
-          {
-             int r, g, b, a;
-             evas_vg_node_color_get(child_object, &r, &g, &b, &a);
-             if (r == 0 && g == 0 && b == 255 && a == 255)
-               {
-                  is_find = EINA_TRUE;
-               }
-          }
-     }
-
-   eina_iterator_free(iterator);
-   if (!is_find)
+START_TEST(utc_evas_vg_container_add_n)
+{
+   Evas_Object *line = evas_vg_container_add(NULL);
+   if (line)
      {
         ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed", __FILE__, __LINE__);
+        return;
      }
 
    printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
@@ -197,6 +133,6 @@ TCase * _utc_evas_vg_container()
    tcase_set_timeout(tcase, 30);
    tcase_add_checked_fixture(tcase, setup, teardown);
    tcase_add_test(tcase, utc_evas_vg_container_add_p);
-   tcase_add_test(tcase, utc_evas_vg_container_children_get_p);
+   tcase_add_test(tcase, utc_evas_vg_container_add_n);
    return tcase;
 }