X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=avahi-core%2Fdns-test.c;h=ae2343d96288a41eae8f82059489a7c4360d698f;hb=2ea7e99ed0dcfd371fef5aeecd3de77da1dfcd4f;hp=5634ca583542c5abe06820180bfd3b5c0301b338;hpb=854f901f491ccda79aee11edc3d59109cb229d28;p=catta diff --git a/avahi-core/dns-test.c b/avahi-core/dns-test.c index 5634ca5..ae2343d 100644 --- a/avahi-core/dns-test.c +++ b/avahi-core/dns-test.c @@ -24,11 +24,13 @@ #endif #include +#include #include #include #include #include +#include #include #include "dns.h" @@ -36,7 +38,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 +97,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; }