From 9dca47c0e123c7d03bb1147c9f1dd71c2a6dfc29 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Fri, 3 Jul 2015 18:50:36 +0900 Subject: [PATCH] Make the set tests word size agnostic. --- libs/util/test/test-set.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/libs/util/test/test-set.c b/libs/util/test/test-set.c index 3771d9f0e..87e216f18 100644 --- a/libs/util/test/test-set.c +++ b/libs/util/test/test-set.c @@ -4,7 +4,9 @@ #include #include +#include "QF/dstring.h" #include "QF/set.h" +#include "QF/va.h" #define SIZE (SET_DEFMAP_SIZE * sizeof (set_bits_t) * 8) @@ -190,6 +192,21 @@ main (int argc, const char **argv) { size_t i; int res = 0; + dstring_t *str; + + //printf ("set_bits_t: %d, SET_DEFMAP_SIZE: %d, SIZE: %d\n", + // sizeof (set_bits_t), SET_DEFMAP_SIZE, SIZE); + + tests[5].str_expect = nva ("{%d}", SIZE); + tests[7].str_expect = nva ("{%d ...}", SIZE); + tests[8].str_expect = nva ("{%d ...}", SIZE); + + str = dstring_new (); + for (i = 0; i < SIZE; i++) { + dasprintf (str, "%c%d", i ? ' ' : '{', i); + } + dstring_appendstr (str, "}"); + tests[6].str_expect = dstring_freeze (str); for (i = 0; i < num_tests; i++) { set_t *s1, *s2 = 0;