]> git.meshlink.io Git - catta/blobdiff - avahi-common/domain-test.c
document that AVAHI_PROTO_xxx is no longer defined to be identical with AF_xxx
[catta] / avahi-common / domain-test.c
index f1313cbae88dc397b19b7ee8d1fb3cca27c218b6..9926a1f011369ca7f380cc73172344b7078ca04a 100644 (file)
@@ -58,13 +58,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));
@@ -110,5 +110,12 @@ int main(int argc, char *argv[]) {
     assert(avahi_is_valid_host_name("sfooo."));
     assert(avahi_is_valid_host_name("sfooo"));
 
+    assert(avahi_is_valid_domain_name("."));
+    assert(avahi_is_valid_domain_name(""));
+
+    assert(avahi_normalize_name(".", t, sizeof(t)));
+    assert(avahi_normalize_name("", t, sizeof(t)));
+
+    
     return 0;
 }