Merge branch 'maint'
[git/mingw/4msysgit/kblees.git] / test-string-pool.c
blobc5782e6bcec575b75a5e6c3f760b92d2626e34e7
1 /*
2 * test-string-pool.c: code to exercise the svn importer's string pool
3 */
5 #include "git-compat-util.h"
6 #include "vcs-svn/string_pool.h"
8 int main(int argc, char *argv[])
10 const uint32_t unequal = pool_intern("does not equal");
11 const uint32_t equal = pool_intern("equals");
12 uint32_t buf[3];
13 uint32_t n;
15 if (argc != 2)
16 usage("test-string-pool <string>,<string>");
18 n = pool_tok_seq(3, buf, ",-", argv[1]);
19 if (n >= 3)
20 die("too many strings");
21 if (n <= 1)
22 die("too few strings");
24 buf[2] = buf[1];
25 buf[1] = (buf[0] == buf[2]) ? equal : unequal;
26 pool_print_seq(3, buf, ' ', stdout);
27 fputc('\n', stdout);
29 pool_reset();
30 return 0;