4 int main(int argc, char *argv[]) {
5 gchar t[256], *a, *b, *c, *d;
8 p = flx_dns_packet_new(8000);
10 flx_dns_packet_append_name(p, a = "hello.hello.hello.de.");
11 flx_dns_packet_append_name(p, b = "this is a test.hello.de.");
12 flx_dns_packet_append_name(p, c = "this\\.is\\.a\\.test\\.with\\.dots.hello.de.");
13 flx_dns_packet_append_name(p, d = "this\\\\is another\\ \\test.hello.de.");
15 flx_hexdump(FLX_DNS_PACKET_DATA(p), p->size);
17 flx_dns_packet_consume_name(p, t, sizeof(t));
19 g_assert(flx_domain_equal(a, t));
21 flx_dns_packet_consume_name(p, t, sizeof(t));
23 g_assert(flx_domain_equal(b, t));
25 flx_dns_packet_consume_name(p, t, sizeof(t));
27 g_assert(flx_domain_equal(c, t));
29 flx_dns_packet_consume_name(p, t, sizeof(t));
31 g_assert(flx_domain_equal(d, t));
33 flx_dns_packet_free(p);