tests/test_compare.c

changeset 1491
b529528b8f0a
parent 787
d0f02310aa47
equal deleted inserted replaced
1490:30ea9885cf04 1491:b529528b8f0a
62 // type aliases for types containing space characters 62 // type aliases for types containing space characters
63 typedef long long cx_longlong; 63 typedef long long cx_longlong;
64 typedef unsigned long cx_ulong; 64 typedef unsigned long cx_ulong;
65 typedef unsigned long long cx_ulonglong; 65 typedef unsigned long long cx_ulonglong;
66 66
67 // generate sub routines depending on the type 67 // generate subroutines depending on the type
68 test_compare_gen_subroutine(int, INT_MAX, true) 68 test_compare_gen_subroutine(int, INT_MAX, true)
69 test_compare_gen_subroutine(long, LONG_MAX, true) 69 test_compare_gen_subroutine(long, LONG_MAX, true)
70 test_compare_gen_subroutine(cx_longlong, LLONG_MAX, true) 70 test_compare_gen_subroutine(cx_longlong, LLONG_MAX, true)
71 test_compare_gen_subroutine(int16_t, INT16_MAX, true) 71 test_compare_gen_subroutine(int16_t, INT16_MAX, true)
72 test_compare_gen_subroutine(int32_t, INT32_MAX, true) 72 test_compare_gen_subroutine(int32_t, INT32_MAX, true)
73 test_compare_gen_subroutine(int64_t, INT64_MAX, true) 73 test_compare_gen_subroutine(int64_t, INT64_MAX, true)
74 test_compare_gen_subroutine(unsigned, UINT_MAX, false) 74 test_compare_gen_subroutine(unsigned, UINT_MAX, false)
75 test_compare_gen_subroutine(cx_ulong, ULONG_MAX, false) 75 test_compare_gen_subroutine(cx_ulong, ULONG_MAX, false)
76 test_compare_gen_subroutine(cx_ulonglong, ULLONG_MAX, false) 76 test_compare_gen_subroutine(cx_ulonglong, ULLONG_MAX, false)
77 test_compare_gen_subroutine(size_t, SIZE_MAX, false)
77 test_compare_gen_subroutine(uint16_t, UINT16_MAX, false) 78 test_compare_gen_subroutine(uint16_t, UINT16_MAX, false)
78 test_compare_gen_subroutine(uint32_t, UINT32_MAX, false) 79 test_compare_gen_subroutine(uint32_t, UINT32_MAX, false)
79 test_compare_gen_subroutine(uint64_t, UINT64_MAX, false) 80 test_compare_gen_subroutine(uint64_t, UINT64_MAX, false)
80 test_compare_gen_subroutine(float, FLT_MAX, true) 81 test_compare_gen_subroutine(float, FLT_MAX, true)
81 test_compare_gen_subroutine(double, DBL_MAX, true) 82 test_compare_gen_subroutine(double, DBL_MAX, true)
114 CX_TEST_DO CX_TEST_CALL_SUBROUTINE(test_sub_cmp_cx_ulong, cx_cmp_ulongint); 115 CX_TEST_DO CX_TEST_CALL_SUBROUTINE(test_sub_cmp_cx_ulong, cx_cmp_ulongint);
115 } 116 }
116 117
117 CX_TEST(test_compare_ulonglong) { 118 CX_TEST(test_compare_ulonglong) {
118 CX_TEST_DO CX_TEST_CALL_SUBROUTINE(test_sub_cmp_cx_ulonglong, cx_cmp_ulonglong); 119 CX_TEST_DO CX_TEST_CALL_SUBROUTINE(test_sub_cmp_cx_ulonglong, cx_cmp_ulonglong);
120 }
121
122 CX_TEST(test_compare_size_t) {
123 CX_TEST_DO CX_TEST_CALL_SUBROUTINE(test_sub_cmp_size_t, cx_cmp_size);
119 } 124 }
120 125
121 CX_TEST(test_compare_uint16_t) { 126 CX_TEST(test_compare_uint16_t) {
122 CX_TEST_DO CX_TEST_CALL_SUBROUTINE(test_sub_cmp_uint16_t, cx_cmp_uint16); 127 CX_TEST_DO CX_TEST_CALL_SUBROUTINE(test_sub_cmp_uint16_t, cx_cmp_uint16);
123 } 128 }
168 cx_test_register(suite, test_compare_int32_t); 173 cx_test_register(suite, test_compare_int32_t);
169 cx_test_register(suite, test_compare_int64_t); 174 cx_test_register(suite, test_compare_int64_t);
170 cx_test_register(suite, test_compare_unsigned); 175 cx_test_register(suite, test_compare_unsigned);
171 cx_test_register(suite, test_compare_ulong); 176 cx_test_register(suite, test_compare_ulong);
172 cx_test_register(suite, test_compare_ulonglong); 177 cx_test_register(suite, test_compare_ulonglong);
178 cx_test_register(suite, test_compare_size_t);
173 cx_test_register(suite, test_compare_uint16_t); 179 cx_test_register(suite, test_compare_uint16_t);
174 cx_test_register(suite, test_compare_uint32_t); 180 cx_test_register(suite, test_compare_uint32_t);
175 cx_test_register(suite, test_compare_uint64_t); 181 cx_test_register(suite, test_compare_uint64_t);
176 cx_test_register(suite, test_compare_float); 182 cx_test_register(suite, test_compare_float);
177 cx_test_register(suite, test_compare_double); 183 cx_test_register(suite, test_compare_double);

mercurial