evas_vg: Add TC for evas_vg_gradient_linear_add 08/233408/4
authorApurv Khatri <apurv.khatri@samsung.com>
Thu, 14 May 2020 10:00:34 +0000 (15:30 +0530)
committerJunsuChoi <jsuya.choi@samsung.com>
Wed, 20 May 2020 11:59:10 +0000 (20:59 +0900)
Change-Id: Ie4bacb7cc584d52aca98f7c10cd0641e5bde8eb5

TC/evas/canvas/evas_vg/tslist
TC/evas/canvas/evas_vg/tslist_mobile
TC/evas/canvas/evas_vg/utc_evas_vg_gradient_linear_add.c [new file with mode: 0644]

index 3dceac9ff70d0db1cfe96cd7d2986e9ae63217fd..35d3b872606e4e99e9973195837abf4cb37fefd2 100755 (executable)
@@ -40,3 +40,4 @@ utc_evas_vg_gradient_radial_focal_get_set.c
 utc_evas_vg_gradient_radial_center_get_set.c
 utc_evas_vg_gradient_radial_add.c
 utc_evas_vg_shape_append_cubic_to.c
+utc_evas_vg_gradient_linear_add.c
index 3dceac9ff70d0db1cfe96cd7d2986e9ae63217fd..35d3b872606e4e99e9973195837abf4cb37fefd2 100755 (executable)
@@ -40,3 +40,4 @@ utc_evas_vg_gradient_radial_focal_get_set.c
 utc_evas_vg_gradient_radial_center_get_set.c
 utc_evas_vg_gradient_radial_add.c
 utc_evas_vg_shape_append_cubic_to.c
+utc_evas_vg_gradient_linear_add.c
diff --git a/TC/evas/canvas/evas_vg/utc_evas_vg_gradient_linear_add.c b/TC/evas/canvas/evas_vg/utc_evas_vg_gradient_linear_add.c
new file mode 100644 (file)
index 0000000..2ebb5a8
--- /dev/null
@@ -0,0 +1,112 @@
+#include <check.h>
+
+#define WIDTH 800
+#define HEIGHT 600
+
+#include <Evas.h>
+#include <Ecore.h>
+#include <Ecore_Evas.h>
+#include <Eina.h>
+
+#include <math.h>
+#include <float.h>
+
+static Ecore_Evas *ee = NULL;
+
+/**
+ * @addtogroup evas_vg
+ * @{
+ * @defgroup evas_vg_gradient
+ *
+ *
+ * @precondition
+ * @step 1 Initialize ecore-evas with ecore_evas_init()
+ * @step 2 Create a new Ecore_Evas and show
+ */
+static void
+setup(void)
+{
+   printf(" ============ Startup ============ \n");
+   ecore_evas_init();
+   ee = ecore_evas_new(NULL, 0, 0, WIDTH, HEIGHT, NULL);
+   if (!ee)
+     {
+        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed", __FILE__, __LINE__);
+        return;
+     }
+   ecore_evas_show(ee);
+}
+
+static void
+teardown(void)
+{
+   printf(" ============ Cleanup ============ \n");
+   if (ee)
+     {
+        ecore_evas_free(ee);
+     }
+   ecore_evas_shutdown();
+}
+
+/**
+ * @addtogroup evas_vg_gradient
+ * @{
+ * @defgroup evas_vg_gradient_liner
+ * @{
+ * @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 gradient liner object
+ * @}
+ */
+START_TEST(utc_evas_vg_gradient_linear_add_p)
+{
+   Efl_VG *root, *liner_gradient;
+
+   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__);
+        return;
+     }
+   evas_object_resize(vg, WIDTH, HEIGHT);
+   evas_object_show(vg);
+   evas_object_vg_root_node_set(vg, evas_vg_container_add(vg));
+   root = evas_object_vg_root_node_get(vg);
+   if (!root)
+     {
+        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed", __FILE__, __LINE__);
+        return;
+     }
+   liner_gradient = evas_vg_gradient_linear_add(root);
+
+   if (!liner_gradient)
+     {
+        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
+
+START_TEST(utc_evas_vg_gradient_linear_add_n)
+{
+   evas_vg_gradient_linear_add(NULL);
+
+   printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
+}
+END_TEST
+
+TCase * _utc_evas_vg_gradient_linear_add()
+{
+   TCase *tcase = tcase_create("utc_evas_vg_gradient_linear_add");
+   tcase_set_timeout(tcase, 30);
+   tcase_add_checked_fixture(tcase, setup, teardown);
+   tcase_add_test(tcase, utc_evas_vg_gradient_linear_add_p);
+   tcase_add_test(tcase, utc_evas_vg_gradient_linear_add_n);
+   return tcase;
+}