X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Futil%2Ftest_getopt.c;h=f068a6ab0403fe1cfc5897e381102914aa1c1a6c;hb=f501080b97356351732aee8302de888e89a1b502;hp=f830454cd4f5f1bd96ffb09acf9f8f35d4996451;hpb=d9d94d0e53d26af75ec8241383d166544ebd79f3;p=oweals%2Fgnunet.git diff --git a/src/util/test_getopt.c b/src/util/test_getopt.c index f830454cd..f068a6ab0 100644 --- a/src/util/test_getopt.c +++ b/src/util/test_getopt.c @@ -26,7 +26,6 @@ #include "gnunet_configuration_lib.h" #include "gnunet_getopt_lib.h" -#define VERBOSE 0 static int testMinimal () @@ -45,6 +44,7 @@ testMinimal () return 0; } + static int testVerbose () { @@ -63,18 +63,19 @@ testVerbose () }; if (3 != GNUNET_GETOPT_run ("test", verboseoptionlist, 4, myargv)) - { - GNUNET_break (0); - return 1; - } + { + GNUNET_break (0); + return 1; + } if (vflags != 2) - { - GNUNET_break (0); - return 1; - } + { + GNUNET_break (0); + return 1; + } return 0; } + static int testVersion () { @@ -89,13 +90,14 @@ testVersion () }; if (-1 != GNUNET_GETOPT_run ("test_getopt", versionoptionlist, 2, myargv)) - { - GNUNET_break (0); - return 1; - } + { + GNUNET_break (0); + return 1; + } return 0; } + static int testAbout () { @@ -110,13 +112,14 @@ testAbout () }; if (-1 != GNUNET_GETOPT_run ("test_getopt", aboutoptionlist, 2, myargv)) - { - GNUNET_break (0); - return 1; - } + { + GNUNET_break (0); + return 1; + } return 0; } + static int testLogOpts () { @@ -136,23 +139,24 @@ testLogOpts () }; if (5 != GNUNET_GETOPT_run ("test_getopt", logoptionlist, 5, myargv)) - { - GNUNET_break (0); - return 1; - } + { + GNUNET_break (0); + return 1; + } GNUNET_assert (fn != NULL); if ((0 != strcmp (level, "WARNING")) || (0 != strcmp (fn, "filename"))) - { - GNUNET_break (0); - GNUNET_free (level); - GNUNET_free (fn); - return 1; - } + { + GNUNET_break (0); + GNUNET_free (level); + GNUNET_free (fn); + return 1; + } GNUNET_free (level); GNUNET_free (fn); return 0; } + static int testFlagNum () { @@ -178,18 +182,19 @@ testFlagNum () }; if (6 != GNUNET_GETOPT_run ("test_getopt", logoptionlist, 6, myargv)) - { - GNUNET_break (0); - return 1; - } + { + GNUNET_break (0); + return 1; + } if ((1 != flag) || (42 != num) || (42 != lnum)) - { - GNUNET_break (0); - return 1; - } + { + GNUNET_break (0); + return 1; + } return 0; } + int main (int argc, char *argv[]) {