8 #include "lib/global.h"
10 /*** typedefs(not structures) and defined constants **********************************************/
12 #define mctest_add_parameterized_test(tc_core, test_func, test_data_source) {\
13 tcase_add_loop_test (tc_core, test_func, 0, G_N_ELEMENTS (test_data_source)); \
16 #define mctest_assert_str_eq(actual_result, etalon_result) { \
17 g_assert_cmpstr (actual_result, ==, etalon_result); \
20 #define mctest_assert_int_eq(actual_result, etalon_result) { \
21 ck_assert_int_eq (actual_result, etalon_result); \
24 #define mctest_assert_int_ne(actual_result, etalon_result) { \
25 ck_assert_int_ne (actual_result, etalon_result); \
28 #define mctest_assert_ptr_eq(actual_pointer, etalon_pointer) { \
29 ck_assert_msg ( actual_pointer == etalon_pointer, \
30 "%s(%p) pointer should be equal to %s(%p)\n", \
31 #actual_pointer, actual_pointer, #etalon_pointer , etalon_pointer \
35 #define mctest_assert_ptr_ne(actual_pointer, etalon_pointer) { \
36 ck_assert_msg ( actual_pointer != etalon_pointer, \
37 "%s(%p) pointer should not be equal to %s(%p)\n", \
38 #actual_pointer, actual_pointer, #etalon_pointer , etalon_pointer \
42 #define mctest_assert_null(actual_pointer) { \
44 (void *) actual_pointer == NULL, \
45 "%s(%p) variable should be NULL", #actual_pointer, actual_pointer \
49 #define mctest_assert_not_null(actual_pointer) { \
51 (void *) actual_pointer != NULL, \
52 "%s(nil) variable should not be NULL", #actual_pointer \
56 #define mctest_assert_true(actual_pointer) { \
58 (int) actual_pointer != 0, \
59 "%s variable should be TRUE", #actual_pointer \
63 #define mctest_assert_false(actual_pointer) { \
65 (int) actual_pointer == 0, \
66 "%s variable should be TRUE", #actual_pointer \
71 * Define header for a parameterized test.
72 * Declare 'data' variable for access to the parameters in current iteration
74 #define START_PARAMETRIZED_TEST(name_test, struct_name) START_TEST (name_test) { const struct struct_name *data = &struct_name[_i];
77 * Define footer for a parameterized test.
79 #define END_PARAMETRIZED_TEST } END_TEST
81 /*** enums ***************************************************************************************/
83 /*** structures declarations (and typedefs of structures)*****************************************/
85 /*** global variables defined in .c file *********************************************************/
87 /*** declarations of public functions ************************************************************/
89 /*** inline functions ****************************************************************************/