diff tests/test-color.c @ 410:1bf7d6669f0a

tests: switch to libdt
author David Demelier <markand@malikania.fr>
date Fri, 09 Sep 2022 13:30:34 +0200
parents 0ea90751a62d
children 8f59201dc76b
line wrap: on
line diff
--- a/tests/test-color.c	Fri Sep 09 09:27:17 2022 +0200
+++ b/tests/test-color.c	Fri Sep 09 13:30:34 2022 +0200
@@ -18,43 +18,45 @@
 
 #include <core/color.h>
 
-#include "test.h"
+#include <dt.h>
 
-RX_TEST_CASE(basics, red)
+static void
+test_basics_red(void)
 {
-	RX_INT_REQUIRE_EQUAL(COLOR_R(0xa3000000), 163);
+	DT_EQ_INT(COLOR_R(0xa3000000), 163);
 }
 
-RX_TEST_CASE(basics, green)
+static void
+test_basics_green(void)
 {
-	RX_INT_REQUIRE_EQUAL(COLOR_G(0x00130000), 19);
+	DT_EQ_INT(COLOR_G(0x00130000), 19);
 }
 
-RX_TEST_CASE(basics, blue)
+static void
+test_basics_blue(void)
 {
-	RX_INT_REQUIRE_EQUAL(COLOR_B(0x0000ee00), 238);
+	DT_EQ_INT(COLOR_B(0x0000ee00), 238);
 }
 
-RX_TEST_CASE(basics, alpha)
+static void
+test_basics_alpha(void)
 {
-	RX_INT_REQUIRE_EQUAL(COLOR_A(0x000000ff), 255);
-}
-
-RX_TEST_CASE(basics, simple)
-{
-	RX_UINT_REQUIRE_EQUAL(COLOR_HEX(170, 187, 204, 238), 0xaabbccee);
+	DT_EQ_INT(COLOR_A(0x000000ff), 255);
 }
 
-static const struct rx_test_case tests[] = {
-	TEST(basics, red),
-	TEST(basics, green),
-	TEST(basics, blue),
-	TEST(basics, alpha),
-	TEST(basics, simple),
-};
+static void
+test_basics_simple(void)
+{
+	DT_EQ_UINT(COLOR_HEX(170, 187, 204, 238), 0xaabbccee);
+}
 
 int
-main(int argc, char **argv)
+main(void)
 {
-	return TEST_RUN_ALL(tests, argc, argv);
+	DT_RUN(test_basics_red);
+	DT_RUN(test_basics_green);
+	DT_RUN(test_basics_blue);
+	DT_RUN(test_basics_alpha);
+	DT_RUN(test_basics_simple);
+	DT_SUMMARY();
 }