-utc_eet_node_array_new.c
-utc_eet_node_char_new.c
-utc_eet_node_children_get.c
-utc_eet_node_del.c
-utc_eet_node_double_new.c
-utc_eet_node_float_new.c
-utc_eet_node_hash_new.c
-utc_eet_node_inlined_string_new.c
-utc_eet_node_int_new.c
-utc_eet_node_list_new.c
-utc_eet_node_long_long_new.c
-utc_eet_node_next_get.c
-utc_eet_node_null_new.c
-utc_eet_node_parent_get.c
-utc_eet_node_short_new.c
-utc_eet_node_string_new.c
-utc_eet_node_struct_child_new.c
-utc_eet_node_struct_new.c
-utc_eet_node_type_get.c
-utc_eet_node_unsigned_char_new.c
-utc_eet_node_unsigned_int_new.c
-utc_eet_node_unsigned_long_long_new.c
-utc_eet_node_unsigned_short_new.c
-utc_eet_node_value_get.c
-utc_eet_node_var_array_new.c
-utc_eet_node_dump.c
-utc_eet_node_hash_add.c
-utc_eet_node_list_append.c
-utc_eet_node_struct_append.c
-utc_eet_node_walk.c
+utc_eet_node.c
-utc_eet_node_array_new.c
-utc_eet_node_char_new.c
-utc_eet_node_children_get.c
-utc_eet_node_del.c
-utc_eet_node_double_new.c
-utc_eet_node_float_new.c
-utc_eet_node_hash_new.c
-utc_eet_node_inlined_string_new.c
-utc_eet_node_int_new.c
-utc_eet_node_list_new.c
-utc_eet_node_long_long_new.c
-utc_eet_node_next_get.c
-utc_eet_node_null_new.c
-utc_eet_node_parent_get.c
-utc_eet_node_short_new.c
-utc_eet_node_string_new.c
-utc_eet_node_struct_child_new.c
-utc_eet_node_struct_new.c
-utc_eet_node_type_get.c
-utc_eet_node_unsigned_char_new.c
-utc_eet_node_unsigned_int_new.c
-utc_eet_node_unsigned_long_long_new.c
-utc_eet_node_unsigned_short_new.c
-utc_eet_node_value_get.c
-utc_eet_node_var_array_new.c
-utc_eet_node_dump.c
-utc_eet_node_hash_add.c
-utc_eet_node_list_append.c
-utc_eet_node_struct_append.c
-utc_eet_node_walk.c
+utc_eet_node.c
-#utc_eet_node_array_new.c
-#utc_eet_node_char_new.c
-#utc_eet_node_children_get.c
-#utc_eet_node_del.c
-#utc_eet_node_double_new.c
-#utc_eet_node_float_new.c
-#utc_eet_node_hash_new.c
-#utc_eet_node_inlined_string_new.c
-#utc_eet_node_int_new.c
-#utc_eet_node_list_new.c
-#utc_eet_node_long_long_new.c
-#utc_eet_node_next_get.c
-#utc_eet_node_null_new.c
-#utc_eet_node_parent_get.c
-#utc_eet_node_short_new.c
-#utc_eet_node_string_new.c
-#utc_eet_node_struct_child_new.c
-#utc_eet_node_struct_new.c
-#utc_eet_node_type_get.c
-#utc_eet_node_unsigned_char_new.c
-#utc_eet_node_unsigned_int_new.c
-#utc_eet_node_unsigned_long_long_new.c
-#utc_eet_node_unsigned_short_new.c
-#utc_eet_node_value_get.c
-#utc_eet_node_var_array_new.c
-#utc_eet_node_dump.c
-#utc_eet_node_hash_add.c
-#utc_eet_node_list_append.c
-#utc_eet_node_struct_append.c
-#utc_eet_node_walk.c
+#utc_eet_node.c
-#utc_eet_node_array_new.c
-#utc_eet_node_char_new.c
-#utc_eet_node_children_get.c
-#utc_eet_node_del.c
-#utc_eet_node_double_new.c
-#utc_eet_node_float_new.c
-#utc_eet_node_hash_new.c
-#utc_eet_node_inlined_string_new.c
-#utc_eet_node_int_new.c
-#utc_eet_node_list_new.c
-#utc_eet_node_long_long_new.c
-#utc_eet_node_next_get.c
-#utc_eet_node_null_new.c
-#utc_eet_node_parent_get.c
-#utc_eet_node_short_new.c
-#utc_eet_node_string_new.c
-#utc_eet_node_struct_child_new.c
-#utc_eet_node_struct_new.c
-#utc_eet_node_type_get.c
-#utc_eet_node_unsigned_char_new.c
-#utc_eet_node_unsigned_int_new.c
-#utc_eet_node_unsigned_long_long_new.c
-#utc_eet_node_unsigned_short_new.c
-#utc_eet_node_value_get.c
-#utc_eet_node_var_array_new.c
-#utc_eet_node_dump.c
-#utc_eet_node_hash_add.c
-#utc_eet_node_list_append.c
-#utc_eet_node_struct_append.c
-#utc_eet_node_walk.c
+#utc_eet_node.c
--- /dev/null
+#include <check.h>
+#include <Eet.h>
+#include <float.h>
+#include <malloc.h>
+#include <Eina.h>
+#include <limits.h>
+#include "../../utc_negative_unitest.h"
+
+typedef struct _Res_Data Res_Data;
+struct _Res_Data
+{
+ char *res_str;
+ int res_str_size;
+};
+
+void output(void *data, const char *string)
+{
+ Res_Data *res_data = (Res_Data *)data;
+ int string_size = strlen(string);
+
+ if (!res_data->res_str)
+ {
+ res_data->res_str = (char *)calloc(string_size + 1, sizeof(char));
+ res_data->res_str_size = string_size;
+ memcpy(res_data->res_str, string, string_size);
+ }
+ else
+ {
+ res_data->res_str = (char *)realloc(res_data->res_str, (res_data->res_str_size + res_data->res_str_size + 1) * sizeof(char));
+ memcpy(&res_data->res_str[res_data->res_str_size], string, string_size);
+ res_data->res_str_size += string_size;
+ res_data->res_str[res_data->res_str_size] = 0;
+ }
+}
+
+static void *
+eet_node_walk_cb(int type, Eet_Node_Data *data, void *user_data)
+{
+ Eina_Bool *status = (Eina_Bool*)user_data;
+ *status = EINA_TRUE;
+
+ return data;
+}
+
+static void
+_struct_add_cb(void *parent, const char *name, void *child, void *user_data)
+{
+ Eet_Node *new_node = eet_node_int_new(name, ((Eet_Node_Data *)child)->value.i);
+
+ eet_node_struct_append(parent, name, new_node);
+}
+
+static Eet_Node *
+_struct_node_create(Eet_Node *node, const char *node_name)
+{
+ if (!node)
+ return NULL;
+
+ Eet_Node *eet_node = NULL;
+ Eina_List *node_list = NULL;
+
+ node_list = eina_list_append(NULL, node);
+
+ if (!node_list)
+ return NULL;
+
+ if (eet_node_struct_new(NULL, node_list) == NULL)
+ {
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. ", __FILE__, __LINE__);
+ }
+ else if (eet_node_struct_new("test_name", NULL) == NULL)
+ {
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. ", __FILE__, __LINE__);
+ }
+ eet_node = eet_node_struct_new(node_name, node_list);
+
+ if ((!eet_node) || (eet_node_type_get(eet_node) != EET_G_UNKNOWN))
+ return NULL;
+
+ return eet_node;
+}
+
+/**
+ * @addtogroup eet
+ * @{
+ * @defgroup eet_node
+ * eet_node_list_new
+ * eet_node_int_new
+ * eet_node_double_new
+ * eet_node_inlined_string_new
+ * eet_node_children_get
+ * eet_node_value_get
+ * eet_node_hash_new
+ * eet_node_walk
+ * eet_node_char_new
+ * eet_node_unsigned_short_new
+ * eet_node_short_new
+ * eet_node_hash_add
+ * eet_node_unsigned_long_long_new
+ * eet_node_var_array_new
+ * eet_node_array_new
+ * eet_node_struct_append
+ * eet_node_long_long_new
+ * eet_node_del
+ * eet_node_type_get
+ * eet_node_string_new
+ * eet_node_next_get
+ * eet_node_struct_child_new
+ * eet_node_null_new
+ * eet_node_parent_get
+ * eet_node_struct_new
+ * eet_node_unsigned_int_new
+ * eet_node_unsigned_char_new
+ * eet_node_list_append
+ * eet_node_dump
+ * eet_node_float_new
+ *
+ *
+ * @precondition
+ * @step 1 eet initialized with eet_init()
+ */
+static void
+setup(void)
+{
+ printf(" ============ Startup ============ \n");
+ eet_init();
+}
+
+static void
+teardown(void)
+{
+ printf(" ============ Cleanup ============ \n");
+ eet_shutdown();
+}
+
+/**
+ * @addtogroup eet_node
+ * @li eet_node_list_append()
+ * @li eet_node_children_get()
+ * @li eet_node_next_get()
+ * @li eet_node_value_get()
+ * @li eet_node_del()
+ * @li eet_node_var_array_new()
+ * @li eet_node_hash_add()
+ * @li eet_node_struct_child_new()
+ * @{
+ * @objective Positive test case checking if the functions works correctly and without errors.
+ *
+ * @procedure
+ * @step 1 Create new eet nodes to be hashed.
+ * @step 2 Initialization of pointer to hash Eet_Node with correct arguments.
+ * @step 3 Append eet_node_child with empty name to the list and check type node.
+ * @step 4 Append eet_node_child to the list and check type node.
+ * @step 5 Append eet_node_next to the list and check type node.
+ * @step 6 Get child node and check value node.
+ * @step 7 Get child next by call eet_node_next_get() and check value node.
+ * @step 8 Get child node without name and check value node.
+ * @step 9 Initialization of pointer to Eet_Node using eet_node_null_new.
+ * @step 10 Get child of the eet_node using function eet_node_children_get().
+ * @step 11 Del node by call eet_node_del()
+ * @step 12 Initialization of pointer to VAR_ARRAY Eet_Node with NULL instead of pointer to Eina_List with data.
+ * @step 13 Initialization of pointer to VAR_ARRAY Eet_Node with correct arguments.
+ * @step 14 Initialization of pointer to VAR_ARRAY Eet_Node with NULL instead of valid name.
+ * @step 15 Initialization of pointer to HASH Eet_Node with correct arguments.
+ * @step 16 Initialization of pointer to HASH Eet_Node with NULL child node.
+ * @step 17 Initialization of pointer to HASH Eet_Node with NULL key.
+ * @step 18 Create new struct node.
+ * @step 19 Append eet_node_child to struct with NULL name.
+ * @step 20 Check results.
+ * @step 21 Initialization of pointer to struct child Eet_Node with correct arguments.
+ * @step 22 Initialization of pointer to struct child Eet_Node with NULL instead of valid name.
+ * @step 23 Check results.
+ *
+ * @passcondition Test passes if returned values are the same as add values.
+ * @}
+ */
+START_TEST(utc_eet_node_pack_p)
+{
+ const char *parent_name = "test_parent";
+ const char *child_name = "test_child";
+ const char *child_key = "key_parent";
+ Eet_Node *eet_node_list = NULL;
+ Eet_Node *eet_node_rest = NULL;
+ Eet_Node *eet_node_rest2 = NULL;
+ Eet_Node *eet_node_next_res = NULL;
+ Eet_Node *eet_node_next_res2 = NULL;
+ Eet_Node *eet_node_parent = eet_node_int_new(parent_name, 1);
+ Eet_Node *eet_node_parent2 = eet_node_int_new(parent_name, 1);
+ Eet_Node *eet_node_child = eet_node_int_new(child_name, 2);
+ Eet_Node *eet_node_next = eet_node_int_new(child_name, 3);
+ Eet_Node *varray_node = NULL;
+ Eet_Node *hash_node = NULL;
+ Eet_Node *stc_node = NULL;
+ Eet_Node *struct_node = NULL;
+ Eina_List *eina_list = NULL;
+ Eet_Node *node = eet_node_null_new("test");
+
+ if ((!eet_node_parent) || (!eet_node_parent2) || (!eet_node_child) || (!eet_node_next))
+ {
+ if (eet_node_next)
+ eet_node_del(eet_node_next);
+
+ if (eet_node_child)
+ eet_node_del(eet_node_child);
+
+ if (eet_node_parent)
+ eet_node_del(eet_node_parent);
+
+ if (eet_node_parent2)
+ eet_node_del(eet_node_parent2);
+
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. ", __FILE__, __LINE__);
+ }
+
+ eet_node_list_append(eet_node_parent2, NULL, eet_node_child);
+ eet_node_list_append(eet_node_parent, child_name, eet_node_child);
+ eet_node_list_append(eet_node_parent, child_name, eet_node_next);
+
+ if (!(eet_node_list = eet_node_children_get(eet_node_parent)))
+ {
+ eet_node_del(eet_node_next);
+ eet_node_del(eet_node_child);
+ eet_node_del(eet_node_parent);
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. ", __FILE__, __LINE__);
+ }
+ if (eet_node_type_get(eet_node_list) != EET_G_LIST)
+ {
+ eet_node_del(eet_node_list);
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node has wrong type.. ", __FILE__, __LINE__);
+ }
+ if ((!(eet_node_rest = eet_node_children_get(eet_node_list))) || (eet_node_value_get(eet_node_rest)->value.i != 2))
+ {
+ eet_node_del(eet_node_list);
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. ", __FILE__, __LINE__);
+ }
+ if ((!(eet_node_next_res = eet_node_next_get(eet_node_rest))) || (eet_node_value_get(eet_node_next_res)->value.i != 3))
+ {
+ eet_node_del(eet_node_list);
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. ", __FILE__, __LINE__);
+ }
+ else if (eet_node_next_get(eet_node_next) != NULL)
+ {
+ eet_node_del(eet_node_list);
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. ", __FILE__, __LINE__);
+ }
+
+ if (!(eet_node_list = eet_node_children_get(eet_node_parent2)))
+ {
+ eet_node_del(eet_node_child);
+ eet_node_del(eet_node_parent);
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. ", __FILE__, __LINE__);
+ }
+ if (eet_node_type_get(eet_node_list) != EET_G_LIST)
+ {
+ eet_node_del(eet_node_list);
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node has wrong type.. ", __FILE__, __LINE__);
+ }
+ if ((!(eet_node_rest = eet_node_children_get(eet_node_list))) || (eet_node_value_get(eet_node_rest)->value.i != 2))
+ {
+ eet_node_del(eet_node_list);
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. ", __FILE__, __LINE__);
+ }
+
+ if ((eet_node_list = eet_node_children_get(node)))
+ {
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. ", __FILE__, __LINE__);
+ }
+
+ if (!(eina_list = eina_list_append(eina_list, node)))
+ {
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eina_List is not created..", __FILE__, __LINE__);
+ }
+ if (!(varray_node = eet_node_var_array_new("test", NULL)) ||
+ !(varray_node = eet_node_var_array_new(NULL, eina_list)) ||
+ !(varray_node = eet_node_var_array_new("test", eina_list)))
+ {
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Function has returned NULL..", __FILE__, __LINE__);
+ }
+ else if (eet_node_type_get(varray_node) != EET_G_VAR_ARRAY)
+ {
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node has wrong type..", __FILE__, __LINE__);
+ }
+
+ eet_node_hash_add(eet_node_parent, child_name, child_key, eet_node_child);
+ if (!(hash_node = eet_node_children_get(eet_node_parent)) || (eet_node_type_get(hash_node) != EET_G_HASH))
+ {
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. ", __FILE__, __LINE__);
+ }
+ eet_node_hash_add(eet_node_parent, NULL, child_key, eet_node_child);
+ if (!(hash_node = eet_node_children_get(eet_node_parent)) || (eet_node_type_get(hash_node) != EET_G_HASH))
+ {
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. ", __FILE__, __LINE__);
+ }
+ eet_node_hash_add(eet_node_parent, child_name, NULL, eet_node_child);
+ if (!(hash_node = eet_node_children_get(eet_node_parent)) || (eet_node_type_get(hash_node) != EET_G_HASH))
+ {
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. ", __FILE__, __LINE__);
+ }
+
+ struct_node = _struct_node_create(node, "test");
+
+ eet_node_struct_append(struct_node, NULL, eet_node_child);
+ if ((!(eet_node_rest2 = eet_node_children_get(struct_node))) || (eet_node_value_get(eet_node_rest2)->value.i != 0))
+ {
+ eet_node_del(struct_node);
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. ", __FILE__, __LINE__);
+ }
+ if ((!(eet_node_next_res2 = eet_node_next_get(eet_node_rest2))) || (eet_node_value_get(eet_node_next_res2)->value.i != 2))
+ {
+ eet_node_del(struct_node);
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. ", __FILE__, __LINE__);
+ }
+
+ if (!(stc_node = eet_node_struct_child_new("test", struct_node)) ||
+ !(stc_node = eet_node_struct_child_new(NULL, struct_node)))
+ {
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Function has returned NULL..", __FILE__, __LINE__);
+ }
+ else if (eet_node_type_get(stc_node) != EET_G_UNKNOWN)
+ {
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node has wrong type..", __FILE__, __LINE__);
+ }
+
+ printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
+
+ eet_node_del(struct_node);
+ eet_node_del(eet_node_list);
+}
+END_TEST
+
+/**
+ * @addtogroup eet_node
+ * @li eet_node_type_get()
+ * @li eet_node_int_new()
+ * @li eet_node_double_new()
+ * @li eet_node_list_new()
+ * @li eet_node_inlined_string_new()
+ * @li eet_node_float_new()
+ * @li eet_node_dump()
+ * @li eet_node_struct_new()
+ * @li eet_node_struct_append()
+ * @li eet_node_walk()
+ * @li eet_node_hash_new()
+ * @li eet_node_unsigned_long_long_new()
+ * @{
+ * @objective Positive test case checking if the functions works correctly and without errors.
+ *
+ * @procedure
+ * @step 1 Initialization of pointer to NULL Eet_Node with NULL instead of valid name.
+ * @step 2 Initialization of pointer to NULL Eet_Node with correct argument.
+ * @step 3 Create parent node as struct node by call eet_node_struct_new().
+ * @step 4 Append node to struct node by call eet_node_struct_append().
+ * @step 5 Create new Eina_List with one element.
+ * @step 6 Initialization of pointer to LIST Eet_Node with NULL instead of pointer to Eina_List with data.
+ * @step 7 Initialization of pointer to LIST Eet_Node with correct arguments.
+ * @step 8 Initialization of pointer to LIST Eet_Node with NULL instead of valid name.
+ * @step 9 Initialization of pointer to INT Eet_Node with name "test" and int 1.
+ * @step 10 Initialization of pointer to INT Eet_Node with NULL name and correct value.
+ * @step 11 Initialization of pointer to INT Eet_Node with name "test" and INT_MAX + 1.
+ * @step 12 Initialization of pointer to DBL Eet_Node with name "test" and int 1.0
+ * @step 13 Initialization of pointer to DBL Eet_Node with NULL name and correct value.
+ * @step 14 Initialization of pointer to DBL Eet_Node with name "test" and DBL_MAX + 1.0
+ * @step 15 Initialization of pointer to IN_STR Eet_Node with correct arguments.
+ * @step 16 Initialization of pointer to IN_STR Eet_Node with NULL instead of valid name.
+ * @step 17 Initialization of pointer to IN_STR Eet_Node with name "test" and NULL value.
+ * @step 18 Initialization of pointer to FLOAT Eet_Node with name "test" and int 1.0F
+ * @step 29 Initialization of pointer to FLOAT Eet_Node with NULL name and correct value.
+ * @step 20 Initialization of pointer to FLOAT Eet_Node with name "test" and FLT_MAX + 1.0F
+ * @step 21 Dump INT node by call eet_node_dump() and check dump data.
+ * @step 22 Walk on the INT root node and check node data.
+ * @step 23 Initialization of pointer to hash Eet_Node with NULL instead of key.
+ * @step 24 Initialization of pointer to hash Eet_Node with NULL instead of valid name.
+ * @step 25 Initialization of pointer to hash Eet_Node with correct arguments.
+ * @step 26 Dump HASH node by call eet_node_dump() and check dump data.
+ * @step 27 Initialization of pointer to ULONG_LONG Eet_Node with NULL instead of valid name.
+ * @step 28 Initialization of pointer to ULONG_LONG Eet_Node with correct arguments.
+ * @step 29 Initialization of pointer to ULONG_LONG Eet_Node with name "test" and incorrect value.
+ *
+ * @passcondition Returned pointer to Eet_Node is not NULL. Without segmentation fault.
+ * @}
+ */
+START_TEST(utc_eet_node_pack_p2)
+{
+ Eet_Node *list_node = NULL;
+ Eet_Node *int_node = NULL;
+ Eet_Node *dbl_node = NULL;
+ Eet_Node *flt_node = NULL;
+ Eet_Node *instr_node = NULL;
+ Eet_Node *hash_node = NULL;
+ Eet_Node *ull_node = NULL;
+ Eina_List *eina_list = NULL;
+ Eet_Node *node = NULL;
+ Res_Data res_data = (Res_Data){NULL, 0};
+ int res = 0;
+ int data_set_int = INT_MAX + 1;
+ Eet_Node *parent_node = NULL;
+ Eet_Node *eet_node_child = NULL;
+ Eet_Node_Data *node_data = NULL;
+ Eina_Bool status_cb = EINA_FALSE;
+ Eet_Node_Walk cb;
+
+ if (!(node = eet_node_null_new("NULL")) ||
+ !(node = eet_node_null_new("test")))
+ {
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node is not created..", __FILE__, __LINE__);
+ }
+ else if (eet_node_type_get(node) != EET_T_NULL)
+ {
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node has wrong type..", __FILE__, __LINE__);
+ }
+
+ parent_node = _struct_node_create(node, "test");
+ cb.simple = eet_node_walk_cb;
+ cb.struct_add = _struct_add_cb;
+ if (!parent_node)
+ {
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. ", __FILE__, __LINE__);
+ }
+
+ if (!(eina_list = eina_list_append(eina_list, node)))
+ {
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eina_List is not created..", __FILE__, __LINE__);
+ }
+ else if (!(list_node = eet_node_list_new("test", NULL)) ||
+ !(list_node = eet_node_list_new(NULL, eina_list)) ||
+ !(list_node = eet_node_list_new("test", eina_list)))
+ {
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Function has returned NULL..", __FILE__, __LINE__);
+ }
+ else if (eet_node_type_get(list_node) != EET_G_LIST)
+ {
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node has wrong type..", __FILE__, __LINE__);
+ }
+
+ if (!(int_node = eet_node_int_new("test", 1)) ||
+ !(int_node = eet_node_int_new(NULL, 1)) ||
+ !(int_node = eet_node_int_new("test", data_set_int)))
+ {
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Function has returned NULL..", __FILE__, __LINE__);
+ }
+ else if (eet_node_type_get(int_node) != EET_T_INT)
+ {
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node has wrong type..", __FILE__, __LINE__);
+ }
+
+ if (!(dbl_node = eet_node_double_new("test", 1.0)) ||
+ !(dbl_node = eet_node_double_new(NULL, 1.0)) ||
+ !(dbl_node = eet_node_double_new("test", DBL_MAX + 1)))
+ {
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Function has returned NULL..", __FILE__, __LINE__);
+ }
+ else if (eet_node_type_get(dbl_node) != EET_T_DOUBLE)
+ {
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node has wrong type..", __FILE__, __LINE__);
+ }
+
+ if (!(instr_node = eet_node_inlined_string_new("test", "inlined string")) ||
+ !(instr_node = eet_node_inlined_string_new(NULL, "inlined string")) ||
+ !(instr_node = eet_node_inlined_string_new("test", NULL)))
+ {
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Function has returned NULL..", __FILE__, __LINE__);
+ }
+ else if (eet_node_type_get(instr_node) != EET_T_INLINED_STRING)
+ {
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node has wrong type..", __FILE__, __LINE__);
+ }
+
+ if (!(flt_node = eet_node_float_new("test", 1.0F)) ||
+ !(flt_node = eet_node_float_new(NULL, 1.0F)) ||
+ !(flt_node = eet_node_float_new("test", FLT_MAX + 1)))
+ {
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Function has returned NULL..", __FILE__, __LINE__);
+ }
+ else if (eet_node_type_get(flt_node) != EET_T_FLOAT)
+ {
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node has wrong type..", __FILE__, __LINE__);
+ }
+
+ eet_node_dump(int_node, 1, output, &res_data);
+ if (!res_data.res_str)
+ {
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. incorrect dump node.. ", __FILE__, __LINE__);
+ }
+
+ sscanf(res_data.res_str, "%*s %*s %*s %d", &res);
+ if (res != data_set_int)
+ {
+ free(res_data.res_str);
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. incorrect dump value.. ", __FILE__, __LINE__);
+ }
+
+ if (!(node_data = eet_node_walk(parent_node, "test", int_node, &cb, &status_cb)))
+ {
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. ", __FILE__, __LINE__);
+ }
+ if ((!(eet_node_child = eet_node_next_get(eet_node_children_get(parent_node)))) || (eet_node_value_get(eet_node_child)->value.i != data_set_int))
+ {
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node has wrong type.. %d ", __FILE__, __LINE__, eet_node_value_get(eet_node_child)->value.i);
+ }
+ if ((node_data->value.i != data_set_int) || (!status_cb))
+ {
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. incorrect dump node.. ", __FILE__, __LINE__);
+ }
+
+ if (!(hash_node = eet_node_hash_new(NULL, "key", node)) ||
+ !(hash_node = eet_node_hash_new("test", NULL, node)) ||
+ !(hash_node = eet_node_hash_new("test", "key", node)))
+ {
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Function has returned NULL..", __FILE__, __LINE__);
+ }
+ else if (eet_node_type_get(hash_node) != EET_G_HASH)
+ {
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node has wrong type..", __FILE__, __LINE__);
+ }
+
+ eet_node_dump(hash_node, 1, output, &res_data);
+ if (!res_data.res_str)
+ {
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. incorrect dump node.. ", __FILE__, __LINE__);
+ }
+
+ if (!(ull_node = eet_node_unsigned_long_long_new("test", 1ULL)) ||
+ !(ull_node = eet_node_unsigned_long_long_new(NULL, 1ULL)) ||
+ !(ull_node = eet_node_unsigned_long_long_new("test", ULLONG_MAX + 1)))
+ {
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Function has returned NULL..", __FILE__, __LINE__);
+ }
+ else if (eet_node_type_get(ull_node) != EET_T_ULONG_LONG)
+ {
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node has wrong type..", __FILE__, __LINE__);
+ }
+
+ free(res_data.res_str);
+ printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
+}
+END_TEST
+
+/**
+ * @addtogroup eet_node
+ * @li eet_node_parent_get()
+ * @li eet_node_unsigned_int_new()
+ * @li eet_node_char_new()
+ * @li eet_node_unsigned_char_new()
+ * @li eet_node_short_new()
+ * @li eet_node_unsigned_short_new()
+ * @li eet_node_string_new()
+ * @li eet_node_long_long_new()
+ * @li eet_node_array_new()
+ * @{
+ * @objective Positive test case checking if the functions works correctly and without errors.
+ *
+ * @procedure
+ * @step 1 Initialization of pointer to Eina_List and appending test_data to it via eina_list_append.
+ * @step 2 Obtaining a pointer to Eet_Node using eet_node_list_new with the pointer to Eina_List as a parameter.
+ * @step 3 Obtaining a pointer 'eet_node_children' using pointer from step 2 as a parameter.
+ * @step 4 Obtaining a pointer 'eet_node_parent' using pointer from step 3 as a parameter.
+ * @step 5 Initialization of pointer to UINT Eet_Node with name "test" and unsigned int 1U.
+ * @step 6 Initialization of pointer to UINT Eet_Node with NULL name and unsigned int 1U.
+ * @step 7 Initialization of pointer to UINT Eet_Node with name "test" and UINT_MAX + 1.
+ * @step 8 Initialization of pointer to CHAR Eet_Node with name "test" and char 'a'.
+ * @step 9 Initialization of pointer to CHAR Eet_Node with NULL name and char 'a'.
+ * @step 10 Initialization of pointer to CHAR Eet_Node with name "test" and SCHAR_MAX + 1.
+ * @step 11 Initialization of pointer to UCHAR Eet_Node with correct arguments.
+ * @step 12 Initialization of pointer to UCHAR Eet_Node with NULL instead of valid name.
+ * @step 13 Initialization of pointer to UCHAR Eet_Node with name "test" and incorrect value.
+ * @step 14 Initialization of pointer to SHORT Eet_Node with correct arguments.
+ * @step 15 Initialization of pointer to SHORT Eet_Node with NULL instead of valid name.
+ * @step 16 Initialization of pointer to SHORT Eet_Node with name "test" and incorrect value.
+ * @step 17 Initialization of pointer to USHORT Eet_Node with correct arguments.
+ * @step 18 Initialization of pointer to USHORT Eet_Node with NULL instead of valid name.
+ * @step 19 Initialization of pointer to USHORT Eet_Node with name "test" and incorrect value.
+ * @step 20 Initialization of pointer to STR Eet_Node with correct arguments.
+ * @step 21 Initialization of pointer to STR Eet_Node with NULL instead of valid name.
+ * @step 22 Initialization of pointer to STR Eet_Node with name "test" and NULL value.
+ * @step 23 Initialization of pointer to LONG_LONG Eet_Node with correct arguments.
+ * @step 24 Initialization of pointer to LONG_LONG Eet_Node with NULL instead of valid name.
+ * @step 25 Initialization of pointer to LONG_LONG Eet_Node with name "test" and incorrect value.
+ * @step 26 Initialization of pointer to ARRAY Eet_Node with NULL instead of name and Eina_List.
+ * @step 27 Initialization of pointer to ARRAY Eet_Node with incorrect count of elements and Eina_List.
+ * @step 28 Initialization of pointer to ARRAY Eet_Node with NULL instead of pointer to Eina_List with data.
+ * @step 29 Initialization of pointer to ARRAY Eet_Node with correct arguments and Eina_List.
+ * @step 30 Dump ARRAY node by call eet_node_dump() and check dump data.
+ *
+ * @passcondition Returned pointer to Eet_Node is not NULL. Without segmentation fault.
+ * @}
+ */
+START_TEST(utc_eet_node_pack_p3)
+{
+ Eet_Node *parent_node = NULL;
+ Eet_Node *uint_node = NULL;
+ Eet_Node *char_node = NULL;
+ Eet_Node *uchar_node = NULL;
+ Eet_Node *short_node = NULL;
+ Eet_Node *ushort_node = NULL;
+ Eet_Node *str_node = NULL;
+ Eet_Node *ll_node = NULL;
+ Eet_Node *array_node = NULL;
+ Eina_List *eina_list = NULL;
+ Eet_Node *eet_node_children = NULL;
+ Eet_Node *node = eet_node_null_new("test");
+ Res_Data res_data = (Res_Data){NULL, 0};
+
+ if (!node)
+ {
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node is not created..", __FILE__, __LINE__);
+ }
+ else if (!(eina_list = eina_list_append(eina_list, node)))
+ {
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eina_List is not created..", __FILE__, __LINE__);
+ }
+ else if (!(parent_node = eet_node_list_new("test", eina_list)))
+ {
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eina_List is not created..", __FILE__, __LINE__);
+ }
+ else if (!(eet_node_children = eet_node_children_get(parent_node)))
+ {
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Child Eet_Node isn't taken from list", __FILE__, __LINE__);
+ }
+ else if (parent_node != eet_node_parent_get(eet_node_children))
+ {
+/* TODO replace printf by ck_abort_msg when API will be fixed*/
+ printf("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
+ }
+
+ if (!(uint_node = eet_node_unsigned_int_new("test", 1U)) ||
+ !(uint_node = eet_node_unsigned_int_new(NULL, 1U)) ||
+ !(uint_node = eet_node_unsigned_int_new("test", UINT_MAX + 1)))
+ {
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Function has returned NULL..", __FILE__, __LINE__);
+ }
+ else if (eet_node_type_get(uint_node) != EET_T_UINT)
+ {
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node has wrong type..", __FILE__, __LINE__);
+ }
+
+ if (!(char_node = eet_node_char_new("test", 'a')) ||
+ !(char_node = eet_node_char_new(NULL, 'a')) ||
+ !(char_node = eet_node_char_new("test", SCHAR_MAX + 1)))
+ {
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Function has returned NULL..", __FILE__, __LINE__);
+ }
+ else if (eet_node_type_get(char_node) != EET_T_CHAR)
+ {
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node has wrong type..", __FILE__, __LINE__);
+ }
+
+ if (!(uchar_node = eet_node_unsigned_char_new("test", (unsigned char)1)) ||
+ !(uchar_node = eet_node_unsigned_char_new(NULL, (unsigned char)1)) ||
+ !(uchar_node = eet_node_unsigned_char_new("test", UCHAR_MAX + 1)))
+ {
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Function has returned NULL..", __FILE__, __LINE__);
+ }
+ else if (eet_node_type_get(uchar_node) != EET_T_UCHAR)
+ {
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node has wrong type..", __FILE__, __LINE__);
+ }
+
+ if (!(short_node = eet_node_short_new("test", (short)1)) ||
+ !(short_node = eet_node_short_new(NULL, (short)1)) ||
+ !(short_node = eet_node_short_new("test", SHRT_MAX + 1)))
+ {
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Function has returned NULL..", __FILE__, __LINE__);
+ }
+ else if (eet_node_type_get(short_node) != EET_T_SHORT)
+ {
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node has wrong type..", __FILE__, __LINE__);
+ }
+
+ if (!(ushort_node = eet_node_unsigned_short_new("test", (unsigned short)1)) ||
+ !(ushort_node = eet_node_unsigned_short_new(NULL, (unsigned short)1)) ||
+ !(ushort_node = eet_node_unsigned_short_new("test", USHRT_MAX + 1)))
+ {
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Function has returned NULL..", __FILE__, __LINE__);
+ }
+ else if (eet_node_type_get(ushort_node) != EET_T_USHORT)
+ {
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node has wrong type..", __FILE__, __LINE__);
+ }
+
+ if (!(str_node = eet_node_string_new("test", "string")) ||
+ !(str_node = eet_node_string_new(NULL, "string")) ||
+ !(str_node = eet_node_string_new("test", NULL)))
+ {
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Function has returned NULL..", __FILE__, __LINE__);
+ }
+ else if (eet_node_type_get(str_node) != EET_T_STRING)
+ {
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node has wrong type..", __FILE__, __LINE__);
+ }
+
+ if (!(ll_node = eet_node_long_long_new("test", 1LL)) ||
+ !(ll_node = eet_node_long_long_new(NULL, 1LL)) ||
+ !(ll_node = eet_node_long_long_new("test", LLONG_MAX + 1)))
+ {
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Function has returned NULL..", __FILE__, __LINE__);
+ }
+ else if (eet_node_type_get(ll_node) != EET_T_LONG_LONG)
+ {
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node has wrong type..", __FILE__, __LINE__);
+ }
+
+ if (!(array_node = eet_node_array_new("test", 1, NULL)) ||
+ !(array_node = eet_node_array_new(NULL, 1, eina_list)) ||
+ !(array_node = eet_node_array_new("test", -10, eina_list)) ||
+ !(array_node = eet_node_array_new("test", 1, eina_list)))
+ {
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Function has returned NULL..", __FILE__, __LINE__);
+ }
+ else if (eet_node_type_get(array_node) != EET_G_ARRAY)
+ {
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node has wrong type..", __FILE__, __LINE__);
+ }
+
+ eet_node_dump(array_node, 1, output, &res_data);
+ if (!res_data.res_str)
+ {
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. incorrect dump node.. ", __FILE__, __LINE__);
+ }
+ free(res_data.res_str);
+
+ printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
+
+}
+END_TEST
+
+/**
+ *@}
+ */
+Suite *
+test_suite(void)
+{
+ Suite *suite = suite_create("utc_eet_node");
+
+ TCase *tcase = tcase_create("TCase");
+ tcase_set_timeout(tcase, 30);
+ tcase_add_checked_fixture(tcase, setup, teardown);
+ tcase_add_test(tcase, utc_eet_node_pack_p);
+ tcase_add_test(tcase, utc_eet_node_pack_p2);
+ tcase_add_test(tcase, utc_eet_node_pack_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_eet_node.log");
+ srunner_set_xml(srunner, "utc_eet_node.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 <Eet.h>
-
-/**
- * @addtogroup eet_node
- * @{
- * @defgroup eet_node_array_new eet_node_array_new()
- *
- *
- * @precondition
- * @step 1 eet initialized with eet_init()
- */
-static void
-setup(void)
-{
- printf(" ============ Startup ============ \n");
- eet_init();
-}
-
-static void
-teardown(void)
-{
- printf(" ============ Cleanup ============ \n");
- eet_shutdown();
-}
-
-/**
- * @addtogroup eet_node_array_new
- * @{
- * @objective Positive test case 1 checks if function returns valid pointer
- * to Eet_Node with type EET_G_ARRAY if it is called with correct arguments.
- * @n Input data: "test" as name of node, 1 as count of elements, pointer to created Eina_List with
- * one element.
- *
- * @procedure
- * @step 1 Initialization of Eet_Node to be added to Eina_List.
- * @step 2 Initialization of Eina_List with one element, created on step 1.
- * @step 3 Invocation of eet_node_array_new to get pointer to Eet_Node with correct arguments
- * and Eina_List created on step 2.
- *
- * @passcondition Returned pointer to Eet_Node is not NULL and type of the node is EET_G_ARRAY.
- * @}
- */
-START_TEST(utc_eet_node_array_new_p)
-{
- Eet_Node *eet_node = NULL;
- Eina_List *eina_list = NULL;
- Eet_Node *node = eet_node_null_new("test");
-
- if (!node)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node is not created..", __FILE__, __LINE__);
- }
- else if (!(eina_list = eina_list_append(eina_list, node)))
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eina_List is not created..", __FILE__, __LINE__);
- }
- else if (!(eet_node = eet_node_array_new("test", 1, eina_list)))
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Function has returned NULL..", __FILE__, __LINE__);
- }
- else if (eet_node_type_get(eet_node) != EET_G_ARRAY)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node has wrong type..", __FILE__, __LINE__);
- }
- else
- {
- printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
- }
- eet_node_del(eet_node);
-}
-END_TEST
-
-/**
- * @addtogroup eet_node_array_new
- * @{
- * @objective Positive test case 2 checks if function returns valid pointer
- * to Eet_Node with type EET_G_ARRAY if it is called with NULL instead of node's name.
- * @n Input data: NULL as name of node, 1 as count of elements, pointer to created Eina_List.
- *
- * @procedure
- * @step 1 Initialization of Eet_Node to be added to Eina_List.
- * @step 2 Initialization of Eina_List with one element, created on step 1.
- * @step 3 Invocation of eet_node_array_new to get pointer to Eet_Node with NULL instead of name
- * and Eina_List created on step 2.
- *
- * @passcondition Returned pointer to Eet_Node is not NULL and type of the node is EET_G_ARRAY.
- * @}
- */
-START_TEST(utc_eet_node_array_new_p2)
-{
- Eet_Node *eet_node = NULL;
- Eina_List *eina_list = NULL;
- Eet_Node *node = eet_node_null_new("test");
-
- if (!node)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node is not created..", __FILE__, __LINE__);
- }
- else if (!(eina_list = eina_list_append(eina_list, node)))
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eina_List is not created..", __FILE__, __LINE__);
- }
- else if (!(eet_node = eet_node_array_new(NULL, 1, eina_list)))
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Function has returned NULL..", __FILE__, __LINE__);
- }
- else if (eet_node_type_get(eet_node) != EET_G_ARRAY)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node has wrong type..", __FILE__, __LINE__);
- }
- else
- {
- printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
- }
- eet_node_del(eet_node);
-}
-END_TEST
-
-/**
- * @addtogroup eet_node_array_new
- * @{
- * @objective Positive test case 3 checks if function returns valid pointer
- * to Eet_Node with type EET_G_ARRAY if it is called with incorrect count of elements.
- * @n Input data: "test" as name of node, -10 as count of elements, pointer to created Eina_List.
- *
- * @procedure
- * @step 1 Initialization of Eet_Node to be added to Eina_List.
- * @step 2 Initialization of Eina_List with one element, created on step 1.
- * @step 3 Invocation of eet_node_array_new to get pointer to Eet_Node with incorrect count
- * of elements and Eina_List created on step 2.
- *
- * @passcondition Returned pointer to Eet_Node is not NULL and type of the node is EET_G_ARRAY.
- * @}
- */
-START_TEST(utc_eet_node_array_new_p3)
-{
- Eet_Node *eet_node = NULL;
- Eina_List *eina_list = NULL;
- Eet_Node *node = eet_node_null_new("test");
-
- if (!node)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node is not created..", __FILE__, __LINE__);
- }
- else if (!(eina_list = eina_list_append(eina_list, node)))
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eina_List is not created..", __FILE__, __LINE__);
- }
- else if (!(eet_node = eet_node_array_new("test", -10, eina_list)))
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Function has returned NULL..", __FILE__, __LINE__);
- }
- else if (eet_node_type_get(eet_node) != EET_G_ARRAY)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node has wrong type..", __FILE__, __LINE__);
- }
- else
- {
- printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
- }
- eet_node_del(eet_node);
-}
-END_TEST
-
-/**
- * @addtogroup eet_node_array_new
- * @{
- * @objective Positive test case 4 checks if function returns valid pointer
- * to Eet_Node with type EET_G_ARRAY if it is called with NULL instead of Eina_list.
- * @n Input data: "test" as name of node, 1 as count of elements, NULL instead of Eina_List.
- *
- * @procedure
- * @step 1 Initialization of pointer to Eet_Node with NULL instead of pointer to Eina_List with data.
- *
- * @passcondition Returned pointer to Eet_Node is not NULL and type of the node is EET_G_ARRAY.
- * @}
- */
-START_TEST(utc_eet_node_array_new_p4)
-{
- Eet_Node *eet_node = eet_node_array_new("test", 1, NULL);
-
- if (!eet_node)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Function has returned NULL..", __FILE__, __LINE__);
- }
- else if (eet_node_type_get(eet_node) != EET_G_ARRAY)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node has wrong type..", __FILE__, __LINE__);
- }
- else
- {
- printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
- }
- eet_node_del(eet_node);
-}
-END_TEST
-/**
- *@}
- */
-Suite *
-test_suite(void)
-{
- Suite *suite = suite_create("utc_eet_node_array_new");
-
- TCase *tcase = tcase_create("TCase");
- tcase_set_timeout(tcase, 30);
- tcase_add_checked_fixture(tcase, setup, teardown);
- tcase_add_test(tcase, utc_eet_node_array_new_p);
- tcase_add_test(tcase, utc_eet_node_array_new_p2);
- tcase_add_test(tcase, utc_eet_node_array_new_p3);
- tcase_add_test(tcase, utc_eet_node_array_new_p4);
- 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_eet_node_array_new.log");
- srunner_set_xml(srunner, "utc_eet_node_array_new.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 <Eet.h>
-
-/**
- * @addtogroup eet_node
- * @{
- * @defgroup eet_node_char_new eet_node_char_new()
- *
- *
- * @precondition
- * @step 1 eet initialized with eet_init()
- */
-static void
-setup(void)
-{
- printf(" ============ Startup ============ \n");
- eet_init();
-}
-
-static void
-teardown(void)
-{
- printf(" ============ Cleanup ============ \n");
- eet_shutdown();
-}
-
-/**
- * @addtogroup eet_node_char_new
- * @{
- * @objective Positive test case 1 checks if function returns valid pointer
- * to Eet_Node with type EET_T_CHAR if it is called with correct arguments.
- * @n Input data: "test" as name of node and 'a' as it's value.
- *
- * @procedure
- * @step 1 Initialization of pointer to Eet_Node with name "test" and char 'a'.
- *
- * @passcondition Returned pointer to Eet_Node is not NULL and type of the node is EET_T_CHAR.
- * @}
- */
-START_TEST(utc_eet_node_char_new_p)
-{
- Eet_Node *eet_node = eet_node_char_new("test", 'a');
-
- if (!eet_node)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Function has returned NULL..", __FILE__, __LINE__);
- }
- else if (eet_node_type_get(eet_node) != EET_T_CHAR)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node has wrong type..", __FILE__, __LINE__);
- }
- else
- {
- printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
- }
- eet_node_del(eet_node);
-}
-END_TEST
-
-/**
- * @addtogroup eet_node_char_new
- * @{
- * @objective Positive test case 2 checks if function returns valid pointer
- * to Eet_Node with type EET_T_CHAR if it is called with NULL instead of node's name.
- * @n Input data: NULL as name of node and 'a' as it's value.
- *
- * @procedure
- * @step 1 Initialization of pointer to Eet_Node with NULL name and char 'a'.
- *
- * @passcondition Returned pointer to Eet_Node is not NULL and type of the node is EET_T_CHAR.
- * @}
- */
-START_TEST(utc_eet_node_char_new_p2)
-{
- Eet_Node *eet_node = eet_node_char_new(NULL, 'a');
-
- if (!eet_node)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Function has returned NULL..", __FILE__, __LINE__);
- }
- else if (eet_node_type_get(eet_node) != EET_T_CHAR)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node has wrong type..", __FILE__, __LINE__);
- }
- else
- {
- printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
- }
- eet_node_del(eet_node);
-}
-END_TEST
-
-/**
- * @addtogroup eet_node_int_new
- * @{
- * @objective Positive test case 3 checks if function returns valid pointer
- * to Eet_Node with type EET_T_CHAR if it is called with incorrect value.
- * @n Input data: "test" as name of node and SCHAR_MAX + 1 as value.
- *
- * @procedure
- * @step 1 Initialization of pointer to Eet_Node with name "test" and SCHAR_MAX + 1.
- *
- * @passcondition Returned pointer to Eet_Node is not NULL and type of the node is EET_T_CHAR.
- * @}
- */
-START_TEST(utc_eet_node_char_new_p3)
-{
- Eet_Node *eet_node = eet_node_char_new("test", SCHAR_MAX + 1);
-
- if (!eet_node)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Function has returned NULL..", __FILE__, __LINE__);
- }
- else if (eet_node_type_get(eet_node) != EET_T_CHAR)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node has wrong type..", __FILE__, __LINE__);
- }
- else
- {
- printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
- }
- eet_node_del(eet_node);
-}
-END_TEST
-/**
- *@}
- */
-Suite *
-test_suite(void)
-{
- Suite *suite = suite_create("utc_eet_node_char_new");
-
- TCase *tcase = tcase_create("TCase");
- tcase_set_timeout(tcase, 30);
- tcase_add_checked_fixture(tcase, setup, teardown);
- tcase_add_test(tcase, utc_eet_node_char_new_p);
- tcase_add_test(tcase, utc_eet_node_char_new_p2);
- tcase_add_test(tcase, utc_eet_node_char_new_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_eet_node_char_new.log");
- srunner_set_xml(srunner, "utc_eet_node_char_new.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 <Eet.h>
-#include "../../utc_negative_unitest.h"
-
-/**
- * @addtogroup eet_node
- * @{
- * @defgroup eet_node_children_get eet_node_children_get()
- *
- *
- * @precondition
- * @step 1 eet initialized with eet_init()
- */
-static void
-setup(void)
-{
- printf(" ============ Startup ============ \n");
- eet_init();
-}
-
-static void
-teardown(void)
-{
- printf(" ============ Cleanup ============ \n");
- eet_shutdown();
-}
-
-/**
- * @addtogroup eet_node_children_get
- * @{
- * @objective Positive test case 1 checks if function returns valid pointer to nodes list with children
- * if it is called with correct arguments.
- * @n Input data: node with list of nodes.
- *
- * @procedure
- * @step 1 Initialization of pointer to Eina_List and appending data to it via eina_list_append.
- * @step 2 Attaching eet_node to the eina_list using eet_node_list_new.
- * @step 3 Obtaining pointer to children Eet_Node using function eet_node_children_get.
- *
- * @passcondition Returned pointer to Eet_Node is not NULL.
- * @}
- */
-START_TEST(utc_eet_node_children_get_p)
-{
- Eet_Node *eet_node = NULL;
- Eina_List *eina_list = NULL;
- Eet_Node *node = eet_node_null_new("test");
-
- if (!node)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node is not created..", __FILE__, __LINE__);
- }
- else if (!(eina_list = eina_list_append(eina_list, node)))
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eina_List is not created..", __FILE__, __LINE__);
- }
- else if (!(eet_node = eet_node_list_new("test", eina_list)))
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node with child Eet_List is not created", __FILE__, __LINE__);
- }
- else if (!eet_node_children_get(eet_node))
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
- }
- else
- {
- printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
- }
- eet_node_del(eet_node);
-}
-END_TEST
-
-/**
- * @addtogroup eet_node_children_get
- * @{
- * @objective Negative test case 1 checks the result of the function for a node with type EET_T_NULL.
- * @n Input Data: Eet_Node with type EET_T_NULL.
- *
- * @procedure
- * @step 1 Initialization of pointer to Eet_Node using eet_node_null_new.
- * @step 2 Obtaining pointer named 'eet_node_children' which points to children of the eet_node
- * using function eet_node_children_get.
- *
- * @passcondition Returned pointer to Eet_Node is not NULL.
- * @}
- */
-START_TEST(utc_eet_node_children_get_n)
-{
- Eet_Node *eet_node = eet_node_null_new("test");
-
- if (!eet_node)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node is not created..", __FILE__, __LINE__);
- }
- Eet_Node *eet_node_children = eet_node_children_get(eet_node);
- eet_node_del(eet_node);
-
- if (eet_node_children != 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
-
-/**
- * @addtogroup eet_node_children_get
- * @{
- * @objective Negative test case 2 checks if function doesn't cause segmentation fault
- * and returns NULL if it is called with NULL instead of any argument.
- * @n Input Data: pointer to created Eina_Node with type EET_T_NULL (it's replaced by NULL
- * when function is called).
- *
- * @procedure
- * @step 1 Create new Eina_Node.
- * @step 2 Call function once and pass NULL instead of created Eet_Node.
- *
- * @passcondition Function doesn't cause segmentation fault and returns NULL.
- * @}
- */
-START_TEST(utc_eet_node_children_get_n2)
-{
- Eet_Node *eet_node = eet_node_null_new("test");
-
- int result = UNITEST_FUNC_NEG_RET(NULL, eet_node_children_get, eet_node);
-
- if (result == TEST_FAIL)
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
- else
- printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
-
- eet_node_del(eet_node);
-}
-END_TEST
-/**
- *@}
- */
-Suite *
-test_suite(void)
-{
- Suite *suite = suite_create("utc_eet_node_children_get");
-
- TCase *tcase = tcase_create("TCase");
- tcase_set_timeout(tcase, 30);
- tcase_add_checked_fixture(tcase, setup, teardown);
- tcase_add_test(tcase, utc_eet_node_children_get_p);
- tcase_add_test(tcase, utc_eet_node_children_get_n);
- tcase_add_test(tcase, utc_eet_node_children_get_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_eet_node_children_get.log");
- srunner_set_xml(srunner, "utc_eet_node_children_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 <Eet.h>
-#include "../../utc_negative_unitest.h"
-
-/**
- * @addtogroup eet_node
- * @{
- * @defgroup eet_node_del eet_node_del()
- *
- *
- * @precondition
- * @step 1 eet initialized with eet_init()
- */
-static void
-setup(void)
-{
- printf(" ============ Startup ============ \n");
- eet_init();
-}
-
-static void
-teardown(void)
-{
- printf(" ============ Cleanup ============ \n");
- eet_shutdown();
-}
-
-/**
- * @addtogroup eet_node_del
- * @{
- * @objective Positive test case calls the function with some node.
- * @n Input Data: created Eet_Node.
- *
- * @procedure
- * @step 1 Initialization of pointer to Eet_Node using eet_node_null_new.
- * @step 2 Invocation of eet_node_del for the pointer.
- *
- * @passcondition Function executes successfully.
- * @}
- */
-START_TEST(utc_eet_node_del_p)
-{
- Eet_Node *eet_node = eet_node_null_new("test");
-
- if (!eet_node)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node is NULL", __FILE__, __LINE__);
- }
-
- eet_node_del(eet_node);
-
- printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
-}
-END_TEST
-
-/**
- * @addtogroup eet_node_del
- * @{
- * @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: NULL instead of pointer to created Eina_Node with type EET_T_NULL.
- *
- * @procedure
- * @step 1 Create new Eina_Node.
- * @step 2 Call function once and pass NULL instead of created Eet_Node.
- *
- * @passcondition Function doesn't cause segmentation fault and returns NULL.
- * @}
- */
-START_TEST(utc_eet_node_del_n)
-{
- Eet_Node *eet_node = eet_node_null_new("test");
-
- UNITEST_FUNC_NEG(eet_node_del, eet_node);
-
- eet_node_del(eet_node);
- printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
-}
-END_TEST
-/**
- *@}
- */
-Suite *
-test_suite(void)
-{
- Suite *suite = suite_create("utc_eet_node_del");
-
- TCase *tcase = tcase_create("TCase");
- tcase_set_timeout(tcase, 30);
- tcase_add_checked_fixture(tcase, setup, teardown);
- tcase_add_test(tcase, utc_eet_node_del_p);
- tcase_add_test(tcase, utc_eet_node_del_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_eet_node_del.log");
- srunner_set_xml(srunner, "utc_eet_node_del.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 <Eet.h>
-#include <float.h>
-
-/**
- * @addtogroup eet_node
- * @{
- * @defgroup eet_node_double_new eet_node_double_new()
- *
- *
- * @precondition
- * @step 1 eet initialized with eet_init()
- */
-static void
-setup(void)
-{
- printf(" ============ Startup ============ \n");
- eet_init();
-}
-
-static void
-teardown(void)
-{
- printf(" ============ Cleanup ============ \n");
- eet_shutdown();
-}
-
-/**
- * @addtogroup eet_node_double_new
- * @{
- * @objective Positive test case 1 checks if function returns valid pointer
- * to Eet_Node with type EET_T_DOUBLE if it is called with correct arguments.
- * @n Input data: "test" as name of node and 1.0 as it's value.
- *
- * @procedure
- * @step 1 Initialization of pointer to Eet_Node with correct arguments.
- *
- * @passcondition Returned pointer to Eet_Node is not NULL and type of the node is EET_T_DOUBLE.
- * @}
- */
-START_TEST(utc_eet_node_double_new_p)
-{
- Eet_Node *eet_node = eet_node_double_new("test", 1.0);
-
- if (!eet_node)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Function has returned NULL..", __FILE__, __LINE__);
- }
- else if (eet_node_type_get(eet_node) != EET_T_DOUBLE)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node has wrong type..", __FILE__, __LINE__);
- }
- else
- {
- printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
- }
- eet_node_del(eet_node);
-}
-END_TEST
-
-/**
- * @addtogroup eet_node_double_new
- * @{
- * @objective Positive test case 2 checks if function returns valid pointer
- * to Eet_Node with type EET_T_DOUBLE if it is called with NULL instead of node's name.
- * @n Input data: NULL as name of node and 1.0 as it's value.
- *
- * @procedure
- * @step 1 Initialization of pointer to Eet_Node with NULL instead of valid name.
- *
- * @passcondition Returned pointer to Eet_Node is not NULL and type of the node is EET_T_DOUBLE.
- * @}
- */
-
-START_TEST(utc_eet_node_double_new_p2)
-{
- Eet_Node *eet_node = eet_node_double_new(NULL, 1.0);
-
- if (!eet_node)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Function has returned NULL..", __FILE__, __LINE__);
- }
- else if (eet_node_type_get(eet_node) != EET_T_DOUBLE)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node has wrong type..", __FILE__, __LINE__);
- }
- else
- {
- printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
- }
- eet_node_del(eet_node);
-}
-END_TEST
-
-/**
- * @addtogroup eet_node_double_new
- * @{
- * @objective Positive test case 3 checks if function returns valid pointer
- * to Eet_Node with type EET_T_DOUBLE if it is called with incorrect value.
- * @n Input data: "test" as name of node and DBL_MAX + 1 as value.
- *
- * @procedure
- * @step 1 Initialization of pointer to Eet_Node with name "test" and incorrect value.
- *
- * @passcondition Returned pointer to Eet_Node is not NULL and type of the node is EET_T_DOUBLE.
- * @}
- */
-
-START_TEST(utc_eet_node_double_new_p3)
-{
- Eet_Node *eet_node = eet_node_double_new("test", DBL_MAX + 1);
-
- if (!eet_node)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Function has returned NULL..", __FILE__, __LINE__);
- }
- else if (eet_node_type_get(eet_node) != EET_T_DOUBLE)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node has wrong type..", __FILE__, __LINE__);
- }
- else
- {
- printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
- }
- eet_node_del(eet_node);
-}
-END_TEST
-/**
- *@}
- */
-Suite *
-test_suite(void)
-{
- Suite *suite = suite_create("utc_eet_node_double_new");
-
- TCase *tcase = tcase_create("TCase");
- tcase_set_timeout(tcase, 30);
- tcase_add_checked_fixture(tcase, setup, teardown);
- tcase_add_test(tcase, utc_eet_node_double_new_p);
- tcase_add_test(tcase, utc_eet_node_double_new_p2);
- tcase_add_test(tcase, utc_eet_node_double_new_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_eet_node_double_new.log");
- srunner_set_xml(srunner, "utc_eet_node_double_new.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 <Eet.h>
-#include <float.h>
-#include <malloc.h>
-
-typedef struct _Res_Data Res_Data;
-struct _Res_Data
-{
- char *res_str;
- int res_str_size;
-};
-
-void output(void *data, const char *string)
-{
- Res_Data *res_data = (Res_Data *)data;
- int string_size = strlen(string);
-
- if (!res_data->res_str)
- {
- res_data->res_str = (char *)calloc(string_size + 1, sizeof(char));
- res_data->res_str_size = string_size;
- memcpy(res_data->res_str, string, string_size);
- }
- else
- {
- res_data->res_str = (char *)realloc(res_data->res_str, (res_data->res_str_size + res_data->res_str_size + 1) * sizeof(char));
- memcpy(&res_data->res_str[res_data->res_str_size], string, string_size);
- res_data->res_str_size += string_size;
- res_data->res_str[res_data->res_str_size] = 0;
- }
-}
-
-/**
- * @addtogroup eet_node
- * @{
- * @defgroup eet_node_dump eet_node_dump()
- *
- *
- * @precondition
- * @step 1 eet initialized with eet_init()
- */
-static void
-setup(void)
-{
- printf(" ============ Startup ============ \n");
- eet_init();
-}
-
-static void
-teardown(void)
-{
- printf(" ============ Cleanup ============ \n");
- eet_shutdown();
-}
-
-/**
- * @addtogroup eet_node_dump
- * @{
- * @objective Positive test case 1 checks if function returns valid user data.
- * @n Input data:
- * @li eet_node node to dump;
- * @li dump level;
- * @li dumpfunc The function to call passed a string when new data is converted to text;
- * @li res_data user data.
- *
- * @procedure
- * @step 1 Initialization of pointer to Eet_Node with correct arguments.
- * @step 2 Dump node and check dump data.
- *
- * @passcondition Returned pointer to Eet_Node is not NULL and type of the node is EET_T_DOUBLE.
- * @}
- */
-START_TEST(utc_eet_node_dump_p)
-{
- int data_set = 1;
- Eet_Node *eet_node = eet_node_int_new("test", data_set);
- Res_Data res_data = (Res_Data){NULL, 0};
- int res = 0;
-
- if (!eet_node)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Function has returned NULL..", __FILE__, __LINE__);
- }
- else if (eet_node_type_get(eet_node) != EET_T_INT)
- {
- eet_node_del(eet_node);
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node has wrong type..", __FILE__, __LINE__);
- }
-
- eet_node_dump(eet_node, 1, output, &res_data);
-
-
- if (!res_data.res_str)
- {
- eet_node_del(eet_node);
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. incorrect dump node.. ", __FILE__, __LINE__);
- }
-
- sscanf(res_data.res_str, "%*s %*s %*s %d", &res);
-
- if (res != data_set)
- {
- eet_node_del(eet_node);
- free(res_data.res_str);
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. incorrect dump value.. ", __FILE__, __LINE__);
- }
- printf("[TEST_PASS]:: %s[%d] : Test has passed.. \n", __FILE__, __LINE__);
-
- eet_node_del(eet_node);
-
- free(res_data.res_str);
-}
-END_TEST
-
-/**
- *@}
- */
-Suite *
-test_suite(void)
-{
- Suite *suite = suite_create("utc_eet_node_dump");
-
- TCase *tcase = tcase_create("TCase");
- tcase_set_timeout(tcase, 30);
- tcase_add_checked_fixture(tcase, setup, teardown);
- tcase_add_test(tcase, utc_eet_node_dump_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_eet_node_dump.log");
- srunner_set_xml(srunner, "utc_eet_node_dump.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 <Eet.h>
-#include <float.h>
-
-/**
- * @addtogroup eet_node
- * @{
- * @defgroup eet_node_float_new eet_node_float_new()
- *
- *
- * @precondition
- * @step 1 eet initialized with eet_init()
- */
-static void
-setup(void)
-{
- printf(" ============ Startup ============ \n");
- eet_init();
-}
-
-static void
-teardown(void)
-{
- printf(" ============ Cleanup ============ \n");
- eet_shutdown();
-}
-
-/**
- * @addtogroup eet_node_float_new
- * @{
- * @objective Positive test case 1 checks if function returns valid pointer
- * to Eet_Node with type EET_T_FLOAT if it is called with correct arguments.
- * @n Input data: "test" as name of node and 1.0F as it's value.
- *
- * @procedure
- * @step 1 Initialization of pointer to Eet_Node with correct arguments.
- *
- * @passcondition Returned pointer to Eet_Node is not NULL and type of the node is EET_T_FLOAT.
- * @}
- */
-START_TEST(utc_eet_node_float_new_p)
-{
- Eet_Node *eet_node = eet_node_float_new("test", 1.0F);
-
- if (!eet_node)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Function has returned NULL..", __FILE__, __LINE__);
- }
- else if (eet_node_type_get(eet_node) != EET_T_FLOAT)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node has wrong type..", __FILE__, __LINE__);
- }
- else
- {
- printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
- }
- eet_node_del(eet_node);
-}
-END_TEST
-
-/**
- * @addtogroup eet_node_float_new
- * @{
- * @objective Positive test case 2 checks if function returns valid pointer
- * to Eet_Node with type EET_T_FLOAT if it is called with NULL instead of node's name.
- * @n Input data: NULL as name of node and 1.0F as it's value.
- *
- * @procedure
- * @step 1 Initialization of pointer to Eet_Node with NULL instead of valid name.
- *
- * @passcondition Returned pointer to Eet_Node is not NULL and type of the node is EET_T_FLOAT.
- * @}
- */
-START_TEST(utc_eet_node_float_new_p2)
-{
- Eet_Node *eet_node = eet_node_float_new(NULL, 1.0F);
-
- if (!eet_node)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Function has returned NULL..", __FILE__, __LINE__);
- }
- else if (eet_node_type_get(eet_node) != EET_T_FLOAT)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node has wrong type..", __FILE__, __LINE__);
- }
- else
- {
- printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
- }
- eet_node_del(eet_node);
-}
-END_TEST
-
-/**
- * @addtogroup eet_node_float_new
- * @{
- * @objective Positive test case 3 checks if function returns valid pointer
- * to Eet_Node with type EET_T_FLOAT if it is called with incorrect value.
- * @n Input data: "test" as name of node and FLT_MAX + 1 as value.
- *
- * @procedure
- * @step 1 Initialization of pointer to Eet_Node with name "test" and incorrect value.
- *
- * @passcondition Returned pointer to Eet_Node is not NULL and type of the node is EET_T_FLOAT.
- * @}
- */
-START_TEST(utc_eet_node_float_new_p3)
-{
- Eet_Node *eet_node = eet_node_float_new("test", FLT_MAX + 1);
-
- if (!eet_node)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Function has returned NULL..", __FILE__, __LINE__);
- }
- else if (eet_node_type_get(eet_node) != EET_T_FLOAT)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node has wrong type..", __FILE__, __LINE__);
- }
- else
- {
- printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
- }
- eet_node_del(eet_node);
-}
-END_TEST
-/**
- *@}
- */
-Suite *
-test_suite(void)
-{
- Suite *suite = suite_create("utc_eet_node_float_new");
-
- TCase *tcase = tcase_create("TCase");
- tcase_set_timeout(tcase, 30);
- tcase_add_checked_fixture(tcase, setup, teardown);
- tcase_add_test(tcase, utc_eet_node_float_new_p);
- tcase_add_test(tcase, utc_eet_node_float_new_p2);
- tcase_add_test(tcase, utc_eet_node_float_new_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_eet_node_float_new.log");
- srunner_set_xml(srunner, "utc_eet_node_float_new.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 <Eet.h>
-
-/**
- * @addtogroup eet_node
- * @{
- * @defgroup eet_node_hash_add eet_node_hash_add()
- *
- *
- * @precondition
- * @step 1 eet initialized with eet_init()
- */
-static void
-setup(void)
-{
- printf(" ============ Startup ============ \n");
- eet_init();
-}
-
-static void
-teardown(void)
-{
- printf(" ============ Cleanup ============ \n");
- eet_shutdown();
-}
-
-/**
- * @addtogroup eet_node_hash_add
- * @{
- * @objective Positive test case 1 checks added Eet_Node are the same as default node
- * if it is called with correct arguments.
- * @n Input data:
- * @li eet_node_parent as node.
- * @li child_name as name of node.
- * @li child_key as key
- * @li eet_node_child pointer to created Eina_Node to be hashed.
- *
- * @procedure
- * @step 1 Create new eet nodes to be hashed.
- * @step 2 Initialization of pointer to hash Eet_Node with correct arguments.
- * @step 3 Get hashed node and check type node.
- * @step 4 Get child node and check value node.
- *
- * @passcondition Test passes if returned values are the same as add values.
- * @}
- */
-START_TEST(utc_eet_node_hash_add_p)
-{
- const char *parent_name = "test_parent";
- const char *child_name = "test_child";
- const char *child_key = "key_parent";
- Eet_Node *eet_node_hash = NULL;
- Eet_Node *eet_node_rest = NULL;
- Eet_Node *eet_node_parent = eet_node_int_new(parent_name, 1);
- Eet_Node *eet_node_child = eet_node_int_new(child_name, 2);
-
- if ((!eet_node_parent) || (!eet_node_child))
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node to be hashed is not created..", __FILE__, __LINE__);
- }
-
- eet_node_hash_add(eet_node_parent, child_name, child_key, eet_node_child);
-
- if (!(eet_node_hash = eet_node_children_get(eet_node_parent)))
- {
- eet_node_del(eet_node_child);
- eet_node_del(eet_node_parent);
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. ", __FILE__, __LINE__);
- }
-
- if (eet_node_type_get(eet_node_hash) != EET_G_HASH)
- {
- eet_node_del(eet_node_hash);
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node has wrong type.. ", __FILE__, __LINE__);
- }
-
- if (!(eet_node_rest = eet_node_children_get(eet_node_hash)))
- {
- eet_node_del(eet_node_hash);
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. ", __FILE__, __LINE__);
- }
-
- if (eet_node_value_get(eet_node_rest)->value.i != 2)
- {
- eet_node_del(eet_node_hash);
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. ", __FILE__, __LINE__);
- }
-
- printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
-
- eet_node_del(eet_node_hash);
-}
-END_TEST
-
-/**
- * @addtogroup eet_node_hash_add
- * @{
- * @objective Positive test case 2 checks added Eet_Node are the same as default node
- * if it is called with NULL instead of node's name.
- * @n Input data:
- * @li eet_node_parent as node.
- * @li child_name as name of node.
- * @li child_key as key
- * @li eet_node_child pointer to created Eina_Node to be hashed.
- *
- * @procedure
- * @step 1 Create new eet nodes to be hashed.
- * @step 2 Initialization of pointer to hash Eet_Node with correct arguments.
- * @step 3 Get hashed node and check type node.
- * @step 4 Get child node and check value node.
- *
- * @passcondition Test passes if returned values are the same as add values.
- * @}
- */
-START_TEST(utc_eet_node_hash_add_p2)
-{
- const char *parent_name = "test_parent";
- const char *child_name = "test_child";
- const char *child_key = "key_parent";
- Eet_Node *eet_node_hash = NULL;
- Eet_Node *eet_node_rest = NULL;
- Eet_Node *eet_node_parent = eet_node_int_new(parent_name, 1);
- Eet_Node *eet_node_child = eet_node_int_new(child_name, 2);
-
- if ((!eet_node_parent) || (!eet_node_child))
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node to be hashed is not created..", __FILE__, __LINE__);
- }
-
- eet_node_hash_add(eet_node_parent, NULL, child_key, eet_node_child);
-
- if (!(eet_node_hash = eet_node_children_get(eet_node_parent)))
- {
- eet_node_del(eet_node_child);
- eet_node_del(eet_node_parent);
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. ", __FILE__, __LINE__);
- }
-
- if (eet_node_type_get(eet_node_hash) != EET_G_HASH)
- {
- eet_node_del(eet_node_hash);
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node has wrong type.. ", __FILE__, __LINE__);
- }
-
- if ((!(eet_node_rest = eet_node_children_get(eet_node_hash))) || (eet_node_value_get(eet_node_rest)->value.i != 2))
- {
- eet_node_del(eet_node_hash);
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node has wrong type.. ", __FILE__, __LINE__);
- }
-
- printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
-
- eet_node_del(eet_node_hash);
-}
-END_TEST
-
-/**
- * @addtogroup eet_node_hash_add
- * @{
- * @objective Positive test case 3 checks added Eet_Node are the same as default node
- * if it is called with NULL instead of key.
- * @n Input data:
- * @li eet_node_parent as node.
- * @li child_name as name of node.
- * @li child_key as key
- * @li eet_node_child pointer to created Eina_Node to be hashed.
- *
- * @procedure
- * @step 1 Create new eet nodes to be hashed.
- * @step 2 Initialization of pointer to hash Eet_Node with correct arguments.
- * @step 3 Get hashed node and check type node.
- * @step 4 Get child node and check value node.
- *
- * @passcondition Test passes if returned values are the same as add values.
- * @}
- */
-START_TEST(utc_eet_node_hash_add_p3)
-{
- const char *parent_name = "test_parent";
- const char *child_name = "test_child";
- Eet_Node *eet_node_hash = NULL;
- Eet_Node *eet_node_rest = NULL;
- Eet_Node *eet_node_parent = eet_node_int_new(parent_name, 1);
- Eet_Node *eet_node_child = eet_node_int_new(child_name, 2);
-
- if ((!eet_node_parent) || (!eet_node_child))
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node to be hashed is not created..", __FILE__, __LINE__);
- }
-
- eet_node_hash_add(eet_node_parent, child_name, NULL, eet_node_child);
-
- if (!(eet_node_hash = eet_node_children_get(eet_node_parent)))
- {
- eet_node_del(eet_node_child);
- eet_node_del(eet_node_parent);
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node has wrong type.. ", __FILE__, __LINE__);
- }
-
- if (eet_node_type_get(eet_node_hash) != EET_G_HASH)
- {
- eet_node_del(eet_node_hash);
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node has wrong type.. ", __FILE__, __LINE__);
- }
- if ((!(eet_node_rest = eet_node_children_get(eet_node_hash))) || (eet_node_value_get(eet_node_rest)->value.i != 2))
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node has wrong type.. ", __FILE__, __LINE__);
- }
-
- printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
-
- eet_node_del(eet_node_hash);
-}
-END_TEST
-
-/**
- *@}
- */
-Suite *
-test_suite(void)
-{
- Suite *suite = suite_create("utc_eet_node_hash_add");
-
- TCase *tcase = tcase_create("TCase");
- tcase_set_timeout(tcase, 30);
- tcase_add_checked_fixture(tcase, setup, teardown);
- tcase_add_test(tcase, utc_eet_node_hash_add_p);
- tcase_add_test(tcase, utc_eet_node_hash_add_p2);
- tcase_add_test(tcase, utc_eet_node_hash_add_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_eet_node_hash_add.log");
- srunner_set_xml(srunner, "utc_eet_node_hash_add.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 <Eet.h>
-#include "../../utc_negative_unitest.h"
-
-/**
- * @addtogroup eet_node
- * @{
- * @defgroup eet_node_hash_new eet_node_hash_new()
- *
- *
- * @precondition
- * @step 1 eet initialized with eet_init()
- */
-static void
-setup(void)
-{
- printf(" ============ Startup ============ \n");
- eet_init();
-}
-
-static void
-teardown(void)
-{
- printf(" ============ Cleanup ============ \n");
- eet_shutdown();
-}
-
-/**
- * @addtogroup eet_node_hash_new
- * @{
- * @objective Positive test case 1 checks if function returns valid pointer
- * to Eet_Node with type EET_G_HASH if it is called with correct arguments.
- * @n Input data: "test" as name of node, "key" as key, pointer to created Eina_Node to be hashed.
- *
- * @procedure
- * @step 1 Create new Eina_Node to be hashed.
- * @step 2 Initialization of pointer to hash Eet_Node with correct arguments.
- *
- * @passcondition Returned pointer to Eet_Node is not NULL and type of the node is EET_G_HASH.
- * @}
- */
-START_TEST(utc_eet_node_hash_new_p)
-{
- Eet_Node *eet_node_hash = NULL;
- Eet_Node *eet_node = eet_node_null_new("test");
-
- if (!eet_node)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node to be hashed is not created..", __FILE__, __LINE__);
- }
- if (!(eet_node_hash = eet_node_hash_new("test", "key", eet_node)))
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Function has returned NULL..", __FILE__, __LINE__);
- }
- else if (eet_node_type_get(eet_node_hash) != EET_G_HASH)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node has wrong type..", __FILE__, __LINE__);
- }
- else
- {
- printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
- }
- eet_node_del(eet_node_hash);
-}
-END_TEST
-
-/**
- * @addtogroup eet_node_hash_new
- * @{
- * @objective Positive test case 2 checks if function returns valid pointer
- * to Eet_Node with type EET_G_HASH if it is called with NULL instead of node's name.
- * @n Input data: NULL as name of node, "key" as key, pointer to created Eina_Node to be hashed.
- *
- * @procedure
- * @step 1 Create new Eina_Node to be hashed.
- * @step 2 Initialization of pointer to hash Eet_Node with NULL instead of valid name.
- *
- * @passcondition Returned pointer to Eet_Node is not NULL and type of the node is EET_G_HASH.
- * @}
- */
-START_TEST(utc_eet_node_hash_new_p2)
-{
- Eet_Node *eet_node_hash = NULL;
- Eet_Node *eet_node = eet_node_null_new("test");
-
- if (!eet_node)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node to be hashed is not created..", __FILE__, __LINE__);
- }
- else if (!(eet_node_hash = eet_node_hash_new(NULL, "key", eet_node)))
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Function has returned NULL..", __FILE__, __LINE__);
- }
- else if (eet_node_type_get(eet_node_hash) != EET_G_HASH)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node has wrong type..", __FILE__, __LINE__);
- }
- else
- {
- printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
- }
- eet_node_del(eet_node_hash);
-}
-END_TEST
-
-/**
- * @addtogroup eet_node_hash_new
- * @{
- * @objective Positive test case 3 checks if function returns valid pointer
- * to Eet_Node with type EET_G_HASH if it is called with NULL instead of key.
- * @n Input data: "test" as name of node, NULL as key, pointer to created Eina_Node to be hashed.
- *
- * @procedure
- * @step 1 Create new Eina_Node to be hashed.
- * @step 2 Initialization of pointer to hash Eet_Node with NULL instead of key.
- *
- * @passcondition Returned pointer to Eet_Node is not NULL and type of the node is EET_G_HASH.
- * @}
- */
-START_TEST(utc_eet_node_hash_new_p3)
-{
- Eet_Node *eet_node_hash = NULL;
- Eet_Node *eet_node = eet_node_null_new("test");
-
- if (!eet_node)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node to be hashed is not created..", __FILE__, __LINE__);
- }
- else if (!(eet_node_hash = eet_node_hash_new("test", NULL, eet_node)))
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Function has returned NULL..", __FILE__, __LINE__);
- }
- else if (eet_node_type_get(eet_node_hash) != EET_G_HASH)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node has wrong type..", __FILE__, __LINE__);
- }
- else
- {
- printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
- }
- eet_node_del(eet_node_hash);
-}
-END_TEST
-
-/**
- * @addtogroup eet_node_hash_new
- * @{
- * @objective Negative test case checks if function doesn't cause segmentation fault
- * and returns NULL if it is called with NULL instead of some arguments.
- * @n Input Data: "test" as name of node, "key" as key, pointer to created Eina_Node to be hashed.
- *
- * @procedure
- * @step 1 Create new Eina_Node to be hashed.
- * @step 2 Call function once and pass NULL instead of Eet_Node that must be hashed.
- *
- * @passcondition Function doesn't cause segmentation fault and returns NULL.
- * @}
- */
-START_TEST(utc_eet_node_hash_new_n)
-{
- Eet_Node *eet_node = eet_node_null_new("test");
-
- CREATE_CHECKED_ARGS_ARRAY(0, 0, 1);
- UNITEST_FUNC_NEG_CA_RET(NULL, eet_node_hash_new, "test", "key", eet_node);
-
- if (result_of_testing == TEST_FAIL)
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
- else
- printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
-
- eet_node_del(eet_node);
-}
-END_TEST
-/**
- *@}
- */
-Suite *
-test_suite(void)
-{
- Suite *suite = suite_create("utc_eet_node_hash_new");
-
- TCase *tcase = tcase_create("TCase");
- tcase_set_timeout(tcase, 30);
- tcase_add_checked_fixture(tcase, setup, teardown);
- tcase_add_test(tcase, utc_eet_node_hash_new_p);
- tcase_add_test(tcase, utc_eet_node_hash_new_p2);
- tcase_add_test(tcase, utc_eet_node_hash_new_p3);
- tcase_add_test(tcase, utc_eet_node_hash_new_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_eet_node_hash_new.log");
- srunner_set_xml(srunner, "utc_eet_node_hash_new.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 <Eet.h>
-
-/**
- * @addtogroup eet_node
- * @{
- * @defgroup eet_node_inlined_string_new eet_node_inlined_string_new()
- *
- *
- * @precondition
- * @step 1 eet initialized with eet_init()
- */
-static void
-setup(void)
-{
- printf(" ============ Startup ============ \n");
- eet_init();
-}
-
-static void
-teardown(void)
-{
- printf(" ============ Cleanup ============ \n");
- eet_shutdown();
-}
-
-/**
- * @addtogroup eet_node_inlined_string_new
- * @{
- * @objective Positive test case 1 checks if function returns valid pointer
- * to Eet_Node with type EET_T_INLINED_STRING if it is called with correct arguments.
- * @n Input data: "test" as name of node and "inlined string" as it's value.
- *
- * @procedure
- * @step 1 Initialization of pointer to Eet_Node with correct arguments.
- *
- * @passcondition Returned pointer to Eet_Node is not NULL and type of the node is EET_T_INLINED_STRING.
- * @}
- */
-START_TEST(utc_eet_node_inlined_string_new_p)
-{
- Eet_Node *eet_node = eet_node_inlined_string_new("test", "inlined string");
-
- if (!eet_node)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Function has returned NULL..", __FILE__, __LINE__);
- }
- else if (eet_node_type_get(eet_node) != EET_T_INLINED_STRING)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node has wrong type..", __FILE__, __LINE__);
- }
- else
- {
- printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
- }
- eet_node_del(eet_node);
-}
-END_TEST
-
-/**
- * @addtogroup eet_node_inlined_string_new
- * @{
- * @objective Positive test case 2 checks if function returns valid pointer
- * to Eet_Node with type EET_T_INLINED_STRING if it is called with NULL instead of node's name.
- * @n Input data: NULL as name of node and "inlined string" as it's value.
- *
- * @procedure
- * @step 1 Initialization of pointer to Eet_Node with NULL instead of valid name.
- *
- * @passcondition Returned pointer to Eet_Node is not NULL and type of the node is EET_T_INLINED_STRING.
- * @}
- */
-START_TEST(utc_eet_node_inlined_string_new_p2)
-{
- Eet_Node *eet_node = eet_node_inlined_string_new(NULL, "inlined string");
-
- if (!eet_node)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Function has returned NULL..", __FILE__, __LINE__);
- }
- else if (eet_node_type_get(eet_node) != EET_T_INLINED_STRING)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node has wrong type..", __FILE__, __LINE__);
- }
- else
- {
- printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
- }
- eet_node_del(eet_node);
-}
-END_TEST
-
-/**
- * @addtogroup eet_node_inlined_string_new
- * @{
- * @objective Positive test case 3 checks if function returns valid pointer
- * to Eet_Node with type EET_T_INLINED_STRING if it is called with incorrect value.
- * @n Input data: "test" as name of node and NULL as value.
- *
- * @procedure
- * @step 1 Initialization of pointer to Eet_Node with name "test" and NULL value.
- *
- * @passcondition Returned pointer to Eet_Node is not NULL and type of the node is EET_T_INLINED_STRING.
- * @}
- */
-START_TEST(utc_eet_node_inlined_string_new_p3)
-{
- Eet_Node *eet_node = eet_node_inlined_string_new("test", NULL);
-
- if (!eet_node)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Function has returned NULL..", __FILE__, __LINE__);
- }
- else if (eet_node_type_get(eet_node) != EET_T_INLINED_STRING)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node has wrong type..", __FILE__, __LINE__);
- }
- else
- {
- printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
- }
- eet_node_del(eet_node);
-}
-END_TEST
-/**
- *@}
- */
-Suite *
-test_suite(void)
-{
- Suite *suite = suite_create("utc_eet_node_inlined_string_new");
-
- TCase *tcase = tcase_create("TCase");
- tcase_set_timeout(tcase, 30);
- tcase_add_checked_fixture(tcase, setup, teardown);
- tcase_add_test(tcase, utc_eet_node_inlined_string_new_p);
- tcase_add_test(tcase, utc_eet_node_inlined_string_new_p2);
- tcase_add_test(tcase, utc_eet_node_inlined_string_new_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_eet_node_inlined_string_new.log");
- srunner_set_xml(srunner, "utc_eet_node_inlined_string_new.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 <Eet.h>
-#include <limits.h>
-
-/**
- * @addtogroup eet_node
- * @{
- * @defgroup eet_node_int_new eet_node_int_new()
- *
- *
- * @precondition
- * @step 1 eet initialized with eet_init()
- */
-static void
-setup(void)
-{
- printf(" ============ Startup ============ \n");
- eet_init();
-}
-
-static void
-teardown(void)
-{
- printf(" ============ Cleanup ============ \n");
- eet_shutdown();
-}
-
-/**
- * @addtogroup eet_node_int_new
- * @{
- * @objective Positive test case 1 checks if function returns valid pointer
- * to Eet_Node with type EET_T_INT if it is called with correct arguments.
- * @n Input data: "test" as name of node and 1 as it's value.
- *
- * @procedure
- * @step 1 Initialization of pointer to Eet_Node with name "test" and int 1.
- *
- * @passcondition Returned pointer to Eet_Node is not NULL and type of the node is EET_T_INT.
- * @}
- */
-START_TEST(utc_eet_node_int_new_p)
-{
- Eet_Node *eet_node = eet_node_int_new("test", 1);
-
- if (!eet_node)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Function has returned NULL..", __FILE__, __LINE__);
- }
- else if (eet_node_type_get(eet_node) != EET_T_INT)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node has wrong type..", __FILE__, __LINE__);
- }
- else
- {
- printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
- }
- eet_node_del(eet_node);
-}
-END_TEST
-
-/**
- * @addtogroup eet_node_int_new
- * @{
- * @objective Positive test case 2 checks if function returns valid pointer
- * to Eet_Node with type EET_T_INT if it is called with NULL instead of node's name.
- * @n Input data: NULL as name of node and 1 as it's value.
- *
- * @procedure
- * @step 1 Initialization of pointer to Eet_Node with NULL name and correct value.
- *
- * @passcondition Returned pointer to Eet_Node is not NULL and type of the node is EET_T_INT.
- * @}
- */
-START_TEST(utc_eet_node_int_new_p2)
-{
- Eet_Node *eet_node = eet_node_int_new(NULL, 1);
-
- if (!eet_node)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Function has returned NULL..", __FILE__, __LINE__);
- }
- else if (eet_node_type_get(eet_node) != EET_T_INT)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node has wrong type..", __FILE__, __LINE__);
- }
- else
- {
- printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
- }
- eet_node_del(eet_node);
-}
-END_TEST
-
-/**
- * @addtogroup eet_node_int_new
- * @{
- * @objective Positive test case 3 checks if function returns valid pointer
- * to Eet_Node with type EET_T_INT if it is called with incorrect value.
- * @n Input data: "test" as name of node and INT_MAX + 1 as value.
- *
- * @procedure
- * @step 1 Initialization of pointer to Eet_Node with name "test" and INT_MAX + 1.
- *
- * @passcondition Returned pointer to Eet_Node is not NULL and type of the node is EET_T_INT.
- * @}
- */
-START_TEST(utc_eet_node_int_new_p3)
-{
- Eet_Node *eet_node = eet_node_int_new("test", INT_MAX + 1);
-
- if (!eet_node)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Function has returned NULL..", __FILE__, __LINE__);
- }
- else if (eet_node_type_get(eet_node) != EET_T_INT)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node has wrong type..", __FILE__, __LINE__);
- }
- else
- {
- printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
- }
- eet_node_del(eet_node);
-}
-END_TEST
-/**
- *@}
- */
-Suite *
-test_suite(void)
-{
- Suite *suite = suite_create("utc_eet_node_int_new");
-
- TCase *tcase = tcase_create("TCase");
- tcase_set_timeout(tcase, 30);
- tcase_add_checked_fixture(tcase, setup, teardown);
- tcase_add_test(tcase, utc_eet_node_int_new_p);
- tcase_add_test(tcase, utc_eet_node_int_new_p2);
- tcase_add_test(tcase, utc_eet_node_int_new_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_eet_node_int_new.log");
- srunner_set_xml(srunner, "utc_eet_node_int_new.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 <Eet.h>
-
-/**
- * @addtogroup eet_node
- * @{
- * @defgroup eet_node_list_append eet_node_list_append()
- *
- *
- * @precondition
- * @step 1 eet initialized with eet_init()
- */
-static void
-setup(void)
-{
- printf(" ============ Startup ============ \n");
- eet_init();
-}
-
-static void
-teardown(void)
-{
- printf(" ============ Cleanup ============ \n");
- eet_shutdown();
-}
-
-/**
- * @addtogroup eet_node_list_append
- * @{
- * @objective Positive test case 1 checks if function returns valid pointer
- * to Eet_Node with type EET_G_LIST if it is called with correct arguments.
- * @n Input data:
- * @li eet_node_parent as node.
- * @li child_name as name of node.
- * @li eet_node_child pointer to created Eina_Node to be hashed.
- *
- * @procedure
- * @step 1 Create new eet nodes to be hashed.
- * @step 2 Initialization of pointer to hash Eet_Node with correct arguments.
- * @step 3 Append eet_node_child to the list and check type node.
- * @step 3 Append eet_node_next to the list and check type node.
- * @step 4 Get child node and check value node.
- * @step 5 Get child next and check value node.
- *
- * @passcondition Test passes if returned values are the same as add values.
- * @}
- */
-START_TEST(utc_eet_node_list_append_p)
-{
- const char *parent_name = "test_parent";
- const char *child_name = "test_child";
- Eet_Node *eet_node_list = NULL;
- Eet_Node *eet_node_rest = NULL;
- Eet_Node *eet_node_next_res = NULL;
- Eet_Node *eet_node_parent = eet_node_int_new(parent_name, 1);
- Eet_Node *eet_node_child = eet_node_int_new(child_name, 2);
- Eet_Node *eet_node_next = eet_node_int_new(child_name, 3);
-
- if ((!eet_node_parent) || (!eet_node_child) || (!eet_node_next))
- {
- if (eet_node_next)
- eet_node_del(eet_node_next);
-
- if (eet_node_child)
- eet_node_del(eet_node_child);
-
- if (eet_node_parent)
- eet_node_del(eet_node_parent);
-
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. ", __FILE__, __LINE__);
- }
-
- eet_node_list_append(eet_node_parent, child_name, eet_node_child);
- eet_node_list_append(eet_node_parent, child_name, eet_node_next);
-
- if (!(eet_node_list = eet_node_children_get(eet_node_parent)))
- {
- eet_node_del(eet_node_next);
- eet_node_del(eet_node_child);
- eet_node_del(eet_node_parent);
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. ", __FILE__, __LINE__);
- }
-
- if (eet_node_type_get(eet_node_list) != EET_G_LIST)
- {
- eet_node_del(eet_node_list);
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node has wrong type.. ", __FILE__, __LINE__);
- }
-
- if ((!(eet_node_rest = eet_node_children_get(eet_node_list))) || (eet_node_value_get(eet_node_rest)->value.i != 2))
- {
- eet_node_del(eet_node_list);
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. ", __FILE__, __LINE__);
- }
-
- if ((!(eet_node_next_res = eet_node_next_get(eet_node_rest))) || (eet_node_value_get(eet_node_next_res)->value.i != 3))
- {
- eet_node_del(eet_node_list);
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. ", __FILE__, __LINE__);
- }
-
- printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
-
- eet_node_del(eet_node_list);
-}
-END_TEST
-
-/**
- * @addtogroup eet_node_list_append
- * @{
- * @objective Positive test case 2 checks if function returns valid pointer
- * to Eet_Node with type EET_G_LIST if it is called with NULL instead of node's name.
- * @n Input data:
- * @li eet_node_parent as node.
- * @li child_name as name of node.
- * @li eet_node_child pointer to created Eina_Node to be hashed.
- *
- * @procedure
- * @step 1 Create new eet nodes to be hashed.
- * @step 2 Initialization of pointer to hash Eet_Node with correct arguments.
- * @step 3 Append eet_node_child to the list and check type node.
- * @step 4 Get child node and check value node.
- *
- * @passcondition Test passes if returned values are the same as add values.
- * @}
- */
-START_TEST(utc_eet_node_list_append_p2)
-{
- const char *parent_name = "test_parent";
- const char *child_name = "test_child";
- Eet_Node *eet_node_list = NULL;
- Eet_Node *eet_node_rest = NULL;
- Eet_Node *eet_node_parent = eet_node_int_new(parent_name, 1);
- Eet_Node *eet_node_child = eet_node_int_new(child_name, 2);
-
- if ((!eet_node_parent) || (!eet_node_child))
- {
- if (eet_node_child)
- eet_node_del(eet_node_child);
-
- if (eet_node_parent)
- eet_node_del(eet_node_parent);
-
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node to be hashed is not created..", __FILE__, __LINE__);
- }
-
- eet_node_list_append(eet_node_parent, NULL, eet_node_child);
-
- if (!(eet_node_list = eet_node_children_get(eet_node_parent)))
- {
- eet_node_del(eet_node_child);
- eet_node_del(eet_node_parent);
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. ", __FILE__, __LINE__);
- }
-
- if (eet_node_type_get(eet_node_list) != EET_G_LIST)
- {
- eet_node_del(eet_node_list);
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. ", __FILE__, __LINE__);
- }
-
- if ((!(eet_node_rest = eet_node_children_get(eet_node_list))) || (eet_node_value_get(eet_node_rest)->value.i != 2))
- {
- eet_node_del(eet_node_list);
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. ", __FILE__, __LINE__);
- }
-
- printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
-
- eet_node_del(eet_node_list);
-}
-END_TEST
-
-
-/**
- *@}
- */
-Suite *
-test_suite(void)
-{
- Suite *suite = suite_create("utc_eet_node_list_append");
-
- TCase *tcase = tcase_create("TCase");
- tcase_set_timeout(tcase, 30);
- tcase_add_checked_fixture(tcase, setup, teardown);
- tcase_add_test(tcase, utc_eet_node_list_append_p);
- tcase_add_test(tcase, utc_eet_node_list_append_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_eet_node_list_append.log");
- srunner_set_xml(srunner, "utc_eet_node_list_append.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 <Eet.h>
-
-/**
- * @addtogroup eet_node
- * @{
- * @defgroup eet_node_list_new eet_node_list_new()
- *
- *
- * @precondition
- * @step 1 eet initialized with eet_init()
- */
-static void
-setup(void)
-{
- printf(" ============ Startup ============ \n");
- eet_init();
-}
-
-static void
-teardown(void)
-{
- printf(" ============ Cleanup ============ \n");
- eet_shutdown();
-}
-
-/**
- * @addtogroup eet_node_list_new
- * @{
- * @objective Positive test case 1 checks if function returns valid pointer
- * to Eet_Node with type EET_G_LIST if it is called with correct arguments.
- * @n Input data: "test" as name of node, pointer to created Eina_List with one element.
- *
- * @procedure
- * @step 1 Create new Eina_List with one element.
- * @step 2 Initialization of pointer to Eet_Node with correct arguments.
- *
- * @passcondition Returned pointer to Eet_Node is not NULL and type of the node is EET_G_LIST.
- * @}
- */
-START_TEST(utc_eet_node_list_new_p)
-{
- Eet_Node *eet_node = NULL;
- Eina_List *eina_list = NULL;
- Eet_Node *node = eet_node_null_new("test");
-
- if (!node)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node is not created..", __FILE__, __LINE__);
- }
- else if (!(eina_list = eina_list_append(eina_list, node)))
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eina_List is not created..", __FILE__, __LINE__);
- }
- else if (!(eet_node = eet_node_list_new("test", eina_list)))
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Function has returned NULL..", __FILE__, __LINE__);
- }
- else if (eet_node_type_get(eet_node) != EET_G_LIST)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node has wrong type..", __FILE__, __LINE__);
- }
- else
- {
- printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
- }
- eet_node_del(eet_node);
-}
-END_TEST
-
-/**
- * @addtogroup eet_node_list_new
- * @{
- * @objective Positive test case 2 checks if function returns valid pointer
- * to Eet_Node with type EET_G_LIST if it is called with NULL instead of node's name.
- * @n Input data: NULL as name of node, pointer to created Eina_List.
- *
- * @procedure
- * @step 1 Create new Eina_List with one element.
- * @step 2 Initialization of pointer to Eet_Node with NULL instead of valid name.
- *
- * @passcondition Returned pointer to Eet_Node is not NULL and type of the node is EET_G_LIST.
- * @}
- */
-START_TEST(utc_eet_node_list_new_p2)
-{
- Eet_Node *eet_node = NULL;
- Eina_List *eina_list = NULL;
- Eet_Node *node = eet_node_null_new("test");
-
- if (!node)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node is not created..", __FILE__, __LINE__);
- }
- else if (!(eina_list = eina_list_append(eina_list, node)))
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eina_List is not created..", __FILE__, __LINE__);
- }
- else if (!(eet_node = eet_node_list_new(NULL, eina_list)))
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Function has returned NULL..", __FILE__, __LINE__);
- }
- else if (eet_node_type_get(eet_node) != EET_G_LIST)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node has wrong type..", __FILE__, __LINE__);
- }
- else
- {
- printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
- }
- eet_node_del(eet_node);
-}
-END_TEST
-
-/**
- * @addtogroup eet_node_list_new
- * @{
- * @objective Positive test case 3 checks if function returns valid pointer
- * to Eet_Node with type EET_G_LIST if it is called with NULL instead of Eina_list.
- * @n Input data: "test" as name of node, NULL instead of Eina_List.
- *
- * @procedure
- * @step 1 Initialization of pointer to Eet_Node with NULL instead of pointer to Eina_List with data.
- *
- * @passcondition Returned pointer to Eet_Node is not NULL and type of the node is EET_G_LIST.
- * @}
- */
-START_TEST(utc_eet_node_list_new_p3)
-{
- Eet_Node *eet_node = eet_node_list_new("test", NULL);
-
- if (!eet_node)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Function has returned NULL..", __FILE__, __LINE__);
- }
- else if (eet_node_type_get(eet_node) != EET_G_LIST)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node has wrong type..", __FILE__, __LINE__);
- }
- else
- {
- printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
- }
- eet_node_del(eet_node);
-}
-END_TEST
-/**
- *@}
- */
-Suite *
-test_suite(void)
-{
- Suite *suite = suite_create("utc_eet_node_list_new");
-
- TCase *tcase = tcase_create("TCase");
- tcase_set_timeout(tcase, 30);
- tcase_add_checked_fixture(tcase, setup, teardown);
- tcase_add_test(tcase, utc_eet_node_list_new_p);
- tcase_add_test(tcase, utc_eet_node_list_new_p2);
- tcase_add_test(tcase, utc_eet_node_list_new_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_eet_node_list_new.log");
- srunner_set_xml(srunner, "utc_eet_node_list_new.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 <Eet.h>
-
-/**
- * @addtogroup eet_node
- * @{
- * @defgroup eet_node_long_long_new eet_node_long_long_new()
- *
- *
- * @precondition
- * @step 1 eet initialized with eet_init()
- */
-static void
-setup(void)
-{
- printf(" ============ Startup ============ \n");
- eet_init();
-}
-
-static void
-teardown(void)
-{
- printf(" ============ Cleanup ============ \n");
- eet_shutdown();
-}
-
-/**
- * @addtogroup eet_node_long_long_new
- * @{
- * @objective Positive test case 1 checks if function returns valid pointer
- * to Eet_Node with type EET_T_LONG_LONG if it is called with correct arguments.
- * @n Input data: "test" as name of node and 1LL as it's value.
- *
- * @procedure
- * @step 1 Initialization of pointer to Eet_Node with correct arguments.
- *
- * @passcondition Returned pointer to Eet_Node is not NULL and type of the node is EET_T_LONG_LONG.
- * @}
- */
-START_TEST(utc_eet_node_long_long_new_p)
-{
- Eet_Node *eet_node = eet_node_long_long_new("test", 1LL);
-
- if (!eet_node)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Function has returned NULL..", __FILE__, __LINE__);
- }
- else if (eet_node_type_get(eet_node) != EET_T_LONG_LONG)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node has wrong type..", __FILE__, __LINE__);
- }
- else
- {
- printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
- }
- eet_node_del(eet_node);
-}
-END_TEST
-
-/**
- * @addtogroup eet_node_long_long_new
- * @{
- * @objective Positive test case 2 checks if function returns valid pointer
- * to Eet_Node with type EET_T_LONG_LONG if it is called with NULL instead of node's name.
- * @n Input data: NULL as name of node and 1LL as it's value.
- *
- * @procedure
- * @step 1 Initialization of pointer to Eet_Node with NULL instead of valid name.
- *
- * @passcondition Returned pointer to Eet_Node is not NULL and type of the node is EET_T_LONG_LONG.
- * @}
- */
-
-START_TEST(utc_eet_node_long_long_new_p2)
-{
- Eet_Node *eet_node = eet_node_long_long_new(NULL, 1LL);
-
- if (!eet_node)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Function has returned NULL..", __FILE__, __LINE__);
- }
- else if (eet_node_type_get(eet_node) != EET_T_LONG_LONG)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node has wrong type..", __FILE__, __LINE__);
- }
- else
- {
- printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
- }
- eet_node_del(eet_node);
-}
-END_TEST
-
-/**
- * @addtogroup eet_node_long_long_new
- * @{
- * @objective Positive test case 3 checks if function returns valid pointer
- * to Eet_Node with type EET_T_LONG_LONG if it is called with incorrect value.
- * @n Input data: "test" as name of node and LLONG_MAX + 1 as value.
- *
- * @procedure
- * @step 1 Initialization of pointer to Eet_Node with name "test" and incorrect value.
- *
- * @passcondition Returned pointer to Eet_Node is not NULL and type of the node is EET_T_LONG_LONG.
- * @}
- */
-START_TEST(utc_eet_node_long_long_new_p3)
-{
- Eet_Node *eet_node = eet_node_long_long_new("test", LLONG_MAX + 1);
-
- if (!eet_node)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Function has returned NULL..", __FILE__, __LINE__);
- }
- else if (eet_node_type_get(eet_node) != EET_T_LONG_LONG)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node has wrong type..", __FILE__, __LINE__);
- }
- else
- {
- printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
- }
- eet_node_del(eet_node);
-}
-END_TEST
-/**
- *@}
- */
-Suite *
-test_suite(void)
-{
- Suite *suite = suite_create("utc_eet_node_long_long_new");
-
- TCase *tcase = tcase_create("TCase");
- tcase_set_timeout(tcase, 30);
- tcase_add_checked_fixture(tcase, setup, teardown);
- tcase_add_test(tcase, utc_eet_node_long_long_new_p);
- tcase_add_test(tcase, utc_eet_node_long_long_new_p2);
- tcase_add_test(tcase, utc_eet_node_long_long_new_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_eet_node_long_long_new.log");
- srunner_set_xml(srunner, "utc_eet_node_long_long_new.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 <Eet.h>
-#include "../../utc_negative_unitest.h"
-
-/**
- * @addtogroup eet_node
- * @{
- * @defgroup eet_node_next_get eet_node_next_get()
- *
- *
- * @precondition
- * @step 1 eet initialized with eet_init()
- */
-static void
-setup(void)
-{
- printf(" ============ Startup ============ \n");
- eet_init();
-}
-
-static void
-teardown(void)
-{
- printf(" ============ Cleanup ============ \n");
- eet_shutdown();
-}
-
-/**
- * @addtogroup eet_node_next_get
- * @{
- * @objective Positive test case checks if the function called on one of children nodes returns
- * a pointer to following child.
- * @n Input Data: Eet_Node - second node in prepared list, that is not last node, so it has next.
- *
- * @procedure
- * @step 1 Initialization three pointers pointing to Eet_Node using eet_node_int_new, each with an integer as value.
- * @step 2 Using eet_node_list_append to add to list with first node as parent and the second node as child.
- * @step 3 Using eet_node_list_append to add to list with first node as parent and the third node as child.
- * @step 4 Initialization of a pointer 'next' pointing at Eet_Node with a function eet_node_next_get
- * with the second node as a parameter.
- *
- * @passcondition Function returns pointer to Eet_Node that equals to third node, added to list before it.
- * @}
- */
-START_TEST(utc_eet_node_next_get_p)
-{
- Eet_Node *eet_node = eet_node_int_new("test", 3);
- Eet_Node *eet_node2 = eet_node_int_new("test", 3);
- Eet_Node *eet_node3 = eet_node_int_new("test", 3);
-
- if (!eet_node || !eet_node2 || !eet_node3)
- {
- eet_node_del(eet_node);
- eet_node_del(eet_node2);
- eet_node_del(eet_node3);
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node is not created..", __FILE__, __LINE__);
- }
-
- eet_node_list_append(eet_node, "list", eet_node2);
- eet_node_list_append(eet_node, "list", eet_node3);
-
- Eet_Node *next = eet_node_next_get(eet_node2);
-
- if (next != eet_node3)
- {
- eet_node_del(eet_node);
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
- }
- eet_node_del(eet_node);
- printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
-}
-END_TEST
-
-/**
- * @addtogroup eet_node_next_get
- * @{
- * @objective Negative test case 1 checks if the function called on the last child returns NULL.
- * @n Input Data: Eet_Node - third node in prepared list, that is last node and it hasn't any next.
- *
- * @procedure
- * @step 1 Initialization three pointers pointing to Eet_Node using eet_node_int_new, each with an integer as value.
- * @step 2 Using eet_node_list_append to add to list with first node as parent and the second node as child.
- * @step 3 Using eet_node_list_append to add to list with first node as parent and the third node as child.
- * @step 4 Initialization of a pointer 'next' pointing at Eet_Node with a function eet_node_next_get
- * with the third (last) node as a parameter.
- *
- * @passcondition Function returns NULL.
- * @}
- */
-START_TEST(utc_eet_node_next_get_n)
-{
- Eet_Node *eet_node = eet_node_int_new("test", 3);
- Eet_Node *eet_node2 = eet_node_int_new("test", 3);
- Eet_Node *eet_node3 = eet_node_int_new("test", 3);
-
- if (!eet_node || !eet_node2 || !eet_node3)
- {
- eet_node_del(eet_node);
- eet_node_del(eet_node2);
- eet_node_del(eet_node3);
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node is not created..", __FILE__, __LINE__);
- }
-
- eet_node_list_append(eet_node, "list", eet_node2);
- eet_node_list_append(eet_node, "list", eet_node3);
-
- Eet_Node *next = eet_node_next_get(eet_node3);
-
- if (next != NULL)
- {
- eet_node_del(eet_node);
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
- }
- eet_node_del(eet_node);
- printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
-}
-END_TEST
-
-/**
- * @addtogroup eet_node_next_get
- * @{
- * @objective Negative test case 2 checks if function doesn't cause segmentation fault
- * and returns NULL if it is called with NULL instead of any argument.
- * @n Input Data: pointer to created Eina_Node with type EET_T_INT (it's replaced by NULL
- * when function is called).
- *
- * @procedure
- * @step 1 Create new Eina_Node.
- * @step 2 Call function once and pass NULL instead of created Eet_Node.
- *
- * @passcondition Function doesn't cause segmentation fault and returns NULL.
- * @}
- */
-START_TEST(utc_eet_node_next_get_n2)
-{
- Eet_Node *eet_node = eet_node_int_new("test", 3);
-
- int result = UNITEST_FUNC_NEG_RET(NULL, eet_node_next_get, eet_node);
-
- if (result == TEST_FAIL)
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
- else
- printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
-
- eet_node_del(eet_node);
-}
-END_TEST
-/**
- *@}
- */
-Suite *
-test_suite(void)
-{
- Suite *suite = suite_create("utc_eet_node_next_get");
-
- TCase *tcase = tcase_create("TCase");
- tcase_set_timeout(tcase, 30);
- tcase_add_checked_fixture(tcase, setup, teardown);
- tcase_add_test(tcase, utc_eet_node_next_get_p);
- tcase_add_test(tcase, utc_eet_node_next_get_n);
- tcase_add_test(tcase, utc_eet_node_next_get_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_eet_node_next_get.log");
- srunner_set_xml(srunner, "utc_eet_node_next_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 <Eet.h>
-
-/**
- * @addtogroup eet_node
- * @{
- * @defgroup eet_node_null_new eet_node_null_new()
- *
- *
- * @precondition
- * @step 1 eet initialized with eet_init()
- */
-static void
-setup(void)
-{
- printf(" ============ Startup ============ \n");
- eet_init();
-}
-
-static void
-teardown(void)
-{
- printf(" ============ Cleanup ============ \n");
- eet_shutdown();
-}
-
-/**
- * @addtogroup eet_node_null_new
- * @{
- * @objective Positive test case 1 checks if function returns valid pointer
- * to Eet_Node with type EET_T_NULL if it is called with correct argument.
- * @n Input data: "test" as name of node.
- *
- * @procedure
- * @step 1 Initialization of pointer to Eet_Node with correct argument.
- *
- * @passcondition Returned pointer to Eet_Node is not NULL and type of the node is EET_T_NULL.
- * @}
- */
-START_TEST(utc_eet_node_null_new_p)
-{
- Eet_Node *eet_node = eet_node_null_new("test");
-
- if (!eet_node)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Function has returned NULL..", __FILE__, __LINE__);
- }
- else if (eet_node_type_get(eet_node) != EET_T_NULL)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node has wrong type..", __FILE__, __LINE__);
- }
- else
- {
- printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
- }
- eet_node_del(eet_node);
-}
-END_TEST
-
-/**
- * @addtogroup eet_node_null_new
- * @{
- * @objective Positive test case 2 checks if function returns valid pointer
- * to Eet_Node with type EET_T_NULL if it is called with NULL instead of node's name.
- * @n Input data: NULL as name of node.
- *
- * @procedure
- * @step 1 Initialization of pointer to Eet_Node with NULL instead of valid name.
- *
- * @passcondition Returned pointer to Eet_Node is not NULL and type of the node is EET_T_NULL.
- * @}
- */
-START_TEST(utc_eet_node_null_new_p2)
-{
- Eet_Node *eet_node = eet_node_null_new(NULL);
-
- if (!eet_node)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Function has returned NULL..", __FILE__, __LINE__);
- }
- else if (eet_node_type_get(eet_node) != EET_T_NULL)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node has wrong type..", __FILE__, __LINE__);
- }
- else
- {
- printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
- }
- eet_node_del(eet_node);
-}
-END_TEST
-/**
- *@}
- */
-Suite *
-test_suite(void)
-{
- Suite *suite = suite_create("utc_eet_node_null_new");
-
- TCase *tcase = tcase_create("TCase");
- tcase_set_timeout(tcase, 30);
- tcase_add_checked_fixture(tcase, setup, teardown);
- tcase_add_test(tcase, utc_eet_node_null_new_p);
- tcase_add_test(tcase, utc_eet_node_null_new_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_eet_node_null_new.log");
- srunner_set_xml(srunner, "utc_eet_node_null_new.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 <Eet.h>
-#include "../../utc_negative_unitest.h"
-
-/**
- * @addtogroup eet_node
- * @{
- * @defgroup eet_node_parent_get eet_node_parent_get()
- *
- *
- * @precondition
- * @step 1 eet initialized with eet_init()
- */
-static void
-setup(void)
-{
- printf(" ============ Startup ============ \n");
- eet_init();
-}
-
-static void
-teardown(void)
-{
- printf(" ============ Cleanup ============ \n");
- eet_shutdown();
-}
-
-/**
- * @addtogroup eet_node_parent_get
- * @{
- * @objective Positive test case checking if the function returns a parent of a given node.
- * @n Input Data: Eet_Node that has parent node.
- *
- * @procedure
- * @step 1 Initialization of pointer to Eina_List and appending test_data to it via eina_list_append.
- * @step 2 Obtaining a pointer to Eet_Node using eet_node_list_new with the pointer to Eina_List as a parameter.
- * @step 3 Obtaining a pointer 'eet_node_children' using pointer from step 2 as a parameter.
- * @step 4 Obtaining a pointer 'eet_node_parent' using pointer from step 3 as a parameter.
- *
- * @passcondition Function returns pointer that is not NULL.
- * @}
- */
-START_TEST(utc_eet_node_parent_get_p)
-{
- Eet_Node *eet_node = NULL;
- Eina_List *eina_list = NULL;
- Eet_Node *eet_node_children = NULL;
- Eet_Node *node = eet_node_null_new("test");
-
- if (!node)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node is not created..", __FILE__, __LINE__);
- }
- else if (!(eina_list = eina_list_append(eina_list, node)))
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eina_List is not created..", __FILE__, __LINE__);
- }
- else if (!(eet_node = eet_node_list_new("test", eina_list)))
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eina_List is not created..", __FILE__, __LINE__);
- }
- else if (!(eet_node_children = eet_node_children_get(eet_node)))
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Child Eet_Node isn't taken from list", __FILE__, __LINE__);
- }
- else if (eet_node != eet_node_parent_get(eet_node_children))
- {
-/* TODO replace printf by ck_abort_msg when API will be fixed*/
- printf("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
- }
- else
- {
- printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
- }
- eet_node_del(eet_node);
-}
-END_TEST
-
-/**
- * @addtogroup eet_node_parent_get
- * @{
- * @objective Negative test case 1 checks if the function returns NULL for Eet_Node that has no parents.
- * @n Input Data: Eet_Node with type EET_T_INT that has no parents.
- *
- * @procedure
- * @step 1 Initializing a pointer to Eet_Node.
- * @step 2 Trying to obtain a pointer to parent Eet_Node using pointer from step 1 as a parameter.
- *
- * @passcondition Function returns NULL.
- * @}
- */
-START_TEST(utc_eet_node_parent_get_n)
-{
- Eet_Node *eet_node = eet_node_int_new("test", 3);
-
- if (!eet_node)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_node is not created..", __FILE__, __LINE__);
- }
- else if (eet_node_parent_get(eet_node))
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
- }
- else
- {
- printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
- }
- eet_node_del(eet_node);
-}
-END_TEST
-
-/**
- * @addtogroup eet_node_parent_get
- * @{
- * @objective Negative test case 2 checks if function doesn't cause segmentation fault
- * and returns NULL if it is called with NULL instead of any argument.
- * @n Input Data: pointer to created Eina_Node with type EET_T_NULL (it's replaced by NULL
- * when function is called).
- *
- * @procedure
- * @step 1 Create new Eina_Node.
- * @step 2 Call function once and pass NULL instead of created Eet_Node.
- *
- * @passcondition Function doesn't cause segmentation fault and returns NULL.
- * @}
- */
-START_TEST(utc_eet_node_parent_get_n2)
-{
- Eet_Node *eet_node = eet_node_null_new("test");
-
- int result = UNITEST_FUNC_NEG_RET(NULL, eet_node_parent_get, eet_node);
-
- if (result == TEST_FAIL)
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
- else
- printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
-
- eet_node_del(eet_node);
-}
-END_TEST
-/**
- *@}
- */
-Suite *
-test_suite(void)
-{
- Suite *suite = suite_create("utc_eet_node_parent_get");
-
- TCase *tcase = tcase_create("TCase");
- tcase_set_timeout(tcase, 30);
- tcase_add_checked_fixture(tcase, setup, teardown);
- tcase_add_test(tcase, utc_eet_node_parent_get_p);
- tcase_add_test(tcase, utc_eet_node_parent_get_n);
- tcase_add_test(tcase, utc_eet_node_parent_get_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_eet_node_parent_get.log");
- srunner_set_xml(srunner, "utc_eet_node_parent_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 <Eet.h>
-#include <limits.h>
-
-/**
- * @addtogroup eet_node
- * @{
- * @defgroup eet_node_short_new eet_node_short_new()
- *
- *
- * @precondition
- * @step 1 eet initialized with eet_init()
- */
-static void
-setup(void)
-{
- printf(" ============ Startup ============ \n");
- eet_init();
-}
-
-static void
-teardown(void)
-{
- printf(" ============ Cleanup ============ \n");
- eet_shutdown();
-}
-
-/**
- * @addtogroup eet_node_short_new
- * @{
- * @objective Positive test case 1 checks if function returns valid pointer
- * to Eet_Node with type EET_T_SHORT if it is called with correct arguments.
- * @n Input data: "test" as name of node and (short)1 as it's value.
- *
- * @procedure
- * @step 1 Initialization of pointer to Eet_Node with correct arguments.
- *
- * @passcondition Returned pointer to Eet_Node is not NULL and type of the node is EET_T_SHORT.
- * @}
- */
-START_TEST(utc_eet_node_short_new_p)
-{
- Eet_Node *eet_node = eet_node_short_new("test", (short)1);
-
- if (!eet_node)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Function has returned NULL..", __FILE__, __LINE__);
- }
- else if (eet_node_type_get(eet_node) != EET_T_SHORT)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node has wrong type..", __FILE__, __LINE__);
- }
- else
- {
- printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
- }
- eet_node_del(eet_node);
-}
-END_TEST
-
-/**
- * @addtogroup eet_node_short_new
- * @{
- * @objective Positive test case 2 checks if function returns valid pointer
- * to Eet_Node with type EET_T_SHORT if it is called with NULL instead of node's name.
- * @n Input data: NULL as name of node and (short)1 as it's value.
- *
- * @procedure
- * @step 1 Initialization of pointer to Eet_Node with NULL instead of valid name.
- *
- * @passcondition Returned pointer to Eet_Node is not NULL and type of the node is EET_T_SHORT.
- * @}
- */
-START_TEST(utc_eet_node_short_new_p2)
-{
- Eet_Node *eet_node = eet_node_short_new(NULL, (short)1);
-
- if (!eet_node)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Function has returned NULL..", __FILE__, __LINE__);
- }
- else if (eet_node_type_get(eet_node) != EET_T_SHORT)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node has wrong type..", __FILE__, __LINE__);
- }
- else
- {
- printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
- }
- eet_node_del(eet_node);
-}
-END_TEST
-
-/**
- * @addtogroup eet_node_short_new
- * @{
- * @objective Positive test case 3 checks if function returns valid pointer
- * to Eet_Node with type EET_T_SHORT if it is called with incorrect value.
- * @n Input data: "test" as name of node and SHRT_MAX + 1 as value.
- *
- * @procedure
- * @step 1 Initialization of pointer to Eet_Node with name "test" and incorrect value.
- *
- * @passcondition Returned pointer to Eet_Node is not NULL and type of the node is EET_T_SHORT.
- * @}
- */
-START_TEST(utc_eet_node_short_new_p3)
-{
- Eet_Node *eet_node = eet_node_short_new("test", SHRT_MAX + 1);
-
- if (!eet_node)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Function has returned NULL..", __FILE__, __LINE__);
- }
- else if (eet_node_type_get(eet_node) != EET_T_SHORT)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node has wrong type..", __FILE__, __LINE__);
- }
- else
- {
- printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
- }
- eet_node_del(eet_node);
-}
-END_TEST
-/**
- *@}
- */
-Suite *
-test_suite(void)
-{
- Suite *suite = suite_create("utc_eet_node_short_new");
-
- TCase *tcase = tcase_create("TCase");
- tcase_set_timeout(tcase, 30);
- tcase_add_checked_fixture(tcase, setup, teardown);
- tcase_add_test(tcase, utc_eet_node_short_new_p);
- tcase_add_test(tcase, utc_eet_node_short_new_p2);
- tcase_add_test(tcase, utc_eet_node_short_new_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_eet_node_short_new.log");
- srunner_set_xml(srunner, "utc_eet_node_short_new.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 <Eet.h>
-#include <Eina.h>
-
-/**
- * @addtogroup eet_node
- * @{
- * @defgroup eet_node_string_new eet_node_string_new()
- *
- *
- * @precondition
- * @step 1 eet initialized with eet_init()
- */
-static void
-setup(void)
-{
- printf(" ============ Startup ============ \n");
- eet_init();
-}
-
-static void
-teardown(void)
-{
- printf(" ============ Cleanup ============ \n");
- eet_shutdown();
-}
-
-/**
- * @addtogroup eet_node_string_new
- * @{
- * @objective Positive test case 1 checks if function returns valid pointer
- * to Eet_Node with type EET_T_STRING if it is called with correct arguments.
- * @n Input data: "test" as name of node and "string" as it's value.
- *
- * @procedure
- * @step 1 Initialization of pointer to Eet_Node with correct arguments.
- *
- * @passcondition Returned pointer to Eet_Node is not NULL and type of the node is EET_T_STRING.
- * @}
- */
-START_TEST(utc_eet_node_string_new_p)
-{
- Eet_Node *eet_node = eet_node_string_new("test", "string");
-
- if (!eet_node)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Function has returned NULL..", __FILE__, __LINE__);
- }
- else if (eet_node_type_get(eet_node) != EET_T_STRING)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node has wrong type..", __FILE__, __LINE__);
- }
- else
- {
- printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
- }
- eet_node_del(eet_node);
-}
-END_TEST
-
-/**
- * @addtogroup eet_node_string_new
- * @{
- * @objective Positive test case 2 checks if function returns valid pointer
- * to Eet_Node with type EET_T_STRING if it is called with NULL instead of node's name.
- * @n Input data: NULL as name of node and "string" as it's value.
- *
- * @procedure
- * @step 1 Initialization of pointer to Eet_Node with NULL instead of valid name.
- *
- * @passcondition Returned pointer to Eet_Node is not NULL and type of the node is EET_T_STRING.
- * @}
- */
-START_TEST(utc_eet_node_string_new_p2)
-{
- Eet_Node *eet_node = eet_node_string_new(NULL, "string");
-
- if (!eet_node)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Function has returned NULL..", __FILE__, __LINE__);
- }
- else if (eet_node_type_get(eet_node) != EET_T_STRING)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node has wrong type..", __FILE__, __LINE__);
- }
- else
- {
- printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
- }
- eet_node_del(eet_node);
-}
-END_TEST
-
-/**
- * @addtogroup eet_node_string_new
- * @{
- * @objective Positive test case 3 checks if function returns valid pointer
- * to Eet_Node with type EET_T_STRING if it is called with incorrect value.
- * @n Input data: "test" as name of node and NULL as value.
- *
- * @procedure
- * @step 1 Initialization of pointer to Eet_Node with name "test" and NULL value.
- *
- * @passcondition Returned pointer to Eet_Node is not NULL and type of the node is EET_T_STRING.
- * @}
- */
-START_TEST(utc_eet_node_string_new_p3)
-{
- Eet_Node *eet_node = eet_node_string_new("test", NULL);
-
- if (!eet_node)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Function has returned NULL..", __FILE__, __LINE__);
- }
- else if (eet_node_type_get(eet_node) != EET_T_STRING)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node has wrong type..", __FILE__, __LINE__);
- }
- else
- {
- printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
- }
- eet_node_del(eet_node);
-}
-END_TEST
-/**
- *@}
- */
-Suite *
-test_suite(void)
-{
- Suite *suite = suite_create("utc_eet_node_string_new");
-
- TCase *tcase = tcase_create("TCase");
- tcase_set_timeout(tcase, 30);
- tcase_add_checked_fixture(tcase, setup, teardown);
- tcase_add_test(tcase, utc_eet_node_string_new_p);
- tcase_add_test(tcase, utc_eet_node_string_new_p2);
- tcase_add_test(tcase, utc_eet_node_string_new_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_eet_node_string_new.log");
- srunner_set_xml(srunner, "utc_eet_node_string_new.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 <Eet.h>
-
-/**
- * @addtogroup eet_node
- * @{
- * @defgroup eet_node_struct_append eet_node_struct_append()
- *
- *
- * @precondition
- * @step 1 eet initialized with eet_init()
- */
-static void
-setup(void)
-{
- printf(" ============ Startup ============ \n");
- eet_init();
-}
-
-static void
-teardown(void)
-{
- printf(" ============ Cleanup ============ \n");
- eet_shutdown();
-}
-
-/**
- * @addtogroup eet_node_struct_append
- * @{
- * @objective Positive test case 1 checks if function returns valid pointer
- * to Eet_Node with type EET_G_UNKNOWN if it is called with correct arguments.
- * @n Input data:
- * @li eet_node_parent as node.
- * @li child_name as name of node.
- * @li eet_node_child pointer to created Eina_Node to be hashed.
- *
- * @procedure
- * @step 1 Create new eet nodes.
- * @step 2 Create and check eina_list with node.
- * @step 3 Create eet_node_parent and check type node.
- * @step 4 Append eet_node_child to the parent node.
- * @step 5 Get child node and check value node.
- * @step 6 Append eet_node_child2 to the parent node.
- * @step 7 Get child next and check value node.
- *
- * @passcondition Test passes if returned values are the same as add values.
- * @}
- */
-START_TEST(utc_eet_node_struct_append_p)
-{
- Eina_List *eina_list = NULL;
- const char *parent_name = "test_parent";
- const char *child_name = "test_child";
- Eet_Node *eet_node_rest = NULL;
- Eet_Node *eet_node_next_res = NULL;
- Eet_Node *eet_node = eet_node_int_new(parent_name, 1);
- Eet_Node *eet_node_parent = NULL;
- Eet_Node *eet_node_child = eet_node_int_new(child_name, 2);
- Eet_Node *eet_node_child2 = eet_node_int_new(child_name, 3);
-
- if ((!eet_node) || (!eet_node_child) || (!eet_node_child2))
- {
- if (eet_node_child2)
- eet_node_del(eet_node_child2);
-
- if (eet_node_child)
- eet_node_del(eet_node_child);
-
- if (eet_node)
- eet_node_del(eet_node);
-
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node to be hashed is not created..", __FILE__, __LINE__);
- }
-
- if (!(eina_list = eina_list_append(eina_list, eet_node)))
- {
- eet_node_del(eet_node_child2);
- eet_node_del(eet_node_child);
- eet_node_del(eet_node);
-
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eina_List is not created..", __FILE__, __LINE__);
- }
-
- if (!(eet_node_parent = eet_node_struct_new(parent_name, eina_list)))
- {
- eet_node_del(eet_node_child2);
- eet_node_del(eet_node_child);
- eina_list_free(eina_list);
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. ", __FILE__, __LINE__);
- }
-
- if (eet_node_type_get(eet_node_parent) != EET_G_UNKNOWN)
- {
- eet_node_del(eet_node_parent);
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. ", __FILE__, __LINE__);
- }
-
- eet_node_struct_append(eet_node_parent, child_name, eet_node_child);
-
- if ((!(eet_node_rest = eet_node_children_get(eet_node_parent))) || (eet_node_value_get(eet_node_rest)->value.i != 1))
- {
- eet_node_del(eet_node_parent);
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node has wrong type.. ", __FILE__, __LINE__);
- }
-
- if ((!(eet_node_next_res = eet_node_next_get(eet_node_rest))) || (eet_node_value_get(eet_node_next_res)->value.i != 2))
- {
- eet_node_del(eet_node_parent);
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node has wrong type.. = %d", __FILE__, __LINE__, eet_node_value_get(eet_node_next_res)->value.i);
- }
-
- eet_node_struct_append(eet_node_parent, child_name, eet_node_child2);
-
- if ((!(eet_node_next_res = eet_node_next_get(eet_node_rest))) || (eet_node_value_get(eet_node_next_res)->value.i != 3))
- {
- eet_node_del(eet_node_parent);
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node has wrong type.. = %d", __FILE__, __LINE__, eet_node_value_get(eet_node_next_res)->value.i);
- }
-
- printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
-
- eet_node_del(eet_node_parent);
-}
-END_TEST
-
-/**
- * @addtogroup eet_node_struct_append
- * @{
- * @objective Positive test case 2 checks if function returns valid pointer
- * to Eet_Node with type EET_G_UNKNOWN if it is called with NULL instead of node's name.
- * @n Input data:
- * @li eet_node_parent as node.
- * @li child_name as name of node.
- * @li eet_node_child pointer to created Eina_Node to be hashed.
- *
- * @procedure
- * @step 1 Create new eet nodes.
- * @step 2 Create and check eina_list with node.
- * @step 3 Create eet_node_parent and check type node.
- * @step 4 Append eet_node_child to the parent node.
- * @step 5 Get child node and check value node.
- *
- * @passcondition Test passes if returned values are the same as add values.
- * @}
- */
-START_TEST(utc_eet_node_struct_append_p2)
-{
- Eina_List *eina_list = NULL;
- const char *parent_name = "test_parent";
- const char *child_name = "test_child";
- Eet_Node *eet_node_rest = NULL;
- Eet_Node *eet_node_next_res = NULL;
- Eet_Node *eet_node = eet_node_int_new(parent_name, 1);
- Eet_Node *eet_node_parent = NULL;
- Eet_Node *eet_node_child = eet_node_int_new(child_name, 2);
-
- if ((!eet_node) || (!eet_node_child))
- {
- if (eet_node_child)
- eet_node_del(eet_node_child);
-
- if (eet_node)
- eet_node_del(eet_node);
-
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node to be hashed is not created..", __FILE__, __LINE__);
- }
-
- if (!(eina_list = eina_list_append(eina_list, eet_node)))
- {
- eet_node_del(eet_node_child);
- eet_node_del(eet_node);
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eina_List is not created..", __FILE__, __LINE__);
- }
-
- if ((!(eet_node_parent = eet_node_struct_new(parent_name, eina_list))) || (eet_node_type_get(eet_node_parent) != EET_G_UNKNOWN))
- {
- eet_node_del(eet_node_child);
- eina_list_free(eina_list);
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. ", __FILE__, __LINE__);
- }
-
- eet_node_struct_append(eet_node_parent, NULL, eet_node_child);
-
- if ((!(eet_node_rest = eet_node_children_get(eet_node_parent))) || (eet_node_value_get(eet_node_rest)->value.i != 1))
- {
- eet_node_del(eet_node_parent);
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. ", __FILE__, __LINE__);
- }
-
- if ((!(eet_node_next_res = eet_node_next_get(eet_node_rest))) || (eet_node_value_get(eet_node_next_res)->value.i != 2))
- {
- eet_node_del(eet_node_parent);
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. ", __FILE__, __LINE__);
- }
-
- printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
-
- eet_node_del(eet_node_parent);
-}
-END_TEST
-
-
-/**
- *@}
- */
-Suite *
-test_suite(void)
-{
- Suite *suite = suite_create("utc_eet_node_struct_append");
-
- TCase *tcase = tcase_create("TCase");
- tcase_set_timeout(tcase, 30);
- tcase_add_checked_fixture(tcase, setup, teardown);
- tcase_add_test(tcase, utc_eet_node_struct_append_p);
- tcase_add_test(tcase, utc_eet_node_struct_append_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_eet_node_struct_append.log");
- srunner_set_xml(srunner, "utc_eet_node_struct_append.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 <Eet.h>
-#include "../../utc_negative_unitest.h"
-
-/**
- * @addtogroup eet_node
- * @{
- * @defgroup eet_node_struct_child_new eet_node_struct_child_new()
- *
- *
- * @precondition
- * @step 1 eet initialized with eet_init()
- */
-static void
-setup(void)
-{
- printf(" ============ Startup ============ \n");
- eet_init();
-}
-
-static void
-teardown(void)
-{
- printf(" ============ Cleanup ============ \n");
- eet_shutdown();
-}
-
-/**
- * @addtogroup eet_node_struct_child_new
- * @{
- * @objective Positive test case 1 checks if function returns valid pointer
- * to Eet_Node with type EET_T_NULL if it is called with correct arguments.
- * @n Input data: "test" as name of node, pointer to created child Eina_Node.
- *
- * @procedure
- * @step 1 Create new Eina_Node to use as child.
- * @step 2 Initialization of pointer to hash Eet_Node with correct arguments.
- *
- * @passcondition Returned pointer to Eet_Node is not NULL and type of the node is EET_T_NULL.
- * @}
- */
-START_TEST(utc_eet_node_struct_child_new_p)
-{
- Eet_Node *eet_node_struct_child = NULL;
- Eet_Node *eet_node = eet_node_null_new("child");
-
- if (!eet_node)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. child Eet_Node is not created..", __FILE__, __LINE__);
- }
- else if (!(eet_node_struct_child = eet_node_struct_child_new("test", eet_node)))
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Function has returned NULL..", __FILE__, __LINE__);
- }
- else if (eet_node_type_get(eet_node_struct_child) != EET_T_NULL)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node has wrong type..", __FILE__, __LINE__);
- }
- else
- {
- printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
- }
- eet_node_del(eet_node_struct_child);
-}
-END_TEST
-
-/**
- * @addtogroup eet_node_struct_child_new
- * @{
- * @objective Positive test case 2 checks if function returns valid pointer
- * to Eet_Node with type EET_T_NULL if it is called with NULL instead of node's name.
- * @n Input data: NULL as name of node, pointer to created child Eina_Node.
- *
- * @procedure
- * @step 1 Create new Eina_Node to use as child.
- * @step 2 Initialization of pointer to hash Eet_Node with NULL instead of valid name.
- *
- * @passcondition Returned pointer to Eet_Node is not NULL and type of the node is EET_T_NULL.
- * @}
- */
-START_TEST(utc_eet_node_struct_child_new_p2)
-{
- Eet_Node *eet_node_struct_child = NULL;
- Eet_Node *eet_node = eet_node_null_new("child");
-
- if (!eet_node)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. child Eet_Node is not created..", __FILE__, __LINE__);
- }
- else if (!(eet_node_struct_child = eet_node_struct_child_new(NULL, eet_node)))
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Function has returned NULL..", __FILE__, __LINE__);
- }
- else if (eet_node_type_get(eet_node_struct_child) != EET_T_NULL)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node has wrong type..", __FILE__, __LINE__);
- }
- else
- {
- printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
- }
- eet_node_del(eet_node_struct_child);
-}
-END_TEST
-
-/**
- * @addtogroup eet_node_struct_child_new
- * @{
- * @objective Negative test case checks if function doesn't cause segmentation fault
- * and returns NULL if it is called with NULL instead of some arguments.
- * @n Input Data: "test" as name of node, pointer to created child Eina_Node.
- *
- * @procedure
- * @step 1 Create new Eina_Node.
- * @step 2 Call function once and pass NULL instead of created Eet_Node.
- *
- * @passcondition Function doesn't cause segmentation fault and returns NULL.
- * @}
- */
-START_TEST(utc_eet_node_struct_child_new_n)
-{
- Eet_Node *eet_node = eet_node_null_new("child");
-
- CREATE_CHECKED_ARGS_ARRAY(0, 1);
- UNITEST_FUNC_NEG_CA_RET(NULL, eet_node_struct_child_new, "test", eet_node);
-
- if (result_of_testing == TEST_FAIL)
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
- else
- printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
-
- eet_node_del(eet_node);
-}
-END_TEST
-
-/**
- *@}
- */
-Suite *
-test_suite(void)
-{
- Suite *suite = suite_create("utc_eet_node_struct_child_new");
-
- TCase *tcase = tcase_create("TCase");
- tcase_set_timeout(tcase, 30);
- tcase_add_checked_fixture(tcase, setup, teardown);
- tcase_add_test(tcase, utc_eet_node_struct_child_new_p);
- tcase_add_test(tcase, utc_eet_node_struct_child_new_p2);
- tcase_add_test(tcase, utc_eet_node_struct_child_new_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_eet_node_struct_child_new.log");
- srunner_set_xml(srunner, "utc_eet_node_struct_child_new.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 <Eet.h>
-
-/**
- * @addtogroup eet_node
- * @{
- * @defgroup eet_node_struct_new eet_node_struct_new()
- *
- *
- * @precondition
- * @step 1 eet initialized with eet_init()
- */
-static void
-setup(void)
-{
- printf(" ============ Startup ============ \n");
- eet_init();
-}
-
-static void
-teardown(void)
-{
- printf(" ============ Cleanup ============ \n");
- eet_shutdown();
-}
-
-/**
- * @addtogroup eet_node_struct_new
- * @{
- * @objective Positive test case 1 checks if function returns valid pointer
- * to Eet_Node with type EET_G_UNKNOWN if it is called with correct arguments.
- * @n Input data: "test" as name of node, pointer to created Eina_List with one element.
- *
- * @procedure
- * @step 1 Create new Eina_List with one element.
- * @step 2 Initialization of pointer to Eet_Node with correct arguments.
- *
- * @passcondition Returned pointer to Eet_Node is not NULL and type of the node is EET_G_UNKNOWN.
- * @}
- */
-START_TEST(utc_eet_node_struct_new_p)
-{
- Eet_Node *eet_node = NULL;
- Eina_List *eina_list = NULL;
- Eet_Node *node = eet_node_null_new("test");
-
- if (!node)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node is not created..", __FILE__, __LINE__);
- }
- else if (!(eina_list = eina_list_append(eina_list, node)))
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eina_List is not created..", __FILE__, __LINE__);
- }
- else if (!(eet_node = eet_node_struct_new("test", eina_list)))
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Function has returned NULL..", __FILE__, __LINE__);
- }
- else if (eet_node_type_get(eet_node) != EET_G_UNKNOWN)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node has wrong type..", __FILE__, __LINE__);
- }
- else
- {
- printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
- }
- eet_node_del(eet_node);
-}
-END_TEST
-
-/**
- * @addtogroup eet_node_struct_new
- * @{
- * @objective Positive test case 2 checks if function returns valid pointer
- * to Eet_Node with type EET_G_UNKNOWN if it is called with NULL instead of node's name.
- * @n Input data: NULL as name of node, pointer to created Eina_List.
- *
- * @procedure
- * @step 1 Create new Eina_List with one element.
- * @step 2 Initialization of pointer to Eet_Node with NULL instead of valid name.
- *
- * @passcondition Returned pointer to Eet_Node is not NULL and type of the node is EET_G_UNKNOWN.
- * @}
- */
-START_TEST(utc_eet_node_struct_new_p2)
-{
- Eet_Node *eet_node = NULL;
- Eina_List *eina_list = NULL;
- Eet_Node *node = eet_node_null_new("test");
-
- if (!node)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node is not created..", __FILE__, __LINE__);
- }
- else if (!(eina_list = eina_list_append(eina_list, node)))
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eina_List is not created..", __FILE__, __LINE__);
- }
- else if (!(eet_node = eet_node_struct_new(NULL, eina_list)))
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Function has returned NULL..", __FILE__, __LINE__);
- }
- else if (eet_node_type_get(eet_node) != EET_G_UNKNOWN)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node has wrong type..", __FILE__, __LINE__);
- }
- else
- {
- printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
- }
- eet_node_del(eet_node);
-}
-END_TEST
-
-/**
- * @addtogroup eet_node_struct_new
- * @{
- * @objective Positive test case 3 checks if function returns valid pointer
- * to Eet_Node with type EET_G_UNKNOWN if it is called with NULL instead of Eina_list.
- * @n Input data: "test" as name of node, NULL instead of Eina_List.
- *
- * @procedure
- * @step 1 Initialization of pointer to Eet_Node with NULL instead of pointer to Eina_List with data.
- *
- * @passcondition Returned pointer to Eet_Node is not NULL and type of the node is EET_G_UNKNOWN.
- * @}
- */
-START_TEST(utc_eet_node_struct_new_p3)
-{
- Eet_Node *eet_node = eet_node_struct_new("test", NULL);
-
- if (!eet_node)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Function has returned NULL..", __FILE__, __LINE__);
- }
- else if (eet_node_type_get(eet_node) != EET_G_UNKNOWN)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node has wrong type..", __FILE__, __LINE__);
- }
- else
- {
- printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
- }
- eet_node_del(eet_node);
-}
-END_TEST
-
-/**
- *@}
- */
-Suite *
-test_suite(void)
-{
- Suite *suite = suite_create("utc_eet_node_struct_new");
-
- TCase *tcase = tcase_create("TCase");
- tcase_set_timeout(tcase, 30);
- tcase_add_checked_fixture(tcase, setup, teardown);
- tcase_add_test(tcase, utc_eet_node_struct_new_p);
- tcase_add_test(tcase, utc_eet_node_struct_new_p2);
- tcase_add_test(tcase, utc_eet_node_struct_new_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_eet_node_struct_new.log");
- srunner_set_xml(srunner, "utc_eet_node_struct_new.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 <Eet.h>
-#include "../../utc_negative_unitest.h"
-
-/**
- * @addtogroup eet_node
- * @{
- * @defgroup eet_node_type_get eet_node_type_get()
- *
- *
- * @precondition
- * @step 1 eet initialized with eet_init()
- */
-static void
-setup(void)
-{
- printf(" ============ Startup ============ \n");
- eet_init();
-}
-
-static void
-teardown(void)
-{
- printf(" ============ Cleanup ============ \n");
- eet_shutdown();
-}
-
-/**
- * @addtogroup eet_node_type_get
- * @{
- * @objective Positive test case checks if function returns correct type of the node.
- * @n Input Data: Eet_Node with type EET_G_LIST.
- *
- * @procedure
- * @step 1 Initialization of pointer to Eina_List and appending test data to it via eina_list_append.
- * @step 2 Obtaining a pointer to Eet_Node using eet_node_list_new with a pointer to Eina_List as a parameter.
- * @step 3 Obtaining an integer denoting the type of the node using eet_node_type_get with pointer
- * from step 2 as a parameter.
- *
- * @passcondition Function returns type EET_G_LIST.
- * @}
- */
-START_TEST(utc_eet_node_type_get_p)
-{
- Eet_Node *eet_node = NULL;
- Eina_List *eina_list = NULL;
- Eet_Node *node = eet_node_null_new("test");
-
- if (!node)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node is not created..", __FILE__, __LINE__);
- }
- else if (!(eina_list = eina_list_append(eina_list, node)))
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eina_List is not created..", __FILE__, __LINE__);
- }
- else if (!(eet_node = eet_node_list_new("test", eina_list)))
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node with child Eet_List is not created", __FILE__, __LINE__);
- }
- else if (eet_node_type_get(eet_node) != EET_G_LIST)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
- }
- else
- {
- printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
- }
- eet_node_del(eet_node);
-}
-END_TEST
-
-/**
- * @addtogroup eet_node_type_get
- * @{
- * @objective Negative test case checks if function doesn't cause segmentation fault
- * and returns EET_T_UNKNOW if it is called with NULL instead of any argument.
- * @n Input Data: pointer to created Eina_Node with type EET_T_NULL (it's replaced by NULL
- * when function is called).
- *
- * @procedure
- * @step 1 Create new Eina_Node.
- * @step 2 Call function once and pass NULL instead of created Eet_Node.
- *
- * @passcondition Function doesn't cause segmentation fault and returns EET_T_UNKNOW.
- * @}
- */
-START_TEST(utc_eet_node_type_get_n)
-{
- Eet_Node *eet_node = eet_node_null_new("test");
-
- int result = UNITEST_FUNC_NEG_RET(EET_T_UNKNOW, eet_node_type_get, eet_node);
-
- if (result == TEST_FAIL)
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
- else
- printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
-
- eet_node_del(eet_node);
-}
-END_TEST
-/**
- *@}
- */
-Suite *
-test_suite(void)
-{
- Suite *suite = suite_create("utc_eet_node_type_get");
-
- TCase *tcase = tcase_create("TCase");
- tcase_set_timeout(tcase, 30);
- tcase_add_checked_fixture(tcase, setup, teardown);
- tcase_add_test(tcase, utc_eet_node_type_get_p);
- tcase_add_test(tcase, utc_eet_node_type_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_eet_node_type_get.log");
- srunner_set_xml(srunner, "utc_eet_node_type_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 <Eet.h>
-
-/**
- * @addtogroup eet_node
- * @{
- * @defgroup eet_node_unsigned_char_new eet_node_unsigned_char_new()
- *
- *
- * @precondition
- * @step 1 eet initialized with eet_init()
- */
-static void
-setup(void)
-{
- printf(" ============ Startup ============ \n");
- eet_init();
-}
-
-static void
-teardown(void)
-{
- printf(" ============ Cleanup ============ \n");
- eet_shutdown();
-}
-
-/**
- * @addtogroup eet_node_unsigned_char_new
- * @{
- * @objective Positive test case 1 checks if function returns valid pointer
- * to Eet_Node with type EET_T_UCHAR if it is called with correct arguments.
- * @n Input data: "test" as name of node and (unsigned char)1 as it's value.
- *
- * @procedure
- * @step 1 Initialization of pointer to Eet_Node with correct arguments.
- *
- * @passcondition Returned pointer to Eet_Node is not NULL and type of the node is EET_T_UCHAR.
- * @}
- */
-START_TEST(utc_eet_node_unsigned_char_new_p)
-{
- Eet_Node *eet_node = eet_node_unsigned_char_new("test", (unsigned char)1);
-
- if (!eet_node)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Function has returned NULL..", __FILE__, __LINE__);
- }
- else if (eet_node_type_get(eet_node) != EET_T_UCHAR)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node has wrong type..", __FILE__, __LINE__);
- }
- else
- {
- printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
- }
- eet_node_del(eet_node);
-}
-END_TEST
-
-/**
- * @addtogroup eet_node_unsigned_char_new
- * @{
- * @objective Positive test case 2 checks if function returns valid pointer
- * to Eet_Node with type EET_T_UCHAR if it is called with NULL instead of node's name.
- * @n Input data: NULL as name of node and (unsigned char)1 as it's value.
- *
- * @procedure
- * @step 1 Initialization of pointer to Eet_Node with NULL instead of valid name.
- *
- * @passcondition Returned pointer to Eet_Node is not NULL and type of the node is EET_T_UCHAR.
- * @}
- */
-START_TEST(utc_eet_node_unsigned_char_new_p2)
-{
- Eet_Node *eet_node = eet_node_unsigned_char_new(NULL, (unsigned char)1);
-
- if (!eet_node)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Function has returned NULL..", __FILE__, __LINE__);
- }
- else if (eet_node_type_get(eet_node) != EET_T_UCHAR)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node has wrong type..", __FILE__, __LINE__);
- }
- else
- {
- printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
- }
- eet_node_del(eet_node);
-}
-END_TEST
-
-/**
- * @addtogroup eet_node_unsigned_char_new
- * @{
- * @objective Positive test case 3 checks if function returns valid pointer
- * to Eet_Node with type EET_T_UCHAR if it is called with incorrect value.
- * @n Input data: "test" as name of node and UCHAR_MAX + 1 as value.
- *
- * @procedure
- * @step 1 Initialization of pointer to Eet_Node with name "test" and incorrect value.
- *
- * @passcondition Returned pointer to Eet_Node is not NULL and type of the node is EET_T_UCHAR.
- * @}
- */
-START_TEST(utc_eet_node_unsigned_char_new_p3)
-{
- Eet_Node *eet_node = eet_node_unsigned_char_new("test", UCHAR_MAX + 1);
-
- if (!eet_node)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Function has returned NULL..", __FILE__, __LINE__);
- }
- else if (eet_node_type_get(eet_node) != EET_T_UCHAR)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node has wrong type..", __FILE__, __LINE__);
- }
- else
- {
- printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
- }
- eet_node_del(eet_node);
-}
-END_TEST
-/**
- *@}
- */
-Suite *
-test_suite(void)
-{
- Suite *suite = suite_create("utc_eet_node_unsigned_char_new");
-
- TCase *tcase = tcase_create("TCase");
- tcase_set_timeout(tcase, 30);
- tcase_add_checked_fixture(tcase, setup, teardown);
- tcase_add_test(tcase, utc_eet_node_unsigned_char_new_p);
- tcase_add_test(tcase, utc_eet_node_unsigned_char_new_p2);
- tcase_add_test(tcase, utc_eet_node_unsigned_char_new_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_eet_node_unsigned_char_new.log");
- srunner_set_xml(srunner, "utc_eet_node_unsigned_char_new.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 <Eet.h>
-#include <limits.h>
-
-/**
- * @addtogroup eet_node
- * @{
- * @defgroup eet_node_unsigned_int_new eet_node_unsigned_int_new()
- *
- *
- * @precondition
- * @step 1 eet initialized with eet_init()
- */
-static void
-setup(void)
-{
- printf(" ============ Startup ============ \n");
- eet_init();
-}
-
-static void
-teardown(void)
-{
- printf(" ============ Cleanup ============ \n");
- eet_shutdown();
-}
-
-/**
- * @addtogroup eet_node_unsigned_int_new
- * @{
- * @objective Positive test case 1 checks if function returns valid pointer
- * to Eet_Node with type EET_T_UINT if it is called with correct arguments.
- * @n Input data: "test" as name of node and 1U as it's value.
- *
- * @procedure
- * @step 1 Initialization of pointer to Eet_Node with name "test" and unsigned int 1U.
- *
- * @passcondition Returned pointer to Eet_Node is not NULL and type of the node is EET_T_UINT.
- * @}
- */
-START_TEST(utc_eet_node_unsigned_int_new_p)
-{
- Eet_Node *eet_node = eet_node_unsigned_int_new("test", 1U);
-
- if (!eet_node)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Function has returned NULL..", __FILE__, __LINE__);
- }
- else if (eet_node_type_get(eet_node) != EET_T_UINT)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node has wrong type..", __FILE__, __LINE__);
- }
- else
- {
- printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
- }
- eet_node_del(eet_node);
-}
-END_TEST
-
-/**
- * @addtogroup eet_node_unsigned_int_new
- * @{
- * @objective Positive test case 2 checks if function returns valid pointer
- * to Eet_Node with type EET_T_UINT if it is called with NULL instead of node's name.
- * @n Input data: NULL as name of node and 1U as it's value.
- *
- * @procedure
- * @step 1 Initialization of pointer to Eet_Node with NULL name and unsigned int 1U.
- *
- * @passcondition Returned pointer to Eet_Node is not NULL and type of the node is EET_T_UINT.
- * @}
- */
-START_TEST(utc_eet_node_unsigned_int_new_p2)
-{
- Eet_Node *eet_node = eet_node_unsigned_int_new(NULL, 1U);
-
- if (!eet_node)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Function has returned NULL..", __FILE__, __LINE__);
- }
- else if (eet_node_type_get(eet_node) != EET_T_UINT)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node has wrong type..", __FILE__, __LINE__);
- }
- else
- {
- printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
- }
- eet_node_del(eet_node);
-}
-END_TEST
-
-/**
- * @addtogroup eet_node_unsigned_int_new
- * @{
- * @objective Positive test case 3 checks if function returns valid pointer
- * to Eet_Node with type EET_T_UINT if it is called with incorrect value.
- * @n Input data: "test" as name of node and UINT_MAX + 1 as value.
- *
- * @procedure
- * @step 1 Initialization of pointer to Eet_Node with name "test" and UINT_MAX + 1.
- *
- * @passcondition Returned pointer to Eet_Node is not NULL and type of the node is EET_T_UINT.
- * @}
- */
-START_TEST(utc_eet_node_unsigned_int_new_p3)
-{
- Eet_Node *eet_node = eet_node_unsigned_int_new("test", UINT_MAX + 1);
-
- if (!eet_node)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Function has returned NULL..", __FILE__, __LINE__);
- }
- else if (eet_node_type_get(eet_node) != EET_T_UINT)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node has wrong type..", __FILE__, __LINE__);
- }
- else
- {
- printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
- }
- eet_node_del(eet_node);
-}
-END_TEST
-/**
- *@}
- */
-Suite *
-test_suite(void)
-{
- Suite *suite = suite_create("utc_eet_node_unsigned_int_new");
-
- TCase *tcase = tcase_create("TCase");
- tcase_set_timeout(tcase, 30);
- tcase_add_checked_fixture(tcase, setup, teardown);
- tcase_add_test(tcase, utc_eet_node_unsigned_int_new_p);
- tcase_add_test(tcase, utc_eet_node_unsigned_int_new_p2);
- tcase_add_test(tcase, utc_eet_node_unsigned_int_new_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_eet_node_unsigned_int_new.log");
- srunner_set_xml(srunner, "utc_eet_node_unsigned_int_new.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 <Eet.h>
-
-/**
- * @addtogroup eet_node
- * @{
- * @defgroup eet_node_unsigned_long_long_new eet_node_unsigned_long_long_new()
- *
- *
- * @precondition
- * @step 1 eet initialized with eet_init()
- */
-static void
-setup(void)
-{
- printf(" ============ Startup ============ \n");
- eet_init();
-}
-
-static void
-teardown(void)
-{
- printf(" ============ Cleanup ============ \n");
- eet_shutdown();
-}
-
-/**
- * @addtogroup eet_node_unsigned_long_long_new
- * @{
- * @objective Positive test case 1 checks if function returns valid pointer
- * to Eet_Node with type EET_T_ULONG_LONG if it is called with correct arguments.
- * @n Input data: "test" as name of node and 1ULL as it's value.
- *
- * @procedure
- * @step 1 Initialization of pointer to Eet_Node with correct arguments.
- *
- * @passcondition Returned pointer to Eet_Node is not NULL and type of the node is EET_T_ULONG_LONG.
- * @}
- */
-START_TEST(utc_eet_node_unsigned_long_long_new_p)
-{
- Eet_Node *eet_node = eet_node_unsigned_long_long_new("test", 1ULL);
-
- if (!eet_node)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Function has returned NULL..", __FILE__, __LINE__);
- }
- else if (eet_node_type_get(eet_node) != EET_T_ULONG_LONG)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node has wrong type..", __FILE__, __LINE__);
- }
- else
- {
- printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
- }
- eet_node_del(eet_node);
-}
-END_TEST
-
-/**
- * @addtogroup eet_node_unsigned_long_long_new
- * @{
- * @objective Positive test case 2 checks if function returns valid pointer
- * to Eet_Node with type EET_T_ULONG_LONG if it is called with NULL instead of node's name.
- * @n Input data: NULL as name of node and 1ULL as it's value.
- *
- * @procedure
- * @step 1 Initialization of pointer to Eet_Node with NULL instead of valid name.
- *
- * @passcondition Returned pointer to Eet_Node is not NULL and type of the node is EET_T_ULONG_LONG.
- * @}
- */
-START_TEST(utc_eet_node_unsigned_long_long_new_p2)
-{
- Eet_Node *eet_node = eet_node_unsigned_long_long_new(NULL, 1ULL);
-
- if (!eet_node)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Function has returned NULL..", __FILE__, __LINE__);
- }
- else if (eet_node_type_get(eet_node) != EET_T_ULONG_LONG)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node has wrong type..", __FILE__, __LINE__);
- }
- else
- {
- printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
- }
- eet_node_del(eet_node);
-}
-END_TEST
-
-/**
- * @addtogroup eet_node_unsigned_long_long_new
- * @{
- * @objective Positive test case 3 checks if function returns valid pointer
- * to Eet_Node with type EET_T_ULONG_LONG if it is called with incorrect value.
- * @n Input data: "test" as name of node and ULLONG_MAX + 1 as value.
- *
- * @procedure
- * @step 1 Initialization of pointer to Eet_Node with name "test" and incorrect value.
- *
- * @passcondition Returned pointer to Eet_Node is not NULL and type of the node is EET_T_ULONG_LONG.
- * @}
- */
-START_TEST(utc_eet_node_unsigned_long_long_new_p3)
-{
- Eet_Node *eet_node = eet_node_unsigned_long_long_new("test", ULLONG_MAX + 1);
-
- if (!eet_node)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Function has returned NULL..", __FILE__, __LINE__);
- }
- else if (eet_node_type_get(eet_node) != EET_T_ULONG_LONG)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node has wrong type..", __FILE__, __LINE__);
- }
- else
- {
- printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
- }
- eet_node_del(eet_node);
-}
-END_TEST
-/**
- *@}
- */
-Suite *
-test_suite(void)
-{
- Suite *suite = suite_create("utc_eet_node_unsigned_long_long_new");
-
- TCase *tcase = tcase_create("TCase");
- tcase_set_timeout(tcase, 30);
- tcase_add_checked_fixture(tcase, setup, teardown);
- tcase_add_test(tcase, utc_eet_node_unsigned_long_long_new_p);
- tcase_add_test(tcase, utc_eet_node_unsigned_long_long_new_p2);
- tcase_add_test(tcase, utc_eet_node_unsigned_long_long_new_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_eet_node_unsigned_long_long_new.log");
- srunner_set_xml(srunner, "utc_eet_node_unsigned_long_long_new.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 <Eet.h>
-#include <limits.h>
-
-/**
- * @addtogroup eet_node
- * @{
- * @defgroup eet_node_unsigned_short_new eet_node_unsigned_short_new()
- *
- *
- * @precondition
- * @step 1 eet initialized with eet_init()
- */
-static void
-setup(void)
-{
- printf(" ============ Startup ============ \n");
- eet_init();
-}
-
-static void
-teardown(void)
-{
- printf(" ============ Cleanup ============ \n");
- eet_shutdown();
-}
-
-/**
- * @addtogroup eet_node_unsigned_short_new
- * @{
- * @objective Positive test case 1 checks if function returns valid pointer
- * to Eet_Node with type EET_T_USHORT if it is called with correct arguments.
- * @n Input data: "test" as name of node and (unsigned short)1 as it's value.
- *
- * @procedure
- * @step 1 Initialization of pointer to Eet_Node with correct arguments.
- *
- * @passcondition Returned pointer to Eet_Node is not NULL and type of the node is EET_T_USHORT.
- * @}
- */
-START_TEST(utc_eet_node_unsigned_short_new_p)
-{
- Eet_Node *eet_node = eet_node_unsigned_short_new("test", (unsigned short)1);
-
- if (!eet_node)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Function has returned NULL..", __FILE__, __LINE__);
- }
- else if (eet_node_type_get(eet_node) != EET_T_USHORT)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node has wrong type..", __FILE__, __LINE__);
- }
- else
- {
- printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
- }
- eet_node_del(eet_node);
-}
-END_TEST
-
-/**
- * @addtogroup eet_node_unsigned_short_new
- * @{
- * @objective Positive test case 2 checks if function returns valid pointer
- * to Eet_Node with type EET_T_USHORT if it is called with NULL instead of node's name.
- * @n Input data: NULL as name of node and (unsigned short)1 as it's value.
- *
- * @procedure
- * @step 1 Initialization of pointer to Eet_Node with NULL instead of valid name.
- *
- * @passcondition Returned pointer to Eet_Node is not NULL and type of the node is EET_T_USHORT.
- * @}
- */
-START_TEST(utc_eet_node_unsigned_short_new_p2)
-{
- Eet_Node *eet_node = eet_node_unsigned_short_new(NULL, (unsigned short)1);
-
- if (!eet_node)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Function has returned NULL..", __FILE__, __LINE__);
- }
- else if (eet_node_type_get(eet_node) != EET_T_USHORT)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node has wrong type..", __FILE__, __LINE__);
- }
- else
- {
- printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
- }
- eet_node_del(eet_node);
-}
-END_TEST
-
-/**
- * @addtogroup eet_node_unsigned_short_new
- * @{
- * @objective Positive test case 3 checks if function returns valid pointer
- * to Eet_Node with type EET_T_USHORT if it is called with incorrect value.
- * @n Input data: "test" as name of node and USHRT_MAX + 1 as value.
- *
- * @procedure
- * @step 1 Initialization of pointer to Eet_Node with name "test" and incorrect value.
- *
- * @passcondition Returned pointer to Eet_Node is not NULL and type of the node is EET_T_USHORT.
- * @}
- */
-START_TEST(utc_eet_node_unsigned_short_new_p3)
-{
- Eet_Node *eet_node = eet_node_unsigned_short_new("test", USHRT_MAX + 1);
-
- if (!eet_node)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Function has returned NULL..", __FILE__, __LINE__);
- }
- else if (eet_node_type_get(eet_node) != EET_T_USHORT)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node has wrong type..", __FILE__, __LINE__);
- }
- else
- {
- printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
- }
- eet_node_del(eet_node);
-}
-END_TEST
-/**
- *@}
- */
-Suite *
-test_suite(void)
-{
- Suite *suite = suite_create("utc_eet_node_unsigned_short_new");
-
- TCase *tcase = tcase_create("TCase");
- tcase_set_timeout(tcase, 30);
- tcase_add_checked_fixture(tcase, setup, teardown);
- tcase_add_test(tcase, utc_eet_node_unsigned_short_new_p);
- tcase_add_test(tcase, utc_eet_node_unsigned_short_new_p2);
- tcase_add_test(tcase, utc_eet_node_unsigned_short_new_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_eet_node_unsigned_short_new.log");
- srunner_set_xml(srunner, "utc_eet_node_unsigned_short_new.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 <Eet.h>
-#include "../../utc_negative_unitest.h"
-
-/**
- * @addtogroup eet_node
- * @{
- * @defgroup eet_node_value_get eet_node_value_get()
- *
- *
- * @precondition
- * @step 1 eet initialized with eet_init()
- */
-
-static void
-setup(void)
-{
- printf(" ============ Startup ============ \n");
- eet_init();
-}
-
-static void
-teardown(void)
-{
- printf(" ============ Cleanup ============ \n");
- eet_shutdown();
-}
-
-/**
- * @addtogroup eet_node_value_get
- * @{
- * @objective Positive test case checks if function returns a pointer to data associated with the Eet_Node.
- * @n Input Data: Eet_Node with type EET_T_INT and value 3;
- *
- * @procedure
- * @step 1 Initializing pointer to Eina_Node with value 3 via eet_node_int_new.
- * @step 2 Obtaining a pointer to Eet_Node_Data using eet_node_value_get with a pointer from step 1 as a parameter.
- *
- * @passcondition Function returns valid pointer to node data and its field 'i' (integer field in union) equals test value 3.
- * @}
- */
-START_TEST(utc_eet_node_value_get_p)
-{
- int value = 3;
- Eet_Node_Data *eet_node_data = NULL;
- Eet_Node *eet_node = eet_node_int_new("int", value);
-
- if (!eet_node)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eina_Node is not created..", __FILE__, __LINE__);
- }
- else if (!(eet_node_data = eet_node_value_get(eet_node)))
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Value isn't got from node..", __FILE__, __LINE__);
- }
- else if (eet_node_data->value.i != value)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Got value is %d", __FILE__, __LINE__, eet_node_data->value.i);
- }
- else
- {
- printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
- }
- eet_node_del(eet_node);
-}
-END_TEST
-
-/**
- * @addtogroup eet_node_value_get
- * @{
- * @objective Negative test case checks if function doesn't cause segmentation fault
- * and returns NULL if it is called with NULL instead of any argument.
- * @n Input Data: pointer to created Eina_Node with type EET_T_NULL (it's replaced by NULL
- * when function is called).
- *
- * @procedure
- * @step 1 Create new Eina_Node.
- * @step 2 Call function once and pass NULL instead of created Eet_Node.
- *
- * @passcondition Function doesn't cause segmentation fault and returns NULL.
- * @}
- */
-START_TEST(utc_eet_node_value_get_n)
-{
- Eet_Node *eet_node = eet_node_null_new("test");
-
- int result = UNITEST_FUNC_NEG_RET(NULL, eet_node_value_get, eet_node);
-
- if (result == TEST_FAIL)
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
- else
- printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
-
- eet_node_del(eet_node);
-}
-END_TEST
-/**
- *@}
- */
-Suite *
-test_suite(void)
-{
- Suite *suite = suite_create("utc_eet_node_value_get");
-
- TCase *tcase = tcase_create("TCase");
- tcase_set_timeout(tcase, 30);
- tcase_add_checked_fixture(tcase, setup, teardown);
- tcase_add_test(tcase, utc_eet_node_value_get_p);
- tcase_add_test(tcase, utc_eet_node_value_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_eet_node_value_get.log");
- srunner_set_xml(srunner, "utc_eet_node_value_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 <Eet.h>
-
-/**
- * @addtogroup eet_node
- * @{
- * @defgroup eet_node_var_array_new eet_node_var_array_new()
- *
- *
- * @precondition
- * @step 1 eet initialized with eet_init()
- */
-static void
-setup(void)
-{
- printf(" ============ Startup ============ \n");
- eet_init();
-}
-
-static void
-teardown(void)
-{
- printf(" ============ Cleanup ============ \n");
- eet_shutdown();
-}
-
-/**
- * @addtogroup eet_node_var_array_new
- * @{
- * @objective Positive test case 1 checks if function returns valid pointer
- * to Eet_Node with type EET_G_VAR_ARRAY if it is called with correct arguments.
- * @n Input data: "test" as name of node, pointer to created Eina_List with one element.
- *
- * @procedure
- * @step 1 Initialization of Eet_Node to be added to Eina_List.
- * @step 2 Initialization of Eina_List with one element, created on step 1.
- * @step 3 Initialization of pointer to Eet_Node with correct arguments via eet_node_var_array_new
- * with Eina_List created on step 2.
- *
- * @passcondition Returned pointer to Eet_Node is not NULL and type of the node is EET_G_VAR_ARRAY.
- * @}
- */
-START_TEST(utc_eet_node_var_array_new_p)
-{
- Eet_Node *eet_node = NULL;
- Eina_List *eina_list = NULL;
- Eet_Node *node = eet_node_null_new("test");
-
- if (!node)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node is not created..", __FILE__, __LINE__);
- }
- else if (!(eina_list = eina_list_append(eina_list, node)))
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eina_List is not created..", __FILE__, __LINE__);
- }
- else if (!(eet_node = eet_node_var_array_new("test", eina_list)))
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Function has returned NULL..", __FILE__, __LINE__);
- }
- else if (eet_node_type_get(eet_node) != EET_G_VAR_ARRAY)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node has wrong type..", __FILE__, __LINE__);
- }
- else
- {
- printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
- }
- eet_node_del(eet_node);
-}
-END_TEST
-
-/**
- * @addtogroup eet_node_var_array_new
- * @{
- * @objective Positive test case 2 checks if function returns valid pointer
- * to Eet_Node with type EET_G_VAR_ARRAY if it is called with NULL instead of node's name.
- * @n Input data: NULL as name of node, pointer to created Eina_List.
- *
- * @procedure
- * @step 1 Initialization of Eet_Node to be added to Eina_List.
- * @step 2 Initialization of Eina_List with one element, created on step 1.
- * @step 3 Initialization of pointer to Eet_Node with NULL instead of valid name via
- * eet_node_var_array_new with Eina_List created on step 2.
- *
- * @passcondition Returned pointer to Eet_Node is not NULL and type of the node is EET_G_VAR_ARRAY.
- * @}
- */
-START_TEST(utc_eet_node_var_array_new_p2)
-{
- Eet_Node *eet_node = NULL;
- Eina_List *eina_list = NULL;
- Eet_Node *node = eet_node_null_new("test");
-
- if (!node)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node is not created..", __FILE__, __LINE__);
- }
- else if (!(eina_list = eina_list_append(eina_list, node)))
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eina_List is not created..", __FILE__, __LINE__);
- }
- else if (!(eet_node = eet_node_var_array_new(NULL, eina_list)))
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Function has returned NULL..", __FILE__, __LINE__);
- }
- else if (eet_node_type_get(eet_node) != EET_G_VAR_ARRAY)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node has wrong type..", __FILE__, __LINE__);
- }
- else
- {
- printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
- }
- eet_node_del(eet_node);
-}
-END_TEST
-
-/**
- * @addtogroup eet_node_var_array_new
- * @{
- * @objective Positive test case 3 checks if function returns valid pointer
- * to Eet_Node with type EET_G_VAR_ARRAY if it is called with NULL instead of Eina_list.
- * @n Input data: "test" as name of node, NULL instead of Eina_List.
- *
- * @procedure
- * @step 1 Initialization of pointer to Eet_Node with NULL instead of pointer to Eina_List with data.
- *
- * @passcondition Returned pointer to Eet_Node is not NULL and type of the node is EET_G_VAR_ARRAY.
- * @}
- */
-START_TEST(utc_eet_node_var_array_new_p3)
-{
- Eet_Node *eet_node = eet_node_var_array_new("test", NULL);
-
- if (!eet_node)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Function has returned NULL..", __FILE__, __LINE__);
- }
- else if (eet_node_type_get(eet_node) != EET_G_VAR_ARRAY)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node has wrong type..", __FILE__, __LINE__);
- }
- else
- {
- printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
- }
- eet_node_del(eet_node);
-}
-END_TEST
-/**
- *@}
- */
-Suite *
-test_suite(void)
-{
- Suite *suite = suite_create("utc_eet_node_var_array_new");
-
- TCase *tcase = tcase_create("TCase");
- tcase_set_timeout(tcase, 30);
- tcase_add_checked_fixture(tcase, setup, teardown);
- tcase_add_test(tcase, utc_eet_node_var_array_new_p);
- tcase_add_test(tcase, utc_eet_node_var_array_new_p2);
- tcase_add_test(tcase, utc_eet_node_var_array_new_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_eet_node_var_array_new.log");
- srunner_set_xml(srunner, "utc_eet_node_var_array_new.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 <Eet.h>
-#include <float.h>
-#include <malloc.h>
-
-static void *
-eet_node_walk_cb(int type, Eet_Node_Data *data, void *user_data)
-{
- Eina_Bool *status = (Eina_Bool*)user_data;
- *status = EINA_TRUE;
-
- return data;
-}
-
-static void
-_struct_add_cb(void *parent, const char *name, void *child, void *user_data)
-{
- Eet_Node *new_node = eet_node_int_new(name, ((Eet_Node_Data *)child)->value.i);
-
- eet_node_struct_append(parent, name, new_node);
-}
-
-static Eet_Node *
-_struct_node_create(Eet_Node *node, const char *node_name)
-{
- if (!node)
- return NULL;
-
- Eet_Node *eet_node = NULL;
- Eina_List *node_list = NULL;
-
- node_list = eina_list_append(NULL, node);
-
- if (!node_list)
- return NULL;
-
- eet_node = eet_node_struct_new(node_name, node_list);
-
- if ((!eet_node) || (eet_node_type_get(eet_node) != EET_G_UNKNOWN))
- return NULL;
-
- return eet_node;
-}
-
-/**
- * @addtogroup eet_node
- * @{
- * @defgroup eet_node_walk eet_node_walk()
- *
- *
- * @precondition
- * @step 1 eet initialized with eet_init()
- */
-static void
-setup(void)
-{
- printf(" ============ Startup ============ \n");
- eet_init();
-}
-
-static void
-teardown(void)
-{
- printf(" ============ Cleanup ============ \n");
- eet_shutdown();
-}
-
-/**
- * @addtogroup eet_node_walk
- * @{
- * @objective Positive test case 1 checks if function returns valid pointer to Eet_Node_Data.
- * @n Input Data:
- * @li parent node to user operations;
- * @li node name;
- * @li root node to the walk;
- * @li walk callback;
- * @li user_data.
- *
- * @procedure
- * @step 1 Initialization of pointers to Eet_Nodes with correct arguments.
- * @step 2 Walk on the node and return node data.
- * @step 3 Get and check child node from parent node.
- * @step 4 Check node data and user data.
- *
- * @passcondition Test passes if returned values are the same as add values.
- * @}
- */
-START_TEST(utc_eet_node_walk_p)
-{
- int data_set = 1;
- Eet_Node *eet_node = eet_node_int_new("test", data_set);
- Eet_Node *node = eet_node_null_new("test");
- Eet_Node *parent_node = _struct_node_create(node, "test");
- Eet_Node *eet_node_child = NULL;
- Eet_Node_Data *node_data = NULL;
- Eina_Bool status_cb = EINA_FALSE;
- Eet_Node_Walk cb;
-
- cb.simple = eet_node_walk_cb;
- cb.struct_add = _struct_add_cb;
-
- if (!parent_node)
- {
- if (node)
- eet_node_del(node);
-
- if (eet_node)
- eet_node_del(eet_node);
-
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. ", __FILE__, __LINE__);
- }
-
- if (!eet_node)
- {
- eet_node_del(parent_node);
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. ", __FILE__, __LINE__);
- }
- else if (eet_node_type_get(eet_node) != EET_T_INT)
- {
- eet_node_del(eet_node);
- eet_node_del(parent_node);
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node has wrong type..", __FILE__, __LINE__);
- }
-
- if (!(node_data = eet_node_walk(parent_node, "test", eet_node, &cb, &status_cb)))
- {
- eet_node_del(parent_node);
- eet_node_del(eet_node);
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. ", __FILE__, __LINE__);
- }
-
- if ((!(eet_node_child = eet_node_next_get(eet_node_children_get(parent_node)))) || (eet_node_value_get(eet_node_child)->value.i != 1))
- {
- eet_node_del(eet_node);
- eet_node_del(parent_node);
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Eet_Node has wrong type.. %d ", __FILE__, __LINE__, eet_node_value_get(eet_node_child)->value.i);
- }
-
- if ((node_data->value.i != data_set) || (!status_cb))
- {
- eet_node_del(eet_node);
- eet_node_del(parent_node);
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. incorrect dump node.. ", __FILE__, __LINE__);
- }
-
- printf("[TEST_PASS]:: %s[%d] : Test has passed.. \n", __FILE__, __LINE__);
-
- eet_node_del(parent_node);
-}
-END_TEST
-
-/**
- *@}
- */
-Suite *
-test_suite(void)
-{
- Suite *suite = suite_create("utc_eet_node_walk");
-
- TCase *tcase = tcase_create("TCase");
- tcase_set_timeout(tcase, 30);
- tcase_add_checked_fixture(tcase, setup, teardown);
- tcase_add_test(tcase, utc_eet_node_walk_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_eet_node_walk.log");
- srunner_set_xml(srunner, "utc_eet_node_walk.xml");
- srunner_run_all(srunner, CK_NORMAL);
- number_failed = srunner_ntests_failed(srunner);
- srunner_free(srunner);
-
- return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
-}