diff tests/test-action.c @ 441:31c1bbc33813

man: document mlk-action
author David Demelier <markand@malikania.fr>
date Mon, 24 Oct 2022 21:29:39 +0200
parents e1eebc6bf25d
children 9c3b3935f0aa
line wrap: on
line diff
--- a/tests/test-action.c	Tue Oct 18 09:04:02 2022 +0200
+++ b/tests/test-action.c	Mon Oct 24 21:29:39 2022 +0200
@@ -43,7 +43,7 @@
 }
 
 static void
-my_handle(struct action *act, const union event *ev)
+my_handle(struct mlk_action *act, const union event *ev)
 {
 	(void)ev;
 
@@ -51,7 +51,7 @@
 }
 
 static int
-my_update_false(struct action *act, unsigned int ticks)
+my_update_false(struct mlk_action *act, unsigned int ticks)
 {
 	(void)ticks;
 
@@ -61,7 +61,7 @@
 }
 
 static int
-my_update_true(struct action *act, unsigned int ticks)
+my_update_true(struct mlk_action *act, unsigned int ticks)
 {
 	(void)ticks;
 
@@ -71,19 +71,19 @@
 }
 
 static void
-my_draw(struct action *act)
+my_draw(struct mlk_action *act)
 {
 	((struct invokes *)act->data)->draw = 1;
 }
 
 static void
-my_end(struct action *act)
+my_end(struct mlk_action *act)
 {
 	((struct invokes *)act->data)->end = 1;
 }
 
 static void
-my_finish(struct action *act)
+my_finish(struct mlk_action *act)
 {
 	((struct invokes *)act->data)->finish = 1;
 }
@@ -92,9 +92,9 @@
 test_basics_handle(void)
 {
 	struct invokes inv = {0};
-	struct action act = INIT(&inv, my_update_true);
+	struct mlk_action act = INIT(&inv, my_update_true);
 
-	action_handle(&act, &dummy);
+	mlk_action_handle(&act, &dummy);
 
 	DT_ASSERT(inv.handle);
 	DT_ASSERT(!inv.update);
@@ -108,14 +108,14 @@
 {
 	struct {
 		struct invokes inv;
-		struct action act;
+		struct mlk_action act;
 	} table[] = {
 		{ .act = INIT(&table[0], my_update_true)        },
 		{ .act = INIT(&table[1], my_update_false)       }
 	};
 
 	/* True version. */
-	DT_ASSERT(action_update(&table[0].act, 0));
+	DT_ASSERT(mlk_action_update(&table[0].act, 0));
 	DT_ASSERT(!table[0].inv.handle);
 	DT_ASSERT(table[0].inv.update);
 	DT_ASSERT(!table[0].inv.draw);
@@ -123,7 +123,7 @@
 	DT_ASSERT(!table[0].inv.finish);
 
 	/* False version. */
-	DT_ASSERT(!action_update(&table[1].act, 0));
+	DT_ASSERT(!mlk_action_update(&table[1].act, 0));
 	DT_ASSERT(!table[1].inv.handle);
 	DT_ASSERT(table[1].inv.update);
 	DT_ASSERT(!table[1].inv.draw);
@@ -135,9 +135,9 @@
 test_basics_draw(void)
 {
 	struct invokes inv = {0};
-	struct action act = INIT(&inv, my_update_true);
+	struct mlk_action act = INIT(&inv, my_update_true);
 
-	action_draw(&act);
+	mlk_action_draw(&act);
 
 	DT_ASSERT(!inv.handle);
 	DT_ASSERT(!inv.update);
@@ -150,9 +150,9 @@
 test_basics_end(void)
 {
 	struct invokes inv = {0};
-	struct action act = INIT(&inv, my_update_true);
+	struct mlk_action act = INIT(&inv, my_update_true);
 
-	action_end(&act);
+	mlk_action_end(&act);
 
 	DT_ASSERT(!inv.handle);
 	DT_ASSERT(!inv.update);
@@ -165,9 +165,9 @@
 test_basics_finish(void)
 {
 	struct invokes inv = {0};
-	struct action act = INIT(&inv, my_update_true);
+	struct mlk_action act = INIT(&inv, my_update_true);
 
-	action_finish(&act);
+	mlk_action_finish(&act);
 
 	DT_ASSERT(!inv.handle);
 	DT_ASSERT(!inv.update);
@@ -179,9 +179,9 @@
 static void
 test_stack_add(void)
 {
-	struct action *actions[10];
+	struct mlk_action *actions[10];
 	struct action_stack st = {0};
-	struct action act = {0};
+	struct mlk_action act = {0};
 
 	action_stack_init(&st, actions, 10);
 
@@ -200,14 +200,14 @@
 {
 	struct {
 		int called;
-		struct action act;
+		struct mlk_action act;
 	} table[] = {
 		{ 0, { .data = &table[0].called, .handle = my_handle } },
 		{ 0, { .data = &table[1].called, .handle = my_handle } },
 		{ 0, { .data = &table[2].called, .handle = my_handle } },
 	};
 
-	struct action *actions[10];
+	struct mlk_action *actions[10];
 	struct action_stack st = {0};
 
 	action_stack_init(&st, actions, 10);
@@ -226,7 +226,7 @@
 {
 	struct {
 		struct invokes inv;
-		struct action act;
+		struct mlk_action act;
 	} table[] = {
 		{ .act = INIT(&table[0], my_update_false)       },
 		{ .act = INIT(&table[1], my_update_true)        },
@@ -237,7 +237,7 @@
 		{ .act = INIT(&table[6], my_update_false)	},
 	};
 
-	struct action *actions[10];
+	struct mlk_action *actions[10];
 	struct action_stack st = {0};
 
 	action_stack_init(&st, actions, 10);
@@ -325,7 +325,7 @@
 {
 	struct {
 		struct invokes inv;
-		struct action act;
+		struct mlk_action act;
 	} table[] = {
 		{ .act = INIT(&table[0], my_update_false)       },
 		{ .act = INIT(&table[1], my_update_true)        },
@@ -336,7 +336,7 @@
 		{ .act = INIT(&table[6], my_update_false)	},
 	};
 
-	struct action *actions[10];
+	struct mlk_action *actions[10];
 	struct action_stack st = {0};
 
 	action_stack_init(&st, actions, 10);
@@ -395,13 +395,13 @@
 {
 	struct {
 		struct invokes inv;
-		struct action act;
+		struct mlk_action act;
 	} table[] = {
 		{ .act = INIT(&table[0], my_update_true)        },
 		{ .act = INIT(&table[0], my_update_false)       },
 	};
 
-	struct action *actions[10];
+	struct mlk_action *actions[10];
 	struct action_stack st = {0};
 
 	action_stack_init(&st, actions, 10);