406c8d0197edcae1f891aba43bc5df06483d043c
[platform/upstream/nettle.git] / testsuite / meta-armor-test.c
1 #include "testutils.h"
2 #include "nettle-meta.h"
3
4 const char* armors[] = {
5   "base16",
6   "base64",
7   "base64url",
8 };
9
10 void
11 test_main(void)
12 {
13   int i,j;
14   int count = sizeof(armors)/sizeof(*armors);
15   for (i = 0; i < count; i++) {
16     for (j = 0; NULL != nettle_armors[j]; j++) {
17       if (0 == strcmp(armors[i], nettle_armors[j]->name))
18         break;
19     }
20     ASSERT(NULL != nettle_armors[j]); /* make sure we found a matching armor */
21   }
22   j = 0;
23   while (NULL != nettle_armors[j])
24     j++;
25   ASSERT(j == count); /* we are not missing testing any armors */
26 }
27