]> git.meshlink.io Git - catta/blobdiff - dns-test.c
Rename flx_* to avahi_*
[catta] / dns-test.c
index 5d09b4a2d0de45dd82da5efb916384ca2f487363..d8c7b531360151c8e41a3c8f0c8f69755b62139b 100644 (file)
@@ -2,28 +2,34 @@
 #include "util.h"
 
 int main(int argc, char *argv[]) {
-    gchar t[256];
-    flxDnsPacket *p;
+    gchar t[256], *a, *b, *c, *d;
+    AvahiDnsPacket *p;
 
-    p = flx_dns_packet_new(8000);
+    p = avahi_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."); 
+    avahi_dns_packet_append_name(p, a = "hello.hello.hello.de.");
+    avahi_dns_packet_append_name(p, b = "this is a test.hello.de."); 
+    avahi_dns_packet_append_name(p, c = "this\\.is\\.a\\.test\\.with\\.dots.hello.de."); 
+    avahi_dns_packet_append_name(p, d = "this\\\\is another\\ \\test.hello.de."); 
 
-    flx_hexdump(FLX_DNS_PACKET_DATA(p), p->size);
+    avahi_hexdump(AVAHI_DNS_PACKET_DATA(p), p->size);
 
-    flx_dns_packet_consume_name(p, t, sizeof(t));
+    avahi_dns_packet_consume_name(p, t, sizeof(t));
     g_message(">%s<", t);
-    flx_dns_packet_consume_name(p, t, sizeof(t));
+    g_assert(avahi_domain_equal(a, t));
+    
+    avahi_dns_packet_consume_name(p, t, sizeof(t));
     g_message(">%s<", t);
-    flx_dns_packet_consume_name(p, t, sizeof(t));
+    g_assert(avahi_domain_equal(b, t));
+
+    avahi_dns_packet_consume_name(p, t, sizeof(t));
     g_message(">%s<", t);
-    flx_dns_packet_consume_name(p, t, sizeof(t));
+    g_assert(avahi_domain_equal(c, t));
+
+    avahi_dns_packet_consume_name(p, t, sizeof(t));
     g_message(">%s<", t);
+    g_assert(avahi_domain_equal(d, t));
     
-    
-    flx_dns_packet_free(p);
+    avahi_dns_packet_free(p);
     return 0;
 }