Mercurial > molko
comparison tests/test-action-script.c @ 408:0ea90751a62d
tests: disable entirely automatic registration
author | David Demelier <markand@malikania.fr> |
---|---|
date | Fri, 08 Apr 2022 15:59:08 +0200 |
parents | e6f972e04519 |
children | 1bf7d6669f0a |
comparison
equal
deleted
inserted
replaced
407:e6f972e04519 | 408:0ea90751a62d |
---|---|
83 my_finish(struct action *act) | 83 my_finish(struct action *act) |
84 { | 84 { |
85 ((struct invokes *)act->data)->finish++; | 85 ((struct invokes *)act->data)->finish++; |
86 } | 86 } |
87 | 87 |
88 TEST_DECL(basics_init) | 88 RX_TEST_CASE(basics, init) |
89 { | 89 { |
90 struct script sc; | 90 struct script sc; |
91 | 91 |
92 script_init(&sc); | 92 script_init(&sc); |
93 | 93 |
94 RX_UINT_REQUIRE_EQUAL(sc.actionsz, 0U); | 94 RX_UINT_REQUIRE_EQUAL(sc.actionsz, 0U); |
95 RX_UINT_REQUIRE_EQUAL(sc.cur, 0U); | 95 RX_UINT_REQUIRE_EQUAL(sc.cur, 0U); |
96 } | 96 } |
97 | 97 |
98 TEST_DECL(basics_append) | 98 RX_TEST_CASE(basics, append) |
99 { | 99 { |
100 struct action act[3] = {0}; | 100 struct action act[3] = {0}; |
101 struct script sc = {0}; | 101 struct script sc = {0}; |
102 | 102 |
103 RX_REQUIRE(script_append(&sc, &act[0]) == 0); | 103 RX_REQUIRE(script_append(&sc, &act[0]) == 0); |
119 RX_PTR_REQUIRE_EQUAL(sc.actions[2], &act[2]); | 119 RX_PTR_REQUIRE_EQUAL(sc.actions[2], &act[2]); |
120 | 120 |
121 script_finish(&sc); | 121 script_finish(&sc); |
122 } | 122 } |
123 | 123 |
124 TEST_DECL(basics_handle) | 124 RX_TEST_CASE(basics, handle) |
125 { | 125 { |
126 struct { | 126 struct { |
127 struct invokes inv; | 127 struct invokes inv; |
128 struct action act; | 128 struct action act; |
129 } table[] = { | 129 } table[] = { |
195 RX_INT_REQUIRE_EQUAL(table[2].inv.draw, 0); | 195 RX_INT_REQUIRE_EQUAL(table[2].inv.draw, 0); |
196 RX_INT_REQUIRE_EQUAL(table[2].inv.end, 0); | 196 RX_INT_REQUIRE_EQUAL(table[2].inv.end, 0); |
197 RX_INT_REQUIRE_EQUAL(table[2].inv.finish, 0); | 197 RX_INT_REQUIRE_EQUAL(table[2].inv.finish, 0); |
198 } | 198 } |
199 | 199 |
200 TEST_DECL(basics_update) | 200 RX_TEST_CASE(basics, update) |
201 { | 201 { |
202 struct { | 202 struct { |
203 struct invokes inv; | 203 struct invokes inv; |
204 struct action act; | 204 struct action act; |
205 } table[] = { | 205 } table[] = { |
288 RX_INT_REQUIRE_EQUAL(table[2].inv.draw, 0); | 288 RX_INT_REQUIRE_EQUAL(table[2].inv.draw, 0); |
289 RX_INT_REQUIRE_EQUAL(table[2].inv.end, 1); | 289 RX_INT_REQUIRE_EQUAL(table[2].inv.end, 1); |
290 RX_INT_REQUIRE_EQUAL(table[2].inv.finish, 0); | 290 RX_INT_REQUIRE_EQUAL(table[2].inv.finish, 0); |
291 } | 291 } |
292 | 292 |
293 TEST_DECL(basics_draw) | 293 RX_TEST_CASE(basics, draw) |
294 { | 294 { |
295 struct { | 295 struct { |
296 struct invokes inv; | 296 struct invokes inv; |
297 struct action act; | 297 struct action act; |
298 } table[] = { | 298 } table[] = { |
364 RX_INT_REQUIRE_EQUAL(table[2].inv.draw, 1); | 364 RX_INT_REQUIRE_EQUAL(table[2].inv.draw, 1); |
365 RX_INT_REQUIRE_EQUAL(table[2].inv.end, 0); | 365 RX_INT_REQUIRE_EQUAL(table[2].inv.end, 0); |
366 RX_INT_REQUIRE_EQUAL(table[2].inv.finish, 0); | 366 RX_INT_REQUIRE_EQUAL(table[2].inv.finish, 0); |
367 } | 367 } |
368 | 368 |
369 TEST_DECL(basics_finish) | 369 RX_TEST_CASE(basics, finish) |
370 { | 370 { |
371 struct { | 371 struct { |
372 struct invokes inv; | 372 struct invokes inv; |
373 struct action act; | 373 struct action act; |
374 } table[] = { | 374 } table[] = { |
403 RX_INT_REQUIRE_EQUAL(table[2].inv.draw, 0); | 403 RX_INT_REQUIRE_EQUAL(table[2].inv.draw, 0); |
404 RX_INT_REQUIRE_EQUAL(table[2].inv.end, 0); | 404 RX_INT_REQUIRE_EQUAL(table[2].inv.end, 0); |
405 RX_INT_REQUIRE_EQUAL(table[2].inv.finish, 1); | 405 RX_INT_REQUIRE_EQUAL(table[2].inv.finish, 1); |
406 } | 406 } |
407 | 407 |
408 TEST_DECL(action_simple) | 408 RX_TEST_CASE(action, simple) |
409 { | 409 { |
410 struct { | 410 struct { |
411 struct invokes inv; | 411 struct invokes inv; |
412 struct action act; | 412 struct action act; |
413 } table[] = { | 413 } table[] = { |
528 RX_INT_REQUIRE_EQUAL(table[2].inv.end, 1); | 528 RX_INT_REQUIRE_EQUAL(table[2].inv.end, 1); |
529 RX_INT_REQUIRE_EQUAL(table[2].inv.finish, 1); | 529 RX_INT_REQUIRE_EQUAL(table[2].inv.finish, 1); |
530 } | 530 } |
531 | 531 |
532 static const struct rx_test_case tests[] = { | 532 static const struct rx_test_case tests[] = { |
533 TEST_DEF("basics", "init", basics_init), | 533 TEST(basics, init), |
534 TEST_DEF("basics", "append", basics_append), | 534 TEST(basics, append), |
535 TEST_DEF("basics", "handle", basics_handle), | 535 TEST(basics, handle), |
536 TEST_DEF("basics", "update", basics_update), | 536 TEST(basics, update), |
537 TEST_DEF("basics", "draw", basics_draw), | 537 TEST(basics, draw), |
538 TEST_DEF("basics", "finish", basics_finish), | 538 TEST(basics, finish), |
539 TEST_DEF("action", "simple", action_simple) | 539 TEST(action, simple) |
540 }; | 540 }; |
541 | 541 |
542 int | 542 int |
543 main(int argc, char **argv) | 543 main(int argc, char **argv) |
544 { | 544 { |
545 return TEST_RUN(tests, argc, argv); | 545 return TEST_RUN_ALL(tests, argc, argv); |
546 } | 546 } |