summaryrefslogtreecommitdiff
path: root/libmisc/tests
diff options
context:
space:
mode:
Diffstat (limited to 'libmisc/tests')
-rw-r--r--libmisc/tests/test_macro.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/libmisc/tests/test_macro.c b/libmisc/tests/test_macro.c
index bc66f48..5648063 100644
--- a/libmisc/tests/test_macro.c
+++ b/libmisc/tests/test_macro.c
@@ -108,11 +108,11 @@ int main() {
/* Recursion. */
{
#define FNi(a, b) LM_CAT2(a, b)
- #define FNo(a) LM_FOREACH_PARAM(FNi, (a), 4, 5, 6)
- const char *str = LM_STR_(LM_FOREACH_PARAM(FNo, (), 1, 2, 3));
+ #define FNo(a) LM_FOREACH_PARAM(FNi, (a), 1, 2, 3)
+ const char *str = LM_STR_(LM_FOREACH_PARAM(FNo, (), a, b, c));
#undef FNo
#undef FNi
- test_assert(strcmp(str, "14 15 16 24 25 26 34 35 36") == 0);
+ test_assert(strcmp(str, "a1 a2 a3 b1 b2 b3 c1 c2 c3") == 0);
}
/* Test that it works with the documented limit of params. */
@@ -159,11 +159,11 @@ int main() {
/* Recursion. */
{
#define FNi(a, b) LM_CAT2(a, b)
- #define FNo(a) LM_FOREACH_TUPLE((4) (5) (6), FNi, a)
- const char *str = LM_STR_(LM_FOREACH_TUPLE((1) (2) (3), FNo));
+ #define FNo(a) LM_FOREACH_TUPLE((1) (2) (3), FNi, a)
+ const char *str = LM_STR_(LM_FOREACH_TUPLE((a) (b) (c), FNo));
#undef FNo
#undef FNi
- test_assert(strcmp(str, "14 15 16 24 25 26 34 35 36") == 0);
+ test_assert(strcmp(str, "a1 a2 a3 b1 b2 b3 c1 c2 c3") == 0);
}
/* Test that it works with the documented limit of tuples. */