-utc_eina_error_find.c
-utc_eina_error_get.c
-utc_eina_error_msg_modify.c
-utc_eina_error_msg_register.c
-utc_eina_error_msg_static_register.c
-utc_eina_error_msg_get.c
-utc_eina_error_set.c
+utc_eina_error.c
-utc_eina_error_find.c
-utc_eina_error_get.c
-utc_eina_error_msg_modify.c
-utc_eina_error_msg_register.c
-utc_eina_error_msg_static_register.c
-utc_eina_error_msg_get.c
-utc_eina_error_set.c
+utc_eina_error.c
-utc_eina_error_find.c
-utc_eina_error_get.c
-utc_eina_error_msg_modify.c
-utc_eina_error_msg_register.c
-utc_eina_error_msg_static_register.c
-utc_eina_error_msg_get.c
-utc_eina_error_set.c
+utc_eina_error.c
-utc_eina_error_find.c
-utc_eina_error_get.c
-utc_eina_error_msg_modify.c
-utc_eina_error_msg_register.c
-utc_eina_error_msg_static_register.c
-utc_eina_error_msg_get.c
-utc_eina_error_set.c
+utc_eina_error.c
--- /dev/null
+#include <check.h>
+#include <Eina.h>
+
+/**
+ * @addtogroup eina
+ * @{
+ * @defgroup eina_error
+ *
+ *
+ * @precondition
+ * @step 1 Initialize eina library with eina_init()
+ */
+static void
+setup(void)
+{
+ printf(" ============ Startup ============ \n");
+ eina_init();
+}
+
+static void
+teardown(void)
+{
+ printf(" ============ Cleanup ============ \n");
+ eina_shutdown();
+}
+
+/**
+ * @addtogroup eina_error
+ * @{
+ * @defgroup eina_error_pack_p
+ * @li eina_error_msg_static_register()
+ * @li eina_error_msg_modify()
+ * @li eina_error_msg_get()
+ * @li eina_error_msg_register()
+ * @li eina_error_find()
+ * @li eina_error_set()
+ * @li eina_error_get()
+ * @{
+ * @objective Positive test case 01 checking if the functions works correctly and without errors.
+ *
+ * @procedure
+ * @step 1 Register new error type with text "test" by call eina_error_msg_static_register().
+ * @step 2 Call eina_error_find() to find error.
+ * @step 3 Check if codes of found error and registered error are the same.
+ * @step 4 Call eina_error_msg_modify() to modify error message and check returned value.
+ * @step 5 Call eina_error_msg_get() and check result.
+ * @step 6 Register second error type with the same text "ABCD".
+ * @step 7 Check if returned values are greater than 0 and are not equal
+ * (due to documentation function should return unique identifiers).
+ * @step 8 Register first error type with text "test" by call eina_error_msg_register().
+ * @step 9 Register second error type with the same text.
+ * @step 10 Check if returned values are greater than 0 and are not equal
+ * (due to documentation function should return unique identifiers).
+ * @step 11 Get error before set error.
+ * @step 12 Set error by call eina_error_set().
+ * @step 13 Get error by call eina_error_get() and check result.
+ * @step 14 Set error that is less than 0.
+ * @step 15 Get error and check result.
+ * @step 16 Set error that is equal 0.
+ * @step 17 Get error and check result.
+ *
+ * @passcondition Test passes if returned values are the same as add values.
+ * @}
+ * @}
+ */
+START_TEST(utc_eina_error_pack_p)
+{
+ const char *text = "ABCD";
+ Eina_Error error1, error2, error3, error4;
+ Eina_Error ret;
+
+ error1 = eina_error_msg_static_register("test");
+ if (error1 <= 0)
+ {
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. New Eina_Error is not registered..", __FILE__, __LINE__);
+ }
+
+ ret = eina_error_find(text);
+ if (ret > 0)
+ {
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
+ }
+ ret = eina_error_find("test");
+ if (ret != error1)
+ {
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
+ }
+
+ if (eina_error_msg_modify(error1 + 1, text) == EINA_TRUE)
+ {
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Function has returned EINA_TRUE for error+1..", __FILE__, __LINE__);
+ }
+ else if (eina_error_msg_modify(0, text) == EINA_TRUE)
+ {
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Function has returned EINA_TRUE for error=0..", __FILE__, __LINE__);
+ }
+ else if (eina_error_msg_modify(error1, text) == EINA_FALSE)
+ {
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Function has returned EINA_FALSE..", __FILE__, __LINE__);
+ }
+
+ const char *ret_msg = eina_error_msg_get(error1);
+ if (!ret_msg || strcmp(ret_msg, text))
+ {
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Set and got texts don't match..", __FILE__, __LINE__);
+ }
+
+ error2 = eina_error_msg_static_register(text);
+ if (error1 <= 0 || error2 <= 0 || error1 == error2)
+ {
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
+ }
+
+ error3 = eina_error_msg_register("test");
+ error4 = eina_error_msg_register("test");
+ if (error3 <= 0 || error4 <= 0 || error3 == error4)
+ {
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
+ }
+
+ if (eina_error_get() != 0)
+ {
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
+ }
+ eina_error_set(error1);
+ if (eina_error_get() != error1)
+ {
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
+ }
+
+ eina_error_set(-156);
+ if (eina_error_get() != -156)
+ {
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
+ }
+
+ eina_error_set(0);
+ if (eina_error_get() != 0)
+ {
+ 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_eina_error");
+
+ TCase *tcase = tcase_create("TCase");
+ tcase_set_timeout(tcase, 30);
+ tcase_add_checked_fixture(tcase, setup, teardown);
+ tcase_add_test(tcase, utc_eina_error_pack_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_eina_error.log");
+ srunner_set_xml(srunner, "utc_eina_error.xml");
+ srunner_run_all(srunner, CK_NORMAL);
+ number_failed = srunner_ntests_failed(srunner);
+ srunner_free(srunner);
+
+ return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
+}
+++ /dev/null
-#include <check.h>
-#include <Eina.h>
-#include "../../utc_negative_unitest.h"
-
-/**
- * @addtogroup eina_error
- * @{
- * @defgroup eina_error_find eina_error_find()
- *
- *
- * @precondition
- * @step 1 Initialize eina library with eina_init()
- */
-static void
-setup(void)
-{
- printf(" ============ Startup ============ \n");
- eina_init();
-}
-
-static void
-teardown(void)
-{
- printf(" ============ Cleanup ============ \n");
- eina_shutdown();
-}
-
-/**
- * @addtogroup eina_error_find
- * @{
- * @objective Positive test case checks if function finds error corresponding to a message string properly.
- * @n Input Data: "test" as description of the error.
- *
- * @procedure
- * @step 1 Register new error type with text "test"
- * @step 2 Call tested function to find error
- * @step 3 Check if codes of found error and registered error are the same
- *
- * @passcondition Function returns positive value that are equal to registered error.
- * @}
- */
-START_TEST(utc_eina_error_find_p)
-{
- Eina_Error error = eina_error_msg_static_register("test");
-
- if (error <= 0)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. New Eina_Error is not registered..", __FILE__, __LINE__);
- }
- Eina_Error ret = eina_error_find("test");
-
- if (ret != error)
- {
- 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
-
-/**
- * @addtogroup eina_error_find
- * @{
- * @objective Negative test 01 case checks if function doesn't cause segmentation fault
- * and returns 0 if it is called with NULL instead of error name.
- * @n Input Data: NULL as name of the error.
- *
- * @procedure
- * @step 1 Call function and pass NULL instead of its argument
- *
- * @passcondition Function doesn't cause segmentation fault and returns 0.
- * @}
- */
-START_TEST(utc_eina_error_find_n)
-{
-
- if (UNITEST_FUNC_NEG_RET(0, eina_error_find, NULL) == TEST_FAIL)
- {
- 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
-
-/**
- * @addtogroup eina_error_find
- * @{
- * @objective Negative test 02 case checks if function doesn't cause segmentation fault
- * and returns 0 if it is called with unregistered error.
- * @n Input Data: "ABCD" as name of the error.
- *
- * @procedure
- * @step 1 Call function and pass unregistered error
- *
- * @passcondition Function doesn't cause segmentation fault and returns 0.
- * @}
- */
-START_TEST(utc_eina_error_find_n2)
-{
-
- Eina_Error error = eina_error_find("ABCD");
-
- if (error > 0)
- {
- 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_eina_error_find");
-
- TCase *tcase = tcase_create("TCase");
- tcase_set_timeout(tcase, 30);
- tcase_add_checked_fixture(tcase, setup, teardown);
- tcase_add_test(tcase, utc_eina_error_find_p);
- tcase_add_test(tcase, utc_eina_error_find_n);
- tcase_add_test(tcase, utc_eina_error_find_n2);
- 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_eina_error_find.log");
- srunner_set_xml(srunner, "utc_eina_error_find.xml");
- srunner_run_all(srunner, CK_NORMAL);
- number_failed = srunner_ntests_failed(srunner);
- srunner_free(srunner);
-
- return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
-}
+++ /dev/null
-#include <check.h>
-#include <Eina.h>
-
-/**
- * @addtogroup eina_error
- * @{
- * @defgroup eina_error_get eina_error_get()
- *
- *
- * @precondition
- * @step 1 Initialize eina library with eina_init()
- */
-static void
-setup(void)
-{
- printf(" ============ Startup ============ \n");
- eina_init();
-}
-
-static void
-teardown(void)
-{
- printf(" ============ Cleanup ============ \n");
- eina_shutdown();
-}
-
-/**
- * @addtogroup eina_error_get
- * @{
- * @objective Positive test case 01 checks if function returns proper last error identifier.
- * @n Input Data: function has no arguments.
- *
- * @procedure
- * @step 1 Register new error type with text "test"
- * @step 2 Set the error
- * @step 3 Get the error
- *
- * @passcondition Function returns last error properly, set and got values of the error are equals.
- * @}
- */
-START_TEST(utc_eina_error_get_p)
-{
- Eina_Error error = eina_error_msg_static_register("test");
-
- if (error <= 0)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. New Eina_Error is not registered..", __FILE__, __LINE__);
- }
- eina_error_set(error);
-
- if (eina_error_get() != error)
- {
- 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
-
-/**
- * @addtogroup eina_error_get
- * @{
- * @objective Positive test case 02 checks if function returns any number (but not NULL and there wasn't any errors previously).
- * @n Input Data: function has no arguments.
- *
- * @procedure
- * @step 1 Get the error
- *
- * @passcondition Function returns NULL.
- * @}
- */
-START_TEST(utc_eina_error_get_p2)
-{
- if (eina_error_get() != NULL)
- {
- 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_eina_error_get");
-
- TCase *tcase = tcase_create("TCase");
- tcase_set_timeout(tcase, 30);
- tcase_add_checked_fixture(tcase, setup, teardown);
- tcase_add_test(tcase, utc_eina_error_get_p);
- tcase_add_test(tcase, utc_eina_error_get_p2);
- 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_eina_error_get.log");
- srunner_set_xml(srunner, "utc_eina_error_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;
-}
+++ /dev/null
-#include <check.h>
-#include <Eina.h>
-#include <string.h>
-
-/**
- * @addtogroup eina_error
- * @{
- * @defgroup eina_error_msg_get eina_error_msg_get()
- *
- *
- * @precondition
- * @step 1 Initialize eina library with eina_init()
- */
-static void
-setup(void)
-{
- printf(" ============ Startup ============ \n");
- eina_init();
-}
-
-static void
-teardown(void)
-{
- printf(" ============ Cleanup ============ \n");
- eina_shutdown();
-}
-
-/**
- * @addtogroup eina_error_msg_get
- * @{
- * @objective Positive test case checks if function return the description of the given error number properly.
- * @n Input Data: number of registered error.
- *
- * @procedure
- * @step 1 Register new error type with text "test"
- * @step 2 Call tested function to get the error description
- * @step 3 Check returned value is the same that was registered
- *
- * @passcondition Function returns proper description of the error, the same as description of error
- * that has been registered before.
- * @}
- */
-START_TEST(utc_eina_error_msg_get_p)
-{
- const char *text = "test";
- Eina_Error error = eina_error_msg_static_register(text);
-
- if (error <= 0)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. New Eina_Error is not registered..", __FILE__, __LINE__);
- }
- const char *ret = eina_error_msg_get(error);
-
- if (!ret || strcmp(ret, text))
- {
- 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
-
-/**
- * @addtogroup eina_error_msg_get
- * @{
- * @objective Negative test case checks if function doesn't cause segmentation fault
- * and returns NULL if it is called with unregistered error.
- * @n Input Data: registered error + 1 and 0 for first/second call.
- *
- * @procedure
- * @step 1 Register new error type with text "test"
- * @step 2 Call function and pass error number got on step 1 and increased on 1
- * @step 3 Call function and pass 0 as error number
- *
- * @passcondition Function doesn't cause segmentation fault and returns NULL in both cases.
- * @}
- */
-START_TEST(utc_eina_error_msg_get_n)
-{
- Eina_Error error = eina_error_msg_static_register("test");
-
- if (error <= 0)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. New Eina_Error is not registered..", __FILE__, __LINE__);
- }
- else if (eina_error_msg_get(error + 1))
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
- }
- else if (eina_error_msg_get(0))
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
- }
- else
- {
- printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
- }
-}
-END_TEST
-/**
- * @}
- */
-Suite *
-test_suite(void)
-{
- Suite *suite = suite_create("utc_eina_error_msg_get");
-
- TCase *tcase = tcase_create("TCase");
- tcase_set_timeout(tcase, 30);
- tcase_add_checked_fixture(tcase, setup, teardown);
- tcase_add_test(tcase, utc_eina_error_msg_get_p);
- tcase_add_test(tcase, utc_eina_error_msg_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_eina_error_msg_get.log");
- srunner_set_xml(srunner, "utc_eina_error_msg_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;
-}
+++ /dev/null
-#include <check.h>
-#include <Eina.h>
-#include "../../utc_negative_unitest.h"
-
-/**
- * @addtogroup eina_error
- * @{
- * @defgroup eina_error_msg_modify eina_error_msg_modify()
- *
- *
- * @precondition
- * @step 1 Initialize eina library with eina_init()
- */
-static void
-setup(void)
-{
- printf(" ============ Startup ============ \n");
- eina_init();
-}
-
-static void
-teardown(void)
-{
- printf(" ============ Cleanup ============ \n");
- eina_shutdown();
-}
-
-/**
- * @addtogroup eina_error_msg_modify
- * @{
- * @objective Positive test case checks if function modifies the description of registered error properly.
- * @n Input Data:
- * @li number of registered error;
- * @li "ABCD" as new description message.
- *
- * @procedure
- * @step 1 Register new error type with text "test"
- * @step 2 Call tested function to modify error message and check returned value
- * @step 3 Get description of the error and compare with value passed to tested function
- *
- * @passcondition Function returns EINA_TRUE, got description of the error is the same as passed to tested function.
- * @}
- */
-START_TEST(utc_eina_error_msg_modify_p)
-{
- const char *text = "ABCD";
- Eina_Error error = eina_error_msg_static_register("test");
-
- if (error <= 0)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. New Eina_Error is not registered..", __FILE__, __LINE__);
- }
- else if (eina_error_msg_modify(error, text) == EINA_FALSE)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Function has returned EINA_FALSE..", __FILE__, __LINE__);
- }
- else
- {
- const char *ret = eina_error_msg_get(error);
-
- if (!ret || strcmp(ret, text))
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Set and got texts don't match..", __FILE__, __LINE__);
- }
- else
- {
- printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
- }
- }
-}
-END_TEST
-
-/**
- * @addtogroup eina_error_msg_modify
- * @{
- * @objective Negative test case 1 checks if function doesn't cause segmentation fault
- * and returns EINA_FALSE if it is called with NULL as new description of the error.
- * @n Input Data:
- * @li number of registered error;
- * @li NULL as new description.
- *
- * @procedure
- * @step 1 Register new error type with text "test"
- * @step 2 Call function and pass NULL as new error description
- * @step 3 Get description of the error and compare with initial value set when the error was being registered
- *
- * @passcondition Function doesn't cause segmentation fault, returns EINA_FALSE and doesn't
- * modify description of given error.
- * @}
- */
-START_TEST(utc_eina_error_msg_modify_n)
-{
- const char *text = "test";
- Eina_Error error = eina_error_msg_static_register(text);
-
- if (error <= 0)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. New Eina_Error is not registered..", __FILE__, __LINE__);
- }
- else if (UNITEST_FUNC_NEG_RET(EINA_FALSE, eina_error_msg_modify, error, NULL) == TEST_FAIL)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Function has returned EINA_TRUE..", __FILE__, __LINE__);
- }
- else
- {
- const char *ret = eina_error_msg_get(error);
-
- if (!ret || strcmp(ret, text))
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Error text is modified..", __FILE__, __LINE__);
- }
- else
- {
- printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
- }
- }
-}
-END_TEST
-
-/**
- * @addtogroup eina_error_msg_modify
- * @{
- * @objective Negative test case 2 checks if function doesn't cause segmentation fault
- * and returns EINA_FALSE if it is called with unregistered error.
- * @n Input Data:
- * @li registered error + 1 and 0 for first/second call;
- * @li "ABCD" as new description message.
- *
- * @procedure
- * @step 1 Register new error type with text "test"
- * @step 2 Call function and pass error number got on step 1 and increased on 1
- * @step 3 Call function and pass 0 as error number
- *
- * @passcondition Function doesn't cause segmentation fault and returns EINA_FALSE in both cases.
- * @}
- */
-START_TEST(utc_eina_error_msg_modify_n2)
-{
- Eina_Error error = eina_error_msg_static_register("test");
-
- if (error <= 0)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. New Eina_Error is not registered..", __FILE__, __LINE__);
- }
- else if (eina_error_msg_modify(error + 1, "ABCD") == EINA_TRUE)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Function has returned EINA_TRUE for error+1..", __FILE__, __LINE__);
- }
- else if (eina_error_msg_modify(0, "ABCD") == EINA_TRUE)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Function has returned EINA_TRUE for error=0..", __FILE__, __LINE__);
- }
- else
- {
- printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
- }
-}
-END_TEST
-/**
- * @}
- */
-Suite *
-test_suite(void)
-{
- Suite *suite = suite_create("utc_eina_error_msg_modify");
-
- TCase *tcase = tcase_create("TCase");
- tcase_set_timeout(tcase, 30);
- tcase_add_checked_fixture(tcase, setup, teardown);
- tcase_add_test(tcase, utc_eina_error_msg_modify_p);
- tcase_add_test(tcase, utc_eina_error_msg_modify_n);
- tcase_add_test(tcase, utc_eina_error_msg_modify_n2);
- 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_eina_error_msg_modify.log");
- srunner_set_xml(srunner, "utc_eina_error_msg_modify.xml");
- srunner_run_all(srunner, CK_NORMAL);
- number_failed = srunner_ntests_failed(srunner);
- srunner_free(srunner);
-
- return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
-}
+++ /dev/null
-#include <check.h>
-#include <Eina.h>
-#include "../../utc_negative_unitest.h"
-
-/**
- * @addtogroup eina_error
- * @{
- * @defgroup eina_error_msg_register eina_error_msg_register()
- *
- *
- * @precondition
- * @step 1 Initialize eina library with eina_init()
- */
-static void
-setup(void)
-{
- printf(" ============ Startup ============ \n");
- eina_init();
-}
-
-static void
-teardown(void)
-{
- printf(" ============ Cleanup ============ \n");
- eina_shutdown();
-}
-
-/**
- * @addtogroup eina_error_msg_register
- * @{
- * @objective Positive test case checks if function registers new errors type and properly.
- * @n Input Data: "test" as description of the error.
- *
- * @procedure
- * @step 1 Register first error type with text "test"
- * @step 2 Register second error type with the same text
- * @step 3 Check if returned values are grater than 0 and are not equal
- * (due to documentation function should return unique identifiers).
- *
- * @passcondition Function returns different positive values for 2 new errors.
- * @}
- */
-START_TEST(utc_eina_error_msg_register_p)
-{
- Eina_Error error1 = eina_error_msg_register("test");
- Eina_Error error2 = eina_error_msg_register("test");
-
- if (error1 <= 0 || error2 <= 0 || error1 == error2)
- {
- 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
-
-/**
- * @addtogroup eina_error_msg_register
- * @{
- * @objective Negative test case checks if function doesn't cause segmentation fault
- * and returns 0 if it is called with NULL instead of error name.
- * @n Input Data: NULL as name of the error.
- *
- * @procedure
- * @step 1 Call function and pass NULL instead of its argument.
- *
- * @passcondition Function doesn't cause segmentation fault and returns 0.
- * @}
- */
-START_TEST(utc_eina_error_msg_register_n)
-{
-
- if (UNITEST_FUNC_NEG_RET(0, eina_error_msg_register, NULL) == TEST_FAIL)
- {
- 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_eina_error_msg_register");
-
- TCase *tcase = tcase_create("TCase");
- tcase_set_timeout(tcase, 30);
- tcase_add_checked_fixture(tcase, setup, teardown);
- tcase_add_test(tcase, utc_eina_error_msg_register_p);
- tcase_add_test(tcase, utc_eina_error_msg_register_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_eina_error_msg_register.log");
- srunner_set_xml(srunner, "utc_eina_error_msg_register.xml");
- srunner_run_all(srunner, CK_NORMAL);
- number_failed = srunner_ntests_failed(srunner);
- srunner_free(srunner);
-
- return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
-}
+++ /dev/null
-#include <check.h>
-#include <Eina.h>
-#include "../../utc_negative_unitest.h"
-
-/**
- * @addtogroup eina_error
- * @{
- * @defgroup eina_error_msg_static_register eina_error_msg_static_register()
- *
- *
- * @precondition
- * @step 1 Initialize eina library with eina_init()
- */
-static void
-setup(void)
-{
- printf(" ============ Startup ============ \n");
- eina_init();
-}
-
-static void
-teardown(void)
-{
- printf(" ============ Cleanup ============ \n");
- eina_shutdown();
-}
-
-/**
- * @addtogroup eina_error_msg_static_register
- * @{
- * @objective Positive test case checks if function registers new errors type with statically
- * allocated messages properly.
- * @n Input Data: "test" as description of the error.
- *
- * @procedure
- * @step 1 Register first error type with text "test"
- * @step 2 Register second error type with the same text
- * @step 3 Check if returned values are grater than 0 and are not equal
- * (due to documentation function should return unique identifiers).
- *
- * @passcondition Function returns different positive values for 2 new errors.
- * @}
- */
-START_TEST(utc_eina_error_msg_static_register_p)
-{
- Eina_Error error1 = eina_error_msg_static_register("test");
- Eina_Error error2 = eina_error_msg_static_register("test");
-
- if (error1 <= 0 || error2 <= 0 || error1 == error2)
- {
- 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
-
-/**
- * @addtogroup eina_error_msg_static_register
- * @{
- * @objective Negative test case checks if function doesn't cause segmentation fault
- * and returns 0 if it is called with NULL instead of error name.
- * @n Input Data: NULL as name of the error.
- *
- * @procedure
- * @step 1 Call function and pass NULL instead of its argument.
- *
- * @passcondition Function doesn't cause segmentation fault and returns 0.
- * @}
- */
-START_TEST(utc_eina_error_msg_static_register_n)
-{
-
- if (UNITEST_FUNC_NEG_RET(0, eina_error_msg_static_register, NULL) == TEST_FAIL)
- {
- 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_eina_error_msg_static_register");
-
- TCase *tcase = tcase_create("TCase");
- tcase_set_timeout(tcase, 30);
- tcase_add_checked_fixture(tcase, setup, teardown);
- tcase_add_test(tcase, utc_eina_error_msg_static_register_p);
- tcase_add_test(tcase, utc_eina_error_msg_static_register_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_eina_error_msg_static_register.log");
- srunner_set_xml(srunner, "utc_eina_error_msg_static_register.xml");
- srunner_run_all(srunner, CK_NORMAL);
- number_failed = srunner_ntests_failed(srunner);
- srunner_free(srunner);
-
- return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
-}
+++ /dev/null
-#include <check.h>
-#include <Eina.h>
-
-/**
- * @addtogroup eina_error
- * @{
- * @defgroup eina_error_set eina_error_set()
- *
- *
- * @precondition
- * @step 1 Initialize eina library with eina_init()
- */
-static void
-setup(void)
-{
- printf(" ============ Startup ============ \n");
- eina_init();
-}
-
-static void
-teardown(void)
-{
- printf(" ============ Cleanup ============ \n");
- eina_shutdown();
-}
-
-/**
- * @addtogroup eina_error_set
- * @{
- * @objective Positive test case 01 checks if function sets the last error identifier properly.
- * @n Input Data: registered error number.
- *
- * @procedure
- * @step 1 Register new error type with text "test"
- * @step 2 Set the error
- * @step 3 Get the error
- *
- * @passcondition Function sets last error properly, set and got values of the error are equals.
- * @}
- */
-START_TEST(utc_eina_error_set_p)
-{
- Eina_Error error = eina_error_msg_static_register("test");
-
- if (error <= 0)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. New Eina_Error is not registered..", __FILE__, __LINE__);
- }
- eina_error_set(error);
-
- if (eina_error_get() != error)
- {
- 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
-
-/**
- * @addtogroup eina_error_set
- * @{
- * @objective Positive test case 02 checks if function sets the last error identifier properly.
- * @n Input Data: registered error number.
- *
- * @procedure
- * @step 1 Set the error that is less than 0
- * @step 2 Get the error
- *
- * @passcondition Function sets last error properly, set and got values of the error are equals.
- * @}
- */
-START_TEST(utc_eina_error_set_p2)
-{
- Eina_Error error = -563;
-
- eina_error_set(error);
-
- if (eina_error_get() != error)
- {
- 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
-
-/**
- * @addtogroup eina_error_set
- * @{
- * @objective Positive test case 03 checks if function sets the last error identifier properly.
- * @n Input Data: registered error number.
- *
- * @procedure
- * @step 1 Set the error that is equal 0
- * @step 2 Get the error
- *
- * @passcondition Function sets last error properly, set and got values of the error are equals.
- * @}
- */
-START_TEST(utc_eina_error_set_p3)
-{
- Eina_Error error = 0;
-
- eina_error_set(error);
-
- if (eina_error_get() != error)
- {
- 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_eina_error_set");
-
- TCase *tcase = tcase_create("TCase");
- tcase_set_timeout(tcase, 30);
- tcase_add_checked_fixture(tcase, setup, teardown);
- tcase_add_test(tcase, utc_eina_error_set_p);
- tcase_add_test(tcase, utc_eina_error_set_p2);
- tcase_add_test(tcase, utc_eina_error_set_p3);
- 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_eina_error_set.log");
- srunner_set_xml(srunner, "utc_eina_error_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;
-}