ethumb: Merge TCs to reduce duplicate test operations 50/192050/2
authorApurv Khatri <apurv.khatri@samsung.com>
Mon, 29 Oct 2018 08:04:13 +0000 (13:34 +0530)
committerHermet Park <chuneon.park@samsung.com>
Mon, 5 Nov 2018 05:41:02 +0000 (05:41 +0000)
Change-Id: I1f743569f5c8dd4fa7dc8ae922b9bb315b52c97a

14 files changed:
TC/ethumb/ethumb/tslist
TC/ethumb/ethumb/tslist_fhub
TC/ethumb/ethumb/tslist_mobile
TC/ethumb/ethumb/tslist_tv
TC/ethumb/ethumb/tslist_wear
TC/ethumb/ethumb/utc_ethumb_document_page_get.c [deleted file]
TC/ethumb/ethumb/utc_ethumb_document_page_get_set.c [new file with mode: 0644]
TC/ethumb/ethumb/utc_ethumb_document_page_set.c [deleted file]
TC/ethumb/ethumb/utc_ethumb_thumb_format_get.c [deleted file]
TC/ethumb/ethumb/utc_ethumb_thumb_format_get_set.c [new file with mode: 0644]
TC/ethumb/ethumb/utc_ethumb_thumb_format_set.c [deleted file]
TC/ethumb/ethumb/utc_ethumb_thumb_path_get.c [deleted file]
TC/ethumb/ethumb/utc_ethumb_thumb_path_get_set.c [new file with mode: 0644]
TC/ethumb/ethumb/utc_ethumb_thumb_path_set.c [deleted file]

index 1c445256a1e71799934a759d4c6b0514f322b525..6723a9087d8bd695306e543d2409b79b44673b90 100644 (file)
@@ -2,8 +2,7 @@ utc_ethumb_init.c
 utc_ethumb_shutdown.c
 utc_ethumb_new.c
 utc_ethumb_free.c
-utc_ethumb_document_page_set.c
-utc_ethumb_document_page_get.c
+utc_ethumb_document_page_get_set.c
 utc_ethumb_video_start_set.c
 utc_ethumb_video_start_get.c
 utc_ethumb_video_time_set.c
@@ -21,12 +20,10 @@ utc_ethumb_thumb_compress_get.c
 utc_ethumb_thumb_orientation_set.c
 utc_ethumb_thumb_crop_align_set.c
 utc_ethumb_thumb_aspect_set.c
-utc_ethumb_thumb_format_set.c
-utc_ethumb_thumb_format_get.c
+utc_ethumb_thumb_format_get_set.c
 utc_ethumb_thumb_size_set.c
 utc_ethumb_thumb_fdo_set.c
-utc_ethumb_thumb_path_set.c
-utc_ethumb_thumb_path_get.c
+utc_ethumb_thumb_path_get_set.c
 utc_ethumb_thumb_dir_path_set.c
 utc_ethumb_thumb_category_set.c
 utc_ethumb_file_set.c
index 1c445256a1e71799934a759d4c6b0514f322b525..6723a9087d8bd695306e543d2409b79b44673b90 100644 (file)
@@ -2,8 +2,7 @@ utc_ethumb_init.c
 utc_ethumb_shutdown.c
 utc_ethumb_new.c
 utc_ethumb_free.c
-utc_ethumb_document_page_set.c
-utc_ethumb_document_page_get.c
+utc_ethumb_document_page_get_set.c
 utc_ethumb_video_start_set.c
 utc_ethumb_video_start_get.c
 utc_ethumb_video_time_set.c
@@ -21,12 +20,10 @@ utc_ethumb_thumb_compress_get.c
 utc_ethumb_thumb_orientation_set.c
 utc_ethumb_thumb_crop_align_set.c
 utc_ethumb_thumb_aspect_set.c
-utc_ethumb_thumb_format_set.c
-utc_ethumb_thumb_format_get.c
+utc_ethumb_thumb_format_get_set.c
 utc_ethumb_thumb_size_set.c
 utc_ethumb_thumb_fdo_set.c
-utc_ethumb_thumb_path_set.c
-utc_ethumb_thumb_path_get.c
+utc_ethumb_thumb_path_get_set.c
 utc_ethumb_thumb_dir_path_set.c
 utc_ethumb_thumb_category_set.c
 utc_ethumb_file_set.c
index 1c445256a1e71799934a759d4c6b0514f322b525..6723a9087d8bd695306e543d2409b79b44673b90 100644 (file)
@@ -2,8 +2,7 @@ utc_ethumb_init.c
 utc_ethumb_shutdown.c
 utc_ethumb_new.c
 utc_ethumb_free.c
-utc_ethumb_document_page_set.c
-utc_ethumb_document_page_get.c
+utc_ethumb_document_page_get_set.c
 utc_ethumb_video_start_set.c
 utc_ethumb_video_start_get.c
 utc_ethumb_video_time_set.c
@@ -21,12 +20,10 @@ utc_ethumb_thumb_compress_get.c
 utc_ethumb_thumb_orientation_set.c
 utc_ethumb_thumb_crop_align_set.c
 utc_ethumb_thumb_aspect_set.c
-utc_ethumb_thumb_format_set.c
-utc_ethumb_thumb_format_get.c
+utc_ethumb_thumb_format_get_set.c
 utc_ethumb_thumb_size_set.c
 utc_ethumb_thumb_fdo_set.c
-utc_ethumb_thumb_path_set.c
-utc_ethumb_thumb_path_get.c
+utc_ethumb_thumb_path_get_set.c
 utc_ethumb_thumb_dir_path_set.c
 utc_ethumb_thumb_category_set.c
 utc_ethumb_file_set.c
index 3f384f8e0cecda842d63c69a78fcb7dbe6d2c64b..cc5739308e214972e81445d8108f8104133d8905 100644 (file)
@@ -2,8 +2,7 @@ utc_ethumb_init.c
 utc_ethumb_shutdown.c
 utc_ethumb_new.c
 utc_ethumb_free.c
-utc_ethumb_document_page_set.c
-utc_ethumb_document_page_get.c
+utc_ethumb_document_page_get_set.c
 utc_ethumb_video_start_set.c
 utc_ethumb_video_start_get.c
 utc_ethumb_video_time_set.c
@@ -21,12 +20,10 @@ utc_ethumb_thumb_compress_get.c
 utc_ethumb_thumb_orientation_set.c
 utc_ethumb_thumb_crop_align_set.c
 utc_ethumb_thumb_aspect_set.c
-utc_ethumb_thumb_format_set.c
-utc_ethumb_thumb_format_get.c
+utc_ethumb_thumb_format_get_set.c
 utc_ethumb_thumb_size_set.c
 utc_ethumb_thumb_fdo_set.c
-utc_ethumb_thumb_path_set.c
-utc_ethumb_thumb_path_get.c
+utc_ethumb_thumb_path_get_set.c
 utc_ethumb_thumb_dir_path_set.c
 utc_ethumb_thumb_category_set.c
 utc_ethumb_file_set.c
index 3f384f8e0cecda842d63c69a78fcb7dbe6d2c64b..cc5739308e214972e81445d8108f8104133d8905 100644 (file)
@@ -2,8 +2,7 @@ utc_ethumb_init.c
 utc_ethumb_shutdown.c
 utc_ethumb_new.c
 utc_ethumb_free.c
-utc_ethumb_document_page_set.c
-utc_ethumb_document_page_get.c
+utc_ethumb_document_page_get_set.c
 utc_ethumb_video_start_set.c
 utc_ethumb_video_start_get.c
 utc_ethumb_video_time_set.c
@@ -21,12 +20,10 @@ utc_ethumb_thumb_compress_get.c
 utc_ethumb_thumb_orientation_set.c
 utc_ethumb_thumb_crop_align_set.c
 utc_ethumb_thumb_aspect_set.c
-utc_ethumb_thumb_format_set.c
-utc_ethumb_thumb_format_get.c
+utc_ethumb_thumb_format_get_set.c
 utc_ethumb_thumb_size_set.c
 utc_ethumb_thumb_fdo_set.c
-utc_ethumb_thumb_path_set.c
-utc_ethumb_thumb_path_get.c
+utc_ethumb_thumb_path_get_set.c
 utc_ethumb_thumb_dir_path_set.c
 utc_ethumb_thumb_category_set.c
 utc_ethumb_file_set.c
diff --git a/TC/ethumb/ethumb/utc_ethumb_document_page_get.c b/TC/ethumb/ethumb/utc_ethumb_document_page_get.c
deleted file mode 100644 (file)
index c1167b9..0000000
+++ /dev/null
@@ -1,126 +0,0 @@
-#include <check.h>
-#include <Ethumb.h>
-#include "../../utc_negative_unitest.h"
-
-static const unsigned int TEST_PAGE = 5;
-
-/**
- * @addtogroup ethumb
- * @{
- * @defgroup ethumb_document_page_get ethumb_document_page_get()
- *
- * @precondition
- * @step 1 Initialization with ethumb_init()
- * @}
- */
-static void
-setup(void)
-{
-   printf(" ============ Startup ============ \n");
-   ethumb_init();
-}
-
-static void
-teardown(void)
-{
-   printf(" ============ Cleanup ============ \n");
-   ethumb_shutdown();
-}
-
-/**
- * @addtogroup ethumb_document_page_get
- * @{
- * @objective Positive test case check if right page of a document is set.
- * @n Input Data: Ethumb object.
- *
- * @procedure
- * @step 1 Create new Ethumb object.
- * @step 2 Set page of the object to TEST_PAGE that is equal 5.
- * @step 3 Check set page.
- *
- * @passcondition Function returns 5.
- * @}
- */
-START_TEST(utc_ethumb_document_page_get_p)
-{
-   Ethumb *thumb = ethumb_new();
-
-   if (!thumb)
-     {
-        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Ethumb object is not created..", __FILE__, __LINE__);
-        return;
-     }
-   ethumb_document_page_set(thumb, TEST_PAGE);
-
-   if (ethumb_document_page_get(thumb) != TEST_PAGE)
-     {
-        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
-        ethumb_free(thumb);
-        return;
-     }
-   printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
-   ethumb_free(thumb);
-}
-END_TEST
-
-/**
- * @addtogroup ethumb_document_page_get
- * @{
- * @objective Negative test case checks if function doesn't cause segmentation fault
- * and returns 0 if it is called with NULL instead of any argument.
- * @n Input Data: Ethumb object (will be replaced with NULL when function is called);
- *
- * @procedure
- * @step 1 Create new Ethumb object.
- * @step 2 Call function once and pass NULL instead of Ethumb object.
- *
- * @passcondition Function doesn't cause segmentation fault and returns 0.
- * @}
- */
-START_TEST(utc_ethumb_document_page_get_n)
-{
-   Ethumb *thumb = ethumb_new();
-
-   if (UNITEST_FUNC_NEG_RET(0, ethumb_document_page_get, thumb) == TEST_FAIL)
-     {
-        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
-        ethumb_free(thumb);
-        return;
-     }
-   printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
-   ethumb_free(thumb);
-}
-END_TEST
-/**
- *@}
- */
-Suite *
-test_suite(void)
-{
-   Suite *suite = suite_create("utc_ethumb_document_page_get");
-
-   TCase *tcase = tcase_create("TCase");
-   tcase_set_timeout(tcase, 30);
-   tcase_add_checked_fixture(tcase, setup, teardown);
-   tcase_add_test(tcase, utc_ethumb_document_page_get_p);
-   tcase_add_test(tcase, utc_ethumb_document_page_get_n);
-   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_ethumb_document_page_get.log");
-   srunner_set_xml(srunner, "utc_ethumb_document_page_get.xml");
-   srunner_run_all(srunner, CK_NORMAL);
-   number_failed = srunner_ntests_failed(srunner);
-   srunner_free(srunner);
-
-   return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
-}
diff --git a/TC/ethumb/ethumb/utc_ethumb_document_page_get_set.c b/TC/ethumb/ethumb/utc_ethumb_document_page_get_set.c
new file mode 100644 (file)
index 0000000..a24474e
--- /dev/null
@@ -0,0 +1,153 @@
+#include <check.h>
+#include <Ethumb.h>
+#include "../../utc_negative_unitest.h"
+
+static const unsigned int TEST_PAGE = 5;
+
+/**
+ * @addtogroup ethumb
+ * @{
+ * @defgroup ethumb_document_page_get ethumb_document_page_get()
+ *
+ * @precondition
+ * @step 1 Initialization with ethumb_init()
+ * @}
+ */
+static void
+setup(void)
+{
+   printf(" ============ Startup ============ \n");
+   ethumb_init();
+}
+
+static void
+teardown(void)
+{
+   printf(" ============ Cleanup ============ \n");
+   ethumb_shutdown();
+}
+
+/**
+ * @addtogroup ethumb_document_page_get
+ * @{
+ * @objective Positive test case check if right page of a document is set.
+ * @n Input Data: Ethumb object.
+ *
+ * @procedure
+ * @step 1 Create new Ethumb object.
+ * @step 2 Set page of the object to TEST_PAGE that is equal 5.
+ * @step 3 Check set page.
+ *
+ * @passcondition Function returns 5.
+ * @}
+ */
+START_TEST(utc_ethumb_document_page_get_p)
+{
+   Ethumb *thumb = ethumb_new();
+
+   if (!thumb)
+     {
+        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Ethumb object is not created..", __FILE__, __LINE__);
+     }
+   ethumb_document_page_set(thumb, TEST_PAGE);
+
+   if (ethumb_document_page_get(thumb) != TEST_PAGE)
+     {
+        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
+        ethumb_free(thumb);
+     }
+   printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
+   ethumb_free(thumb);
+}
+END_TEST
+
+/**
+ * @addtogroup ethumb_document_page_get
+ * @{
+ * @objective Negative test case checks if function doesn't cause segmentation fault
+ * and returns 0 if it is called with NULL instead of any argument.
+ * @n Input Data: Ethumb object (will be replaced with NULL when function is called);
+ *
+ * @procedure
+ * @step 1 Create new Ethumb object.
+ * @step 2 Call function once and pass NULL instead of Ethumb object.
+ *
+ * @passcondition Function doesn't cause segmentation fault and returns 0.
+ * @}
+ */
+START_TEST(utc_ethumb_document_page_get_n)
+{
+   Ethumb *thumb = ethumb_new();
+
+   if (UNITEST_FUNC_NEG_RET(0, ethumb_document_page_get, thumb) == TEST_FAIL)
+     {
+        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
+        ethumb_free(thumb);
+     }
+   printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
+   ethumb_free(thumb);
+}
+END_TEST
+
+/**
+ * @addtogroup ethumb_document_page_set
+ * @{
+ * @objective Negative test case checks if function doesn't cause segmentation fault
+ * if it is called with NULL instead of some argument.
+ * @n Input Data:
+ * @li Ethumb object (will be replaced with NULL when function is called);
+ * @li 5 - page number.
+ *
+ * @procedure
+ * @step 1 Create new Ethumb object.
+ * @step 2 Call function once and pass NULL instead of Ethumb object.
+ *
+ * @passcondition Function doesn't cause segmentation fault.
+ * @}
+ */
+START_TEST(utc_ethumb_document_page_set_n)
+{
+   Ethumb *thumb = ethumb_new();
+
+   CREATE_CHECKED_ARGS_ARRAY(1, 0);
+   UNITEST_FUNC_NEG_CA(ethumb_document_page_set, thumb, TEST_PAGE);
+
+   printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
+   ethumb_free(thumb);
+}
+END_TEST
+
+/**
+ *@}
+ */
+Suite *
+test_suite(void)
+{
+   Suite *suite = suite_create("utc_ethumb_document_page_get_set");
+
+   TCase *tcase = tcase_create("TCase");
+   tcase_set_timeout(tcase, 30);
+   tcase_add_checked_fixture(tcase, setup, teardown);
+   tcase_add_test(tcase, utc_ethumb_document_page_get_p);
+   tcase_add_test(tcase, utc_ethumb_document_page_get_n);
+   tcase_add_test(tcase, utc_ethumb_document_page_set_n);
+   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_ethumb_document_page_get_set.log");
+   srunner_set_xml(srunner, "utc_ethumb_document_page_get_set.xml");
+   srunner_run_all(srunner, CK_NORMAL);
+   number_failed = srunner_ntests_failed(srunner);
+   srunner_free(srunner);
+
+   return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
+}
diff --git a/TC/ethumb/ethumb/utc_ethumb_document_page_set.c b/TC/ethumb/ethumb/utc_ethumb_document_page_set.c
deleted file mode 100644 (file)
index 76d323e..0000000
+++ /dev/null
@@ -1,127 +0,0 @@
-#include <check.h>
-#include <Ethumb.h>
-#include "../../utc_negative_unitest.h"
-
-static const unsigned int TEST_PAGE = 5;
-
-/**
- * @addtogroup ethumb
- * @{
- * @defgroup ethumb_document_page_set ethumb_document_page_set()
- *
- * @precondition
- * @step 1 Initialization with ethumb_init()
- * @}
- */
-static void
-setup(void)
-{
-   printf(" ============ Startup ============ \n");
-   ethumb_init();
-}
-
-static void
-teardown(void)
-{
-   printf(" ============ Cleanup ============ \n");
-   ethumb_shutdown();
-}
-
-/**
- * @addtogroup ethumb_document_page_set
- * @{
- * @objective Positive test case check if right page of a document is set.
- * @n Input Data:
- * @li Ethumb object;
- * @li TEST_PAGE (equals 5) - page number.
- *
- * @procedure
- * @step 1 Create new Ethumb object.
- * @step 2 Set page of it to TEST_PAGE.
- * @step 3 Check set page.
- *
- * @passcondition Function sets document page to 5.
- * @}
- */
-START_TEST(utc_ethumb_document_page_set_p)
-{
-   Ethumb *thumb = ethumb_new();
-
-   if (!thumb)
-     {
-        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Ethumb object is not created..", __FILE__, __LINE__);
-        return;
-     }
-   ethumb_document_page_set(thumb, TEST_PAGE);
-
-   if (ethumb_document_page_get(thumb) != TEST_PAGE)
-     {
-        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
-        ethumb_free(thumb);
-        return;
-     }
-   printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
-   ethumb_free(thumb);
-}
-END_TEST
-
-/**
- * @addtogroup ethumb_document_page_set
- * @{
- * @objective Negative test case checks if function doesn't cause segmentation fault
- * if it is called with NULL instead of some argument.
- * @n Input Data:
- * @li Ethumb object (will be replaced with NULL when function is called);
- * @li 5 - page number.
- *
- * @procedure
- * @step 1 Create new Ethumb object.
- * @step 2 Call function once and pass NULL instead of Ethumb object.
- *
- * @passcondition Function doesn't cause segmentation fault.
- * @}
- */
-START_TEST(utc_ethumb_document_page_set_n)
-{
-   Ethumb *thumb = ethumb_new();
-
-   CREATE_CHECKED_ARGS_ARRAY(1, 0);
-   UNITEST_FUNC_NEG_CA(ethumb_document_page_set, thumb, TEST_PAGE);
-
-   printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
-   ethumb_free(thumb);
-}
-END_TEST
-/**
- *@}
- */
-Suite *
-test_suite(void)
-{
-   Suite *suite = suite_create("utc_ethumb_document_page_set");
-
-   TCase *tcase = tcase_create("TCase");
-   tcase_set_timeout(tcase, 30);
-   tcase_add_checked_fixture(tcase, setup, teardown);
-   tcase_add_test(tcase, utc_ethumb_document_page_set_p);
-   tcase_add_test(tcase, utc_ethumb_document_page_set_n);
-   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_ethumb_document_page_set.log");
-   srunner_set_xml(srunner, "utc_ethumb_document_page_set.xml");
-   srunner_run_all(srunner, CK_NORMAL);
-   number_failed = srunner_ntests_failed(srunner);
-   srunner_free(srunner);
-
-   return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
-}
diff --git a/TC/ethumb/ethumb/utc_ethumb_thumb_format_get.c b/TC/ethumb/ethumb/utc_ethumb_thumb_format_get.c
deleted file mode 100644 (file)
index 217eb9c..0000000
+++ /dev/null
@@ -1,122 +0,0 @@
-#include <check.h>
-#include <Ethumb.h>
-#include "../../utc_negative_unitest.h"
-
-/**
- * @addtogroup ethumb
- * @{
- * @defgroup ethumb_thumb_format_get ethumb_thumb_format_get()
- *
- * @precondition
- * @step 1 Initialization with ethumb_init()
- * @}
- */
-static void
-setup(void)
-{
-   printf(" ============ Startup ============ \n");
-   ethumb_init();
-}
-
-static void
-teardown(void)
-{
-   printf(" ============ Cleanup ============ \n");
-   ethumb_shutdown();
-}
-
-/**
- * @addtogroup ethumb_thumb_format_get
- * @{
- * @objective Positive test case checks if function returns correct format of Ethumb object.
- * @n Input Data: Ethumb object.
- *
- * @procedure
- * @step 1 Create new Ethumb object.
- * @step 2 Check format of the object.
- *
- * @passcondition Function returns 0 (is not set).
- * @}
- */
-START_TEST(utc_ethumb_thumb_format_get_p)
-{
-   Ethumb *thumb = ethumb_new();
-
-   if (!thumb)
-     {
-        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Ethumb object is not created..", __FILE__, __LINE__);
-        return;
-     }
-
-   if (ethumb_thumb_format_get(thumb))
-     {
-        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
-        ethumb_free(thumb);
-        return;
-     }
-   printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
-   ethumb_free(thumb);
-}
-END_TEST
-
-/**
- * @addtogroup ethumb_thumb_format_get
- * @{
- * @objective Negative test case checks if function doesn't cause segmentation fault
- * and returns 0 if it is called with NULL instead of any argument.
- * @n Input Data: Ethumb object (will be replaced with NULL when function is called);
- *
- * @procedure
- * @step 1 Create new Ethumb object.
- * @step 2 Call function once and pass NULL instead of Ethumb object.
- *
- * @passcondition Function doesn't cause segmentation fault and returns 0.
- * @}
- */
-START_TEST(utc_ethumb_thumb_format_get_n)
-{
-   Ethumb *thumb = ethumb_new();
-
-   if (UNITEST_FUNC_NEG_RET(0, ethumb_thumb_format_get, thumb) == TEST_FAIL)
-     {
-        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
-        ethumb_free(thumb);
-        return;
-     }
-   printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
-   ethumb_free(thumb);
-}
-END_TEST
-/**
- *@}
- */
-Suite *
-test_suite(void)
-{
-   Suite *suite = suite_create("utc_ethumb_thumb_format_get");
-
-   TCase *tcase = tcase_create("TCase");
-   tcase_set_timeout(tcase, 30);
-   tcase_add_checked_fixture(tcase, setup, teardown);
-   tcase_add_test(tcase, utc_ethumb_thumb_format_get_p);
-   tcase_add_test(tcase, utc_ethumb_thumb_format_get_n);
-   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_ethumb_thumb_format_get.log");
-   srunner_set_xml(srunner, "utc_ethumb_thumb_format_get.xml");
-   srunner_run_all(srunner, CK_NORMAL);
-   number_failed = srunner_ntests_failed(srunner);
-   srunner_free(srunner);
-
-   return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
-}
diff --git a/TC/ethumb/ethumb/utc_ethumb_thumb_format_get_set.c b/TC/ethumb/ethumb/utc_ethumb_thumb_format_get_set.c
new file mode 100644 (file)
index 0000000..2cc0f12
--- /dev/null
@@ -0,0 +1,178 @@
+#include <check.h>
+#include <Ethumb.h>
+#include "../../utc_negative_unitest.h"
+static const int ETHUMB_TEST_INVALID_FORMAT = -1;
+
+/**
+ * @addtogroup ethumb
+ * @{
+ * @defgroup ethumb_thumb_format_set ethumb_thumb_format_set()
+ *
+ * @precondition
+ * @step 1 Initialization with ethumb_init()
+ * @}
+ */
+static void
+setup(void)
+{
+   printf(" ============ Startup ============ \n");
+   ethumb_init();
+}
+
+static void
+teardown(void)
+{
+   printf(" ============ Cleanup ============ \n");
+   ethumb_shutdown();
+}
+
+/**
+ * @addtogroup ethumb_thumb_format_set
+ * @{
+ * @objective Positive test case check if function sets right format of a thumb properly.
+ * @n Input Data:
+ * @li Ethumb object;
+ * @li ETHUMB_THUMB_JPEG (enum) - format value.
+ *
+ * @procedure
+ * @step 1 Create new Ethumb object named thumb.
+ * @step 2 Set format of thumb to 2.
+ * @step 3 Check format of thumb.
+ *
+ * @passcondition Function sets format value to ETHUMB_THUMB_JPEG.
+ * @}
+ */
+START_TEST(utc_ethumb_thumb_format_set_p)
+{
+   Ethumb *thumb = ethumb_new();
+
+   if (!thumb)
+     {
+        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Ethumb object is not created..", __FILE__, __LINE__);
+     }
+   ethumb_thumb_format_set(thumb, ETHUMB_THUMB_JPEG);
+
+   if (ethumb_thumb_format_get(thumb) != ETHUMB_THUMB_JPEG)
+     {
+        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
+        ethumb_free(thumb);
+     }
+   printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
+   ethumb_free(thumb);
+}
+END_TEST
+
+/**
+ * @addtogroup ethumb_thumb_format_set
+ * @{
+ * @objective Negative test case checks function's behavior when it is called with NULL instead of
+ * valid Ethumb object and with valid thumb but incorrect format value. Function shouldn't cause
+ * segmentation fault when NULL is passed as first parameter.
+ * @n Input Data:
+ * @n First call:
+ * @li NULL instead of pointer to Ethumb object;
+ * @li ETHUMB_THUMB_JPEG as value of format.
+ * @n Second call:
+ * @li valid pointer to Ethumb object;
+ * @li ETHUMB_THUMB_JPEG as value of format.
+ * @n Third call:
+ * @li valid pointer to Ethumb object;
+ * @li ETHUMB_TEST_INVALID_FORMAT (-1) value of format.
+ *
+ * @procedure
+ * @step 1 Create new Ethumb object.
+ * @step 2 Try to set format for NULL Ethumb object.
+ * @step 3 Set format for valid object to ETHUMB_THUMB_JPEG.
+ * @step 4 Try to set format for valid object to invalid value ETHUMB_TEST_INVALID_FORMAT (-1).
+ * @step 5 Check format of the object.
+ *
+ * @passcondition
+ * @li Function doesn't cause segmentation fault when it is called with NULL as first parameter.
+ * @li Function doesn't set invalid value for format - after step 5 ethumb_thumb_format_get
+ * must return ETHUMB_THUMB_JPEG value for the object.
+ * @}
+ */
+START_TEST(utc_ethumb_thumb_format_set_n)
+{
+   Ethumb *thumb = ethumb_new();
+
+   if (!thumb)
+     {
+        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Ethumb object is not created..", __FILE__, __LINE__);
+     }
+   ethumb_thumb_format_set(NULL, ETHUMB_THUMB_JPEG);
+   ethumb_thumb_format_set(thumb, ETHUMB_THUMB_JPEG);
+   ethumb_thumb_format_set(thumb, (Ethumb_Thumb_Format)ETHUMB_TEST_INVALID_FORMAT);
+
+   if (ethumb_thumb_format_get(thumb) != ETHUMB_THUMB_JPEG)
+     {
+        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
+        ethumb_free(thumb);
+     }
+   printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
+   ethumb_free(thumb);
+}
+END_TEST
+
+/**
+ * @addtogroup ethumb_thumb_format_get
+ * @{
+ * @objective Negative test case checks if function doesn't cause segmentation fault
+ * and returns 0 if it is called with NULL instead of any argument.
+ * @n Input Data: Ethumb object (will be replaced with NULL when function is called);
+ *
+ * @procedure
+ * @step 1 Create new Ethumb object.
+ * @step 2 Call function once and pass NULL instead of Ethumb object.
+ *
+ * @passcondition Function doesn't cause segmentation fault and returns 0.
+ * @}
+ */
+START_TEST(utc_ethumb_thumb_format_get_n)
+{
+   Ethumb *thumb = ethumb_new();
+
+   if (UNITEST_FUNC_NEG_RET(0, ethumb_thumb_format_get, thumb) == TEST_FAIL)
+     {
+        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
+        ethumb_free(thumb);
+     }
+   printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
+   ethumb_free(thumb);
+}
+END_TEST
+
+/**
+ *@}
+ */
+Suite *
+test_suite(void)
+{
+   Suite *suite = suite_create("utc_ethumb_thumb_format_get_set");
+
+   TCase *tcase = tcase_create("TCase");
+   tcase_set_timeout(tcase, 30);
+   tcase_add_checked_fixture(tcase, setup, teardown);
+   tcase_add_test(tcase, utc_ethumb_thumb_format_set_p);
+   tcase_add_test(tcase, utc_ethumb_thumb_format_set_n);
+   tcase_add_test(tcase, utc_ethumb_thumb_format_get_n);
+   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_ethumb_thumb_format_get_set.log");
+   srunner_set_xml(srunner, "utc_ethumb_thumb_format_get_set.xml");
+   srunner_run_all(srunner, CK_NORMAL);
+   number_failed = srunner_ntests_failed(srunner);
+   srunner_free(srunner);
+
+   return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
+}
diff --git a/TC/ethumb/ethumb/utc_ethumb_thumb_format_set.c b/TC/ethumb/ethumb/utc_ethumb_thumb_format_set.c
deleted file mode 100644 (file)
index 46256dc..0000000
+++ /dev/null
@@ -1,152 +0,0 @@
-#include <check.h>
-#include <Ethumb.h>
-#include "../../utc_negative_unitest.h"
-static const int ETHUMB_TEST_INVALID_FORMAT = -1;
-
-/**
- * @addtogroup ethumb
- * @{
- * @defgroup ethumb_thumb_format_set ethumb_thumb_format_set()
- *
- * @precondition
- * @step 1 Initialization with ethumb_init()
- * @}
- */
-static void
-setup(void)
-{
-   printf(" ============ Startup ============ \n");
-   ethumb_init();
-}
-
-static void
-teardown(void)
-{
-   printf(" ============ Cleanup ============ \n");
-   ethumb_shutdown();
-}
-
-/**
- * @addtogroup ethumb_thumb_format_set
- * @{
- * @objective Positive test case check if function sets right format of a thumb properly.
- * @n Input Data:
- * @li Ethumb object;
- * @li ETHUMB_THUMB_JPEG (enum) - format value.
- *
- * @procedure
- * @step 1 Create new Ethumb object named thumb.
- * @step 2 Set format of thumb to 2.
- * @step 3 Check format of thumb.
- *
- * @passcondition Function sets format value to ETHUMB_THUMB_JPEG.
- * @}
- */
-START_TEST(utc_ethumb_thumb_format_set_p)
-{
-   Ethumb *thumb = ethumb_new();
-
-   if (!thumb)
-     {
-        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Ethumb object is not created..", __FILE__, __LINE__);
-        return;
-     }
-   ethumb_thumb_format_set(thumb, ETHUMB_THUMB_JPEG);
-
-   if (ethumb_thumb_format_get(thumb) != ETHUMB_THUMB_JPEG)
-     {
-        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
-        ethumb_free(thumb);
-        return;
-     }
-   printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
-   ethumb_free(thumb);
-}
-END_TEST
-
-/**
- * @addtogroup ethumb_thumb_format_set
- * @{
- * @objective Negative test case checks function's behavior when it is called with NULL instead of
- * valid Ethumb object and with valid thumb but incorrect format value. Function shouldn't cause
- * segmentation fault when NULL is passed as first parameter.
- * @n Input Data:
- * @n First call:
- * @li NULL instead of pointer to Ethumb object;
- * @li ETHUMB_THUMB_JPEG as value of format.
- * @n Second call:
- * @li valid pointer to Ethumb object;
- * @li ETHUMB_THUMB_JPEG as value of format.
- * @n Third call:
- * @li valid pointer to Ethumb object;
- * @li ETHUMB_TEST_INVALID_FORMAT (-1) value of format.
- *
- * @procedure
- * @step 1 Create new Ethumb object.
- * @step 2 Try to set format for NULL Ethumb object.
- * @step 3 Set format for valid object to ETHUMB_THUMB_JPEG.
- * @step 4 Try to set format for valid object to invalid value ETHUMB_TEST_INVALID_FORMAT (-1).
- * @step 5 Check format of the object.
- *
- * @passcondition
- * @li Function doesn't cause segmentation fault when it is called with NULL as first parameter.
- * @li Function doesn't set invalid value for format - after step 5 ethumb_thumb_format_get
- * must return ETHUMB_THUMB_JPEG value for the object.
- * @}
- */
-START_TEST(utc_ethumb_thumb_format_set_n)
-{
-   Ethumb *thumb = ethumb_new();
-
-   if (!thumb)
-     {
-        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Ethumb object is not created..", __FILE__, __LINE__);
-        return;
-     }
-   ethumb_thumb_format_set(NULL, ETHUMB_THUMB_JPEG);
-   ethumb_thumb_format_set(thumb, ETHUMB_THUMB_JPEG);
-   ethumb_thumb_format_set(thumb, (Ethumb_Thumb_Format)ETHUMB_TEST_INVALID_FORMAT);
-
-   if (ethumb_thumb_format_get(thumb) != ETHUMB_THUMB_JPEG)
-     {
-        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
-        ethumb_free(thumb);
-        return;
-     }
-   printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
-   ethumb_free(thumb);
-}
-END_TEST
-/**
- *@}
- */
-Suite *
-test_suite(void)
-{
-   Suite *suite = suite_create("utc_ethumb_thumb_format_set");
-
-   TCase *tcase = tcase_create("TCase");
-   tcase_set_timeout(tcase, 30);
-   tcase_add_checked_fixture(tcase, setup, teardown);
-   tcase_add_test(tcase, utc_ethumb_thumb_format_set_p);
-   tcase_add_test(tcase, utc_ethumb_thumb_format_set_n);
-   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_ethumb_thumb_format_set.log");
-   srunner_set_xml(srunner, "utc_ethumb_thumb_format_set.xml");
-   srunner_run_all(srunner, CK_NORMAL);
-   number_failed = srunner_ntests_failed(srunner);
-   srunner_free(srunner);
-
-   return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
-}
diff --git a/TC/ethumb/ethumb/utc_ethumb_thumb_path_get.c b/TC/ethumb/ethumb/utc_ethumb_thumb_path_get.c
deleted file mode 100644 (file)
index 1ea6af6..0000000
+++ /dev/null
@@ -1,143 +0,0 @@
-#include <check.h>
-#include <Ethumb.h>
-#include "../../utc_negative_unitest.h"
-
-/**
- * @addtogroup ethumb
- * @{
- * @defgroup ethumb_thumb_path_get ethumb_thumb_path_get()
- *
- * @precondition
- * @step 1 Initialization with ethumb_init()
- * @}
- */
-static void
-setup(void)
-{
-   printf(" ============ Startup ============ \n");
-   ethumb_init();
-}
-
-static void
-teardown(void)
-{
-   printf(" ============ Cleanup ============ \n");
-   ethumb_shutdown();
-}
-
-/**
- * @addtogroup ethumb_thumb_path_get
- * @{
- * @objective Positive test case checks thumb path and key of created Ethumb if
- * it weren't set for object. Function shouldn't set any key, but should generate default path.
- * @n Input Data:
- * @li Ethumb object without path and key;
- * @li pointer to variable to write thumb path;
- * @li pointer to variable to write thumb key.
- *
- * @procedure
- * @step 1 Create new Ethumb object.
- * @step 2 Check path and key of a thumb.
- *
- * @passcondition Path is not NULL, but key is NULL.
- * @}
- */
-START_TEST(utc_ethumb_thumb_path_get_p)
-{
-   const char *path = NULL;
-   const char *key = NULL;
-   int result = TEST_FAIL;
-   Ethumb *thumb = ethumb_new();
-
-   if (!thumb)
-     {
-        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Ethumb object is not created..", __FILE__, __LINE__);
-        return;
-     }
-   ethumb_thumb_path_get(thumb, &path, &key);
-
-   if (!path || !strlen(path))
-     {
-        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Path was not got..", __FILE__, __LINE__);
-     }
-   else if (key)
-     {
-        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Key is not NULL..", __FILE__, __LINE__);
-     }
-   else
-     {
-        printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
-        result = TEST_PASS;
-     }
-   ethumb_free(thumb);
-}
-END_TEST
-
-/**
- * @addtogroup ethumb_thumb_path_get
- * @{
- * @objective Negative test case checks if function doesn't cause segmentation fault
- * if it is called with NULL instead of any argument.
- * @n Input Data:
- * @li Ethumb object;
- * @li pointer to variable to write thumb path;
- * @li pointer to variable to write thumb key.
- *
- * @procedure
- * @step 1 Create new Ethumb object.
- * @step 2 Call function 3 times and pass (in turn) NULL instead of each argument.
- *
- * @passcondition Function doesn't cause segmentation fault.
- * @}
- */
-START_TEST(utc_ethumb_thumb_path_get_n)
-{
-   const char *path = NULL;
-   const char *key = NULL;
-   Ethumb *thumb = ethumb_new();
-
-   if (!thumb)
-     {
-        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Ethumb object is not created..", __FILE__, __LINE__);
-        return;
-     }
-
-   UNITEST_FUNC_NEG(ethumb_thumb_path_get, thumb, &path, &key);
-
-   printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
-   ethumb_free(thumb);
-}
-END_TEST
-/**
- *@}
- */
-Suite *
-test_suite(void)
-{
-   Suite *suite = suite_create("utc_ethumb_thumb_path_get");
-
-   TCase *tcase = tcase_create("TCase");
-   tcase_set_timeout(tcase, 30);
-   tcase_add_checked_fixture(tcase, setup, teardown);
-   tcase_add_test(tcase, utc_ethumb_thumb_path_get_p);
-   tcase_add_test(tcase, utc_ethumb_thumb_path_get_n);
-   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_ethumb_thumb_path_get.log");
-   srunner_set_xml(srunner, "utc_ethumb_thumb_path_get.xml");
-   srunner_run_all(srunner, CK_NORMAL);
-   number_failed = srunner_ntests_failed(srunner);
-   srunner_free(srunner);
-
-   return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
-}
diff --git a/TC/ethumb/ethumb/utc_ethumb_thumb_path_get_set.c b/TC/ethumb/ethumb/utc_ethumb_thumb_path_get_set.c
new file mode 100644 (file)
index 0000000..61209e3
--- /dev/null
@@ -0,0 +1,183 @@
+#include <check.h>
+#include <Ethumb.h>
+#include "../../utc_negative_unitest.h"
+static const char *THUMB_PATH = "test_path.file";
+static const char *THUMB_KEY = "test_key";
+
+/**
+ * @addtogroup ethumb
+ * @{
+ * @defgroup ethumb_thumb_path_set ethumb_thumb_path_set()
+ *
+ * @precondition
+ * @step 1 Initialization with ethumb_init()
+ * @}
+ */
+static void
+setup(void)
+{
+   printf(" ============ Startup ============ \n");
+   ethumb_init();
+}
+
+static void
+teardown(void)
+{
+   printf(" ============ Cleanup ============ \n");
+   ethumb_shutdown();
+}
+
+/**
+ * @addtogroup ethumb_thumb_path_set
+ * @{
+ * @objective Positive test case checks if function sets right path and key of a thumb properly.
+ * @n Input Data:
+ * @li Ethumb object;
+ * @li "test_file_set.file" - thumb file to set for the object;
+ * @li "test_key" - key to set for the object.
+ *
+ * @procedure
+ * @step 1 Create new Ethumb object.
+ * @step 2 Set path of a thumb Ethumb to "test_path.file" and key to "test_key".
+ * @step 3 Check path and key of a thumb.
+ *
+ * @passcondition Path is not NULL and key is equal "test_key".
+ * @}
+ */
+START_TEST(utc_ethumb_thumb_path_set_p)
+{
+   const char *path = NULL;
+   const char *key = NULL;
+   int result = TEST_FAIL;
+   Ethumb *thumb = ethumb_new();
+
+   if (!thumb)
+     {
+        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Ethumb object is not created..", __FILE__, __LINE__);
+     }
+   ethumb_thumb_path_set(thumb, THUMB_PATH, THUMB_KEY);
+   ethumb_thumb_path_get(thumb, &path, &key);
+
+   if (!path)
+     {
+        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Path is NULL..", __FILE__, __LINE__);
+     }
+   else if (!key)
+     {
+        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Key is NULL..", __FILE__, __LINE__);
+     }
+   else if (strcmp(key, THUMB_KEY))
+     {
+        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Key doesn't match with initial one..", __FILE__, __LINE__);
+     }
+   else
+     {
+        printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
+        result = TEST_PASS;
+     }
+   ethumb_free(thumb);
+}
+END_TEST
+
+/**
+ * @addtogroup ethumb_thumb_path_set
+ * @{
+ * @objective Negative test case checks if function doesn't cause segmentation fault
+ * if it is called with NULL instead of any argument.
+ * @n Input Data:
+ * @li Ethumb object;
+ * @li pointer to variable to write thumb file path;
+ * @li pointer to variable to write thumb key.
+ *
+ * @procedure
+ * @step 1 Create new Ethumb object.
+ * @step 2 Call function 3 times and pass (in turn) NULL instead of each argument.
+ *
+ * @passcondition Function doesn't cause segmentation fault.
+ * @}
+ */
+START_TEST(utc_ethumb_thumb_path_set_n)
+{
+   Ethumb *thumb = ethumb_new();
+
+   if (!thumb)
+     {
+        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Ethumb object is not created..", __FILE__, __LINE__);
+     }
+
+   UNITEST_FUNC_NEG(ethumb_thumb_path_set, thumb, THUMB_PATH, THUMB_KEY);
+
+   printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
+   ethumb_free(thumb);
+}
+END_TEST
+
+/**
+ * @addtogroup ethumb_thumb_path_get
+ * @{
+ * @objective Negative test case checks if function doesn't cause segmentation fault
+ * if it is called with NULL instead of any argument.
+ * @n Input Data:
+ * @li Ethumb object;
+ * @li pointer to variable to write thumb path;
+ * @li pointer to variable to write thumb key.
+ *
+ * @procedure
+ * @step 1 Create new Ethumb object.
+ * @step 2 Call function 3 times and pass (in turn) NULL instead of each argument.
+ *
+ * @passcondition Function doesn't cause segmentation fault.
+ * @}
+ */
+START_TEST(utc_ethumb_thumb_path_get_n)
+{
+   const char *path = NULL;
+   const char *key = NULL;
+   Ethumb *thumb = ethumb_new();
+
+   if (!thumb)
+     {
+        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Ethumb object is not created..", __FILE__, __LINE__);
+     }
+
+   UNITEST_FUNC_NEG(ethumb_thumb_path_get, thumb, &path, &key);
+
+   printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
+   ethumb_free(thumb);
+}
+END_TEST
+
+/**
+ *@}
+ */
+Suite *
+test_suite(void)
+{
+   Suite *suite = suite_create("utc_ethumb_thumb_path_get_set");
+
+   TCase *tcase = tcase_create("TCase");
+   tcase_set_timeout(tcase, 30);
+   tcase_add_checked_fixture(tcase, setup, teardown);
+   tcase_add_test(tcase, utc_ethumb_thumb_path_set_p);
+   tcase_add_test(tcase, utc_ethumb_thumb_path_set_n);
+   tcase_add_test(tcase, utc_ethumb_thumb_path_get_n);
+   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_ethumb_thumb_path_get_set.log");
+   srunner_set_xml(srunner, "utc_ethumb_thumb_path_get_set.xml");
+   srunner_run_all(srunner, CK_NORMAL);
+   number_failed = srunner_ntests_failed(srunner);
+   srunner_free(srunner);
+
+   return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
+}
diff --git a/TC/ethumb/ethumb/utc_ethumb_thumb_path_set.c b/TC/ethumb/ethumb/utc_ethumb_thumb_path_set.c
deleted file mode 100644 (file)
index 39f0a3a..0000000
+++ /dev/null
@@ -1,148 +0,0 @@
-#include <check.h>
-#include <Ethumb.h>
-#include "../../utc_negative_unitest.h"
-static const char *THUMB_PATH = "test_path.file";
-static const char *THUMB_KEY = "test_key";
-
-/**
- * @addtogroup ethumb
- * @{
- * @defgroup ethumb_thumb_path_set ethumb_thumb_path_set()
- *
- * @precondition
- * @step 1 Initialization with ethumb_init()
- * @}
- */
-static void
-setup(void)
-{
-   printf(" ============ Startup ============ \n");
-   ethumb_init();
-}
-
-static void
-teardown(void)
-{
-   printf(" ============ Cleanup ============ \n");
-   ethumb_shutdown();
-}
-
-/**
- * @addtogroup ethumb_thumb_path_set
- * @{
- * @objective Positive test case checks if function sets right path and key of a thumb properly.
- * @n Input Data:
- * @li Ethumb object;
- * @li "test_file_set.file" - thumb file to set for the object;
- * @li "test_key" - key to set for the object.
- *
- * @procedure
- * @step 1 Create new Ethumb object.
- * @step 2 Set path of a thumb Ethumb to "test_path.file" and key to "test_key".
- * @step 3 Check path and key of a thumb.
- *
- * @passcondition Path is not NULL and key is equal "test_key".
- * @}
- */
-START_TEST(utc_ethumb_thumb_path_set_p)
-{
-   const char *path = NULL;
-   const char *key = NULL;
-   int result = TEST_FAIL;
-   Ethumb *thumb = ethumb_new();
-
-   if (!thumb)
-     {
-        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Ethumb object is not created..", __FILE__, __LINE__);
-        return;
-     }
-   ethumb_thumb_path_set(thumb, THUMB_PATH, THUMB_KEY);
-   ethumb_thumb_path_get(thumb, &path, &key);
-
-   if (!path)
-     {
-        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Path is NULL..", __FILE__, __LINE__);
-     }
-   else if (!key)
-     {
-        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Key is NULL..", __FILE__, __LINE__);
-     }
-   else if (strcmp(key, THUMB_KEY))
-     {
-        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Key doesn't match with initial one..", __FILE__, __LINE__);
-     }
-   else
-     {
-        printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
-        result = TEST_PASS;
-     }
-   ethumb_free(thumb);
-}
-END_TEST
-
-/**
- * @addtogroup ethumb_thumb_path_set
- * @{
- * @objective Negative test case checks if function doesn't cause segmentation fault
- * if it is called with NULL instead of any argument.
- * @n Input Data:
- * @li Ethumb object;
- * @li pointer to variable to write thumb file path;
- * @li pointer to variable to write thumb key.
- *
- * @procedure
- * @step 1 Create new Ethumb object.
- * @step 2 Call function 3 times and pass (in turn) NULL instead of each argument.
- *
- * @passcondition Function doesn't cause segmentation fault.
- * @}
- */
-START_TEST(utc_ethumb_thumb_path_set_n)
-{
-   Ethumb *thumb = ethumb_new();
-
-   if (!thumb)
-     {
-        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Ethumb object is not created..", __FILE__, __LINE__);
-        return;
-     }
-
-   UNITEST_FUNC_NEG(ethumb_thumb_path_set, thumb, THUMB_PATH, THUMB_KEY);
-
-   printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
-   ethumb_free(thumb);
-}
-END_TEST
-/**
- *@}
- */
-Suite *
-test_suite(void)
-{
-   Suite *suite = suite_create("utc_ethumb_thumb_path_set");
-
-   TCase *tcase = tcase_create("TCase");
-   tcase_set_timeout(tcase, 30);
-   tcase_add_checked_fixture(tcase, setup, teardown);
-   tcase_add_test(tcase, utc_ethumb_thumb_path_set_p);
-   tcase_add_test(tcase, utc_ethumb_thumb_path_set_n);
-   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_ethumb_thumb_path_set.log");
-   srunner_set_xml(srunner, "utc_ethumb_thumb_path_set.xml");
-   srunner_run_all(srunner, CK_NORMAL);
-   number_failed = srunner_ntests_failed(srunner);
-   srunner_free(srunner);
-
-   return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
-}