]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
alphabetize tests/usage
authorMark Andrews <marka@isc.org>
Thu, 3 Sep 2020 04:09:38 +0000 (14:09 +1000)
committerMark Andrews <marka@isc.org>
Mon, 7 Sep 2020 22:43:45 +0000 (08:43 +1000)
(cherry picked from commit bbece7389eae3350c5be1bfa4cad1ad39bb131b2)

bin/tests/system/feature-test.c

index c1249ed62c14a650bfff8928c992828e6814f3e2..78f1c1c6c14e1a8b45420b8765f32248f3c65b37 100644 (file)
@@ -37,21 +37,21 @@ static void
 usage() {
        fprintf(stderr, "usage: feature-test <arg>\n");
        fprintf(stderr, "args:\n");
-       fprintf(stderr, "       --edns-version\n");
-       fprintf(stderr, "       --enable-filter-aaaa\n");
-       fprintf(stderr, "       --gethostname\n");
-       fprintf(stderr, "       --gssapi\n");
-       fprintf(stderr, "       --have-aes\n");
-       fprintf(stderr, "       --have-dlopen\n");
-       fprintf(stderr, "       --have-geoip\n");
-       fprintf(stderr, "       --have-geoip2\n");
-       fprintf(stderr, "       --have-libxml2\n");
-       fprintf(stderr, "       --ipv6only=no\n");
-       fprintf(stderr, "       --rpz-nsdname\n");
-       fprintf(stderr, "       --rpz-nsip\n");
-       fprintf(stderr, "       --with-idn\n");
-       fprintf(stderr, "       --with-lmdb\n");
-       fprintf(stderr, "       --with-dlz-filesystem\n");
+       fprintf(stderr, "\t--edns-version\n");
+       fprintf(stderr, "\t--enable-filter-aaaa\n");
+       fprintf(stderr, "\t--gethostname\n");
+       fprintf(stderr, "\t--gssapi\n");
+       fprintf(stderr, "\t--have-aes\n");
+       fprintf(stderr, "\t--have-dlopen\n");
+       fprintf(stderr, "\t--have-geoip2\n");
+       fprintf(stderr, "\t--have-geoip\n");
+       fprintf(stderr, "\t--have-libxml2\n");
+       fprintf(stderr, "\t--ipv6only=no\n");
+       fprintf(stderr, "\t--rpz-nsdname\n");
+       fprintf(stderr, "\t--rpz-nsip\n");
+       fprintf(stderr, "\t--with-dlz-filesystem\n");
+       fprintf(stderr, "\t--with-idn\n");
+       fprintf(stderr, "\t--with-lmdb\n");
 }
 
 int
@@ -61,14 +61,6 @@ main(int argc, char **argv) {
                return (1);
        }
 
-       if (strcmp(argv[1], "--enable-filter-aaaa") == 0) {
-#ifdef ALLOW_FILTER_AAAA
-               return (0);
-#else
-               return (1);
-#endif
-       }
-
        if (strcmp(argv[1], "--edns-version") == 0) {
 #ifdef DNS_EDNS_VERSION
                printf("%d\n", DNS_EDNS_VERSION);
@@ -78,6 +70,14 @@ main(int argc, char **argv) {
                return (0);
        }
 
+       if (strcmp(argv[1], "--enable-filter-aaaa") == 0) {
+#ifdef ALLOW_FILTER_AAAA
+               return (0);
+#else
+               return (1);
+#endif
+       }
+
        if (strcmp(argv[1], "--gethostname") == 0) {
                char hostname[MAXHOSTNAMELEN];
                int n;
@@ -155,9 +155,22 @@ main(int argc, char **argv) {
 #endif
        }
 
-       if (strcmp(argv[1], "--rpz-nsip") == 0) {
-#ifdef ENABLE_RPZ_NSIP
+       if (strcmp(argv[1], "--ipv6only=no") == 0) {
+#ifdef WIN32
                return (0);
+#elif defined(IPPROTO_IPV6) && defined(IPV6_V6ONLY)
+               int s;
+               int n = -1;
+               int v6only = -1;
+               ISC_SOCKADDR_LEN_T len = sizeof(v6only);
+
+               s = socket(AF_INET6, SOCK_DGRAM, IPPROTO_UDP);
+               if (s >= 0) {
+                       n = getsockopt(s, IPPROTO_IPV6, IPV6_V6ONLY,
+                                      (void *)&v6only, &len);
+                       close(s);
+               }
+               return ((n == 0 && v6only == 0) ? 0 : 1);
 #else
                return (1);
 #endif
@@ -171,16 +184,8 @@ main(int argc, char **argv) {
 #endif
        }
 
-       if (strcmp(argv[1], "--with-idn") == 0) {
-#ifdef WITH_LIBIDN2
-               return (0);
-#else
-               return (1);
-#endif
-       }
-
-       if (strcmp(argv[1], "--with-lmdb") == 0) {
-#ifdef HAVE_LMDB
+       if (strcmp(argv[1], "--rpz-nsip") == 0) {
+#ifdef ENABLE_RPZ_NSIP
                return (0);
 #else
                return (1);
@@ -190,38 +195,25 @@ main(int argc, char **argv) {
        if (strcmp(argv[1], "--with-dlz-filesystem") == 0) {
 #ifdef DLZ_FILESYSTEM
                return (0);
-#else
+#else  /* ifdef DLZ_FILESYSTEM */
                return (1);
-#endif
+#endif /* ifdef DLZ_FILESYSTEM */
        }
 
-       if (strcmp(argv[1], "--ipv6only=no") == 0) {
-#ifdef WIN32
+       if (strcmp(argv[1], "--with-idn") == 0) {
+#ifdef HAVE_LIBIDN2
                return (0);
-#elif defined(IPPROTO_IPV6) && defined(IPV6_V6ONLY)
-               int s;
-               int n = -1;
-               int v6only = -1;
-               ISC_SOCKADDR_LEN_T len = sizeof(v6only);
-
-               s = socket(AF_INET6, SOCK_DGRAM, IPPROTO_UDP);
-               if (s >= 0) {
-                       n = getsockopt(s, IPPROTO_IPV6, IPV6_V6ONLY,
-                                      (void *)&v6only, &len);
-                       close(s);
-               }
-               return ((n == 0 && v6only == 0) ? 0 : 1);
-#else
+#else  /* ifdef HAVE_LIBIDN2 */
                return (1);
-#endif
+#endif /* ifdef HAVE_LIBIDN2 */
        }
 
-       if (strcmp(argv[1], "--rpz-log-qtype-qclass") == 0) {
-#ifdef RPZ_LOG_QTYPE_QCLASS
+       if (strcmp(argv[1], "--with-lmdb") == 0) {
+#ifdef HAVE_LMDB
                return (0);
-#else
+#else  /* ifdef HAVE_LMDB */
                return (1);
-#endif
+#endif /* ifdef HAVE_LMDB */
        }
 
        fprintf(stderr, "unknown arg: %s\n", argv[1]);