]> git.meshlink.io Git - catta/commitdiff
add really long test cases
authorLennart Poettering <lennart@poettering.net>
Sun, 12 Aug 2007 14:09:23 +0000 (14:09 +0000)
committerLennart Poettering <lennart@poettering.net>
Sun, 12 Aug 2007 14:09:23 +0000 (14:09 +0000)
git-svn-id: file:///home/lennart/svn/public/avahi/trunk@1506 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe

avahi-common/alternative-test.c

index b3ee4e9eb020db3ab4dbf5f3c6caecf3805fc2d0..28ae7892a00ab6399f6ccc8d55b121a00475359d 100644 (file)
 
 #include "alternative.h"
 #include "malloc.h"
+#include "domain.h"
 
 int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char *argv[]) {
     const char* const test_strings[] = {
+        "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
+        "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXüüüüüüü",
         "gurke",
-        "",
         "-",
         " #",
         "1",
@@ -68,12 +70,17 @@ int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char *argv[]) {
         
         for (j = 0; j < 2; j++) {
         
-            for (i = 0; i < 20; i++) {
+            for (i = 0; i <= 100; i++) {
                 char *n;
                 
                 n = i == 0 ? avahi_strdup(test_strings[k]) : (j ? avahi_alternative_service_name(r) : avahi_alternative_host_name(r));
                 avahi_free(r);
                 r = n;
+
+                if (j)
+                    assert(avahi_is_valid_service_name(n));
+                else
+                    assert(avahi_is_valid_host_name(n));
                 
                 printf("%s\n", r);
             }