From c6ccfeec196614c15320f45f8ba1bdb86646bd97 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Sun, 12 Aug 2007 14:09:23 +0000 Subject: [PATCH] add really long test cases git-svn-id: file:///home/lennart/svn/public/avahi/trunk@1506 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe --- avahi-common/alternative-test.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/avahi-common/alternative-test.c b/avahi-common/alternative-test.c index b3ee4e9..28ae789 100644 --- a/avahi-common/alternative-test.c +++ b/avahi-common/alternative-test.c @@ -27,11 +27,13 @@ #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); } -- 2.39.5