--- /dev/null
+#include <Evas.h>\r
+#include <Ecore.h>\r
+#include <Ecore_Evas.h>\r
+#include <Eina.h>\r
+\r
+#include <check.h>\r
+\r
+#include <math.h>\r
+#include <float.h>\r
+\r
+#define WIDTH 800\r
+#define HEIGHT 600\r
+\r
+static Ecore_Evas *ee = NULL;\r
+\r
+/**\r
+ * @addtogroup evas_vg\r
+ * @{\r
+ * @defgroup evas_vg_shape\r
+ *\r
+ *\r
+ * @precondition\r
+ * @step 1 Initialize ecore-evas with ecore_evas_init()\r
+ * @step 2 Create a new Ecore_Evas and show\r
+ */\r
+static void\r
+setup(void)\r
+{\r
+ printf(" ============ Startup ============ \n");\r
+ ecore_evas_init();\r
+ ee = ecore_evas_new(NULL, 0, 0, WIDTH, HEIGHT, NULL);\r
+ if (!ee)\r
+ {\r
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed", __FILE__, __LINE__);\r
+ }\r
+ ecore_evas_show(ee);\r
+}\r
+\r
+static void\r
+teardown(void)\r
+{\r
+ printf(" ============ Cleanup ============ \n");\r
+ if (ee)\r
+ {\r
+ ecore_evas_free(ee);\r
+ }\r
+ ecore_evas_shutdown();\r
+}\r
+\r
+static void\r
+_draw_line(Efl_VG *line, Efl_VG *container)\r
+{\r
+ evas_vg_shape_append_move_to(line, 0, 0);\r
+ evas_vg_shape_append_line_to(line, 100, 100);\r
+ evas_vg_shape_stroke_color_set(line, 255, 0, 0, 255);\r
+ evas_vg_shape_stroke_width_set(line, 5);\r
+ evas_vg_node_origin_set(line, 50, 50);\r
+ evas_vg_node_color_set(line, 255, 255, 255, 255);\r
+}\r
+\r
+/**\r
+ * @addtogroup utc_vg_shape_stroke_cap\r
+ * @{\r
+ * @objective Positive test case checks if function sets/gets the cap style to be used for stroking the path\r
+ * and without segmentation fault.\r
+ *\r
+ * @n Input Data:\r
+ * @li the given canvas\r
+ *\r
+ * @procedure\r
+ * @step 1 Call evas_object_vg_add function to create a new vector object\r
+ * and check on not NULL\r
+ * @step 2 Show vector object\r
+ * @step 3 Call evas_vg_container_add function to create a new vector container object\r
+ * @step 4 Call evas_vg_shape_add function to create a new line object\r
+ * and check on not NULL.\r
+ * @step 5 Set the cap style EFL_GFX_CAP_ROUND for stroking the path\r
+ * @step 6 Get the cap style from stroking the path and check on EFL_GFX_CAP_ROUND\r
+ * @step 7 Set the cap style EFL_GFX_CAP_SQUARE for stroking the path\r
+ * @step 8 Get the cap style from stroking the path and check on EFL_GFX_CAP_SQUARE\r
+ *\r
+ * @passcondition Function should set/get the cap style to be used for stroking the path,\r
+ * and without segmentation fault.\r
+ * @}\r
+ * @}\r
+ */\r
+START_TEST(utc_evas_vg_shape_stroke_cap_set_get_p)\r
+{\r
+ Efl_VG *vg, *container, *line;\r
+\r
+ vg = evas_object_vg_add(ecore_evas_get(ee));\r
+ if (!vg)\r
+ {\r
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed", __FILE__, __LINE__);\r
+ return;\r
+ }\r
+\r
+ evas_object_resize(vg, WIDTH, HEIGHT);\r
+ evas_object_show(vg);\r
+\r
+ container = evas_vg_container_add(vg);\r
+ evas_object_vg_root_node_set(vg, container);\r
+\r
+ line = evas_vg_shape_add(container);\r
+ if (!line)\r
+ {\r
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed", __FILE__, __LINE__);\r
+ return;\r
+ }\r
+\r
+ _draw_line(line, container);\r
+\r
+ evas_vg_shape_stroke_cap_set(line, EFL_GFX_CAP_ROUND);\r
+ if (evas_vg_shape_stroke_cap_get(line) != EFL_GFX_CAP_ROUND)\r
+ {\r
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed", __FILE__, __LINE__);\r
+ return;\r
+ }\r
+\r
+ evas_vg_shape_stroke_cap_set(line, EFL_GFX_CAP_SQUARE);\r
+ if (evas_vg_shape_stroke_cap_get(line) != EFL_GFX_CAP_SQUARE)\r
+ {\r
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed", __FILE__, __LINE__);\r
+ return;\r
+ }\r
+\r
+ printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);\r
+}\r
+END_TEST\r
+\r
+/**\r
+ * @addtogroup utc_evas_vg_shape_stroke_cap\r
+ * @{\r
+ * @objective Negative Test case checks if calling function with invalid value won't cause segmentation fault\r
+ * @n Input Data:\r
+ * @li NULL, shape object value\r
+ *\r
+ * @procedure\r
+ * @step 1 Call testing function with NULL as a shape object value\r
+ *\r
+ * @passcondition There is no segmentation fault\r
+ * @}\r
+ */\r
+START_TEST(utc_evas_vg_shape_stroke_cap_set_get_n)\r
+{\r
+ evas_vg_shape_stroke_cap_set(NULL, EFL_GFX_CAP_SQUARE);\r
+ evas_vg_shape_stroke_cap_get(NULL);\r
+\r
+ printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);\r
+}\r
+END_TEST\r
+\r
+TCase * _utc_evas_vg_shape_stroke_cap_set_get()\r
+{\r
+ TCase *tcase = tcase_create("utc_evas_vg_shape_stroke_cap_set_get");\r
+ tcase_set_timeout(tcase, 30);\r
+ tcase_add_checked_fixture(tcase, setup, teardown);\r
+ tcase_add_test(tcase, utc_evas_vg_shape_stroke_cap_set_get_p);\r
+ tcase_add_test(tcase, utc_evas_vg_shape_stroke_cap_set_get_n);\r
+\r
+ return tcase;\r
+}\r