tests/test_utils.c

changeset 955
18741059da47
parent 841
93851c0babe4
child 962
cd418898af5c
equal deleted inserted replaced
954:a1d87e8fff6d 955:18741059da47
104 j++; 104 j++;
105 } 105 }
106 } 106 }
107 } 107 }
108 108
109 CX_TEST(test_swap_ptr) {
110 int i = 5;
111 int j = 8;
112 int *ip = &i;
113 int *jp = &j;
114 CX_TEST_DO {
115 cx_swap_ptr(ip, jp);
116 CX_TEST_ASSERT(ip == &j);
117 CX_TEST_ASSERT(jp == &i);
118 }
119 }
120
121 CX_TEST(test_szmul) { 109 CX_TEST(test_szmul) {
122 size_t r; 110 size_t r;
123 int e; 111 int e;
124 112
125 CX_TEST_DO { 113 CX_TEST_DO {
244 CxTestSuite *suite = cx_test_suite_new("utils"); 232 CxTestSuite *suite = cx_test_suite_new("utils");
245 233
246 cx_test_register(suite, test_stream_bncopy); 234 cx_test_register(suite, test_stream_bncopy);
247 cx_test_register(suite, test_stream_ncopy); 235 cx_test_register(suite, test_stream_ncopy);
248 cx_test_register(suite, test_forn); 236 cx_test_register(suite, test_forn);
249 cx_test_register(suite, test_swap_ptr);
250 cx_test_register(suite, test_szmul); 237 cx_test_register(suite, test_szmul);
251 #ifdef CX_SZMUL_BUILTIN 238 #ifdef CX_SZMUL_BUILTIN
252 cx_test_register(suite, test_szmul_impl); 239 cx_test_register(suite, test_szmul_impl);
253 #endif 240 #endif
254 241

mercurial