]> git.meshlink.io Git - catta/blobdiff - avahi-common/domain-test.c
don't build static library for dbus-watch-glue and the like, instead compile the...
[catta] / avahi-common / domain-test.c
index 279be723ee136cd0c2d782b0b1f160e5722f1dc4..c9ff32e2db3f633ef3d76a2c5adde8a38f9ee4ba 100644 (file)
 #include "domain.h"
 #include "malloc.h"
 
-int main(int argc, char *argv[]) {
+int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char *argv[]) {
     char *s;
     char t[256], r[256];
     const char *p;
     size_t size;
     char name[64], type[AVAHI_DOMAIN_NAME_MAX], domain[AVAHI_DOMAIN_NAME_MAX];
     
-    printf("host name: %s\n", s = avahi_get_host_name_strdup());
-    avahi_free(s);
-
     printf("%s\n", s = avahi_normalize_name_strdup("foo.foo\\046."));
     avahi_free(s);
 
@@ -58,13 +55,13 @@ int main(int argc, char *argv[]) {
     printf("%u = %u\n", avahi_domain_hash("ccc\\065aa.aa\\.b\\\\."), avahi_domain_hash("cccAaa.aa\\.b\\\\"));
 
 
-    avahi_service_name_join(t, sizeof(t), "foo.foo.foo \.", "_http._tcp", "test.local");
+    avahi_service_name_join(t, sizeof(t), "foo.foo.foo \\.", "_http._tcp", "test.local");
     printf("<%s>\n", t);
 
     avahi_service_name_split(t, name, sizeof(name), type, sizeof(type), domain, sizeof(domain));
     printf("name: <%s>; type: <%s>; domain <%s>\n", name, type, domain);
     
-    avahi_service_name_join(t, sizeof(t), NULL, "_http._tcp", "one.two\. .local");
+    avahi_service_name_join(t, sizeof(t), NULL, "_http._tcp", "one.two\\. .local");
     printf("<%s>\n", t);
 
     avahi_service_name_split(t, NULL, 0, type, sizeof(type), domain, sizeof(domain));
@@ -82,8 +79,6 @@ int main(int argc, char *argv[]) {
     p = r;
     printf("unescaped: <%s>\n", avahi_unescape_label(&p, t, sizeof(t)));
 
-    assert(avahi_domain_ends_with("foo.bar.\\065\\\\\\.aaaa", "\\065\\\\\\.aaaa"));
-
     assert(avahi_is_valid_service_type_generic("_foo._bar._waldo"));
     assert(!avahi_is_valid_service_type_strict("_foo._bar._waldo"));
     assert(!avahi_is_valid_service_subtype("_foo._bar._waldo"));