- i = 0;
- while (dottests[i].a) {
- memset(temp, 0, sizeof(temp));
- strcpy(temp, dottests[i].b);
- b = temp;
- inline_undotify(b, sizeof(temp));
+ memset(temp, 0, sizeof(temp));
+ strcpy(temp, dottests[_i].b);
+ b = temp;
+ inline_undotify(b, sizeof(temp));
+
+ fail_unless(strcmp(dottests[_i].a, temp) == 0,
+ "'%s' != '%s'", temp, dottests[_i].a);
+}
+END_TEST
+
+START_TEST(test_build_hostname)
+{
+ char data[256];
+ char buf[1024];
+ char *topdomain = "a.c";
+ int buflen;
+ int i;
+
+ for (i = 0; i < sizeof(data); i++) {
+ data[i] = i & 0xFF;
+ }
+
+ buflen = sizeof(buf);
+
+ for (i = 1; i < sizeof(data); i++) {
+ int len = build_hostname(buf, buflen, data, i, topdomain, get_base32_encoder(), sizeof(buf));