Mercurial > molko
comparison tests/test-color.c @ 407:e6f972e04519
tests: don't use automatic feature
author | David Demelier <markand@malikania.fr> |
---|---|
date | Wed, 06 Apr 2022 12:09:25 +0200 |
parents | 460c78706989 |
children | 0ea90751a62d |
comparison
equal
deleted
inserted
replaced
406:107fc5c77df2 | 407:e6f972e04519 |
---|---|
14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | 14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | 15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | 16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
17 */ | 17 */ |
18 | 18 |
19 #include <rexo.h> | |
20 | |
21 #include <core/color.h> | 19 #include <core/color.h> |
22 | 20 |
23 RX_TEST_CASE(basics, red) | 21 #include "test.h" |
22 | |
23 TEST_DECL(basics_red) | |
24 { | 24 { |
25 RX_INT_REQUIRE_EQUAL(COLOR_R(0xa3000000), 163); | 25 RX_INT_REQUIRE_EQUAL(COLOR_R(0xa3000000), 163); |
26 } | 26 } |
27 | 27 |
28 RX_TEST_CASE(basics, green) | 28 TEST_DECL(basics_green) |
29 { | 29 { |
30 RX_INT_REQUIRE_EQUAL(COLOR_G(0x00130000), 19); | 30 RX_INT_REQUIRE_EQUAL(COLOR_G(0x00130000), 19); |
31 } | 31 } |
32 | 32 |
33 RX_TEST_CASE(basics, blue) | 33 TEST_DECL(basics_blue) |
34 { | 34 { |
35 RX_INT_REQUIRE_EQUAL(COLOR_B(0x0000ee00), 238); | 35 RX_INT_REQUIRE_EQUAL(COLOR_B(0x0000ee00), 238); |
36 } | 36 } |
37 | 37 |
38 RX_TEST_CASE(basics, alpha) | 38 TEST_DECL(basics_alpha) |
39 { | 39 { |
40 RX_INT_REQUIRE_EQUAL(COLOR_A(0x000000ff), 255); | 40 RX_INT_REQUIRE_EQUAL(COLOR_A(0x000000ff), 255); |
41 } | 41 } |
42 | 42 |
43 RX_TEST_CASE(basics, simple) | 43 TEST_DECL(basics_simple) |
44 { | 44 { |
45 RX_UINT_REQUIRE_EQUAL(COLOR_HEX(170, 187, 204, 238), 0xaabbccee); | 45 RX_UINT_REQUIRE_EQUAL(COLOR_HEX(170, 187, 204, 238), 0xaabbccee); |
46 } | 46 } |
47 | 47 |
48 static const struct rx_test_case tests[] = { | |
49 TEST_DEF("basics", "red", basics_red), | |
50 TEST_DEF("basics", "green", basics_green), | |
51 TEST_DEF("basics", "blue", basics_blue), | |
52 TEST_DEF("basics", "alpha", basics_alpha), | |
53 TEST_DEF("basics", "simple", basics_simple) | |
54 }; | |
55 | |
48 int | 56 int |
49 main(int argc, char **argv) | 57 main(int argc, char **argv) |
50 { | 58 { |
51 return rx_main(0, NULL, argc, (const char **)argv) == RX_SUCCESS ? 0 : 1; | 59 return TEST_RUN(tests, argc, argv); |
52 } | 60 } |