diff options
author | Lennart Poettering <lennart@poettering.net> | 2005-04-24 21:19:40 +0000 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2005-04-24 21:19:40 +0000 |
commit | 4c8155fa9c85c7ece92182d0ab53f99a982a4abf (patch) | |
tree | 06e5e994d44d263fafff1b41826045cb709df8ad /dns-test.c | |
parent | 128ea7fd4f9bb48a6ae51fe3f53e661b5399a1e6 (diff) |
* improve dns.c testing program
* fix some compiler warnings
* correct flx_dns_packet_append_name()
* fix host name string
* fix use of flx_domain_equal() use
git-svn-id: file:///home/lennart/svn/public/avahi/trunk@30 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe
Diffstat (limited to 'dns-test.c')
-rw-r--r-- | dns-test.c | 18 |
1 files changed, 12 insertions, 6 deletions
@@ -2,27 +2,33 @@ #include "util.h" int main(int argc, char *argv[]) { - gchar t[256]; + gchar t[256], *a, *b, *c, *d; flxDnsPacket *p; p = flx_dns_packet_new(8000); - flx_dns_packet_append_name(p, "hello.hello.hello.de."); - flx_dns_packet_append_name(p, "this is a test.hello.de."); - flx_dns_packet_append_name(p, "this\\.is\\.a\\.test\\.with\\.dots.hello.de."); - flx_dns_packet_append_name(p, "this\\\\is another\\ \\test.hello.de."); + flx_dns_packet_append_name(p, a = "hello.hello.hello.de."); + flx_dns_packet_append_name(p, b = "this is a test.hello.de."); + flx_dns_packet_append_name(p, c = "this\\.is\\.a\\.test\\.with\\.dots.hello.de."); + flx_dns_packet_append_name(p, d = "this\\\\is another\\ \\test.hello.de."); flx_hexdump(FLX_DNS_PACKET_DATA(p), p->size); flx_dns_packet_consume_name(p, t, sizeof(t)); g_message(">%s<", t); + g_assert(flx_domain_equal(a, t)); + flx_dns_packet_consume_name(p, t, sizeof(t)); g_message(">%s<", t); + g_assert(flx_domain_equal(b, t)); + flx_dns_packet_consume_name(p, t, sizeof(t)); g_message(">%s<", t); + g_assert(flx_domain_equal(c, t)); + flx_dns_packet_consume_name(p, t, sizeof(t)); g_message(">%s<", t); - + g_assert(flx_domain_equal(d, t)); flx_dns_packet_free(p); return 0; |