From f6712902a92eb82b6c8d7e7fd0980a20a716fa0d Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 27 Oct 2005 19:11:34 +0000 Subject: * format unknown DNS records according to RFC3597 * add some DNS class and type validity checks to avahi_server_add() * move DNS type and class definitions to avahi-common/defs.h git-svn-id: file:///home/lennart/svn/public/avahi/trunk@896 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe --- avahi-core/dns-test.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'avahi-core/dns-test.c') diff --git a/avahi-core/dns-test.c b/avahi-core/dns-test.c index 5634ca5..8a7586c 100644 --- a/avahi-core/dns-test.c +++ b/avahi-core/dns-test.c @@ -29,6 +29,7 @@ #include #include +#include #include #include "dns.h" @@ -36,7 +37,7 @@ #include "util.h" int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char *argv[]) { - char t[AVAHI_DOMAIN_NAME_MAX]; + char t[AVAHI_DOMAIN_NAME_MAX], *m; const char *a, *b, *c, *d; AvahiDnsPacket *p; AvahiRecord *r, *r2; @@ -95,6 +96,19 @@ int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char *argv[]) { /* Free the records */ avahi_record_unref(r); avahi_record_unref(r2); + + r = avahi_record_new_full("foobar", 77, 77, AVAHI_DEFAULT_TTL); + assert(r); + + assert(r->data.generic.data = avahi_memdup("HALLO", r->data.generic.size = 5)); + + m = avahi_record_to_string(r); + assert(m); + + avahi_log_debug(">%s<", m); + + avahi_free(m); + avahi_record_unref(r); return 0; } -- cgit