projects
/
oweals
/
gnunet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
-fixing
[oweals/gnunet.git]
/
src
/
util
/
test_getopt.c
diff --git
a/src/util/test_getopt.c
b/src/util/test_getopt.c
index f830454cd4f5f1bd96ffb09acf9f8f35d4996451..65c3b5d2ee99bff5380cfc086c848bc321cd36d7 100644
(file)
--- 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"
#include "gnunet_configuration_lib.h"
#include "gnunet_getopt_lib.h"
-#define VERBOSE 0
static int
testMinimal ()
static int
testMinimal ()
@@
-45,6
+44,7
@@
testMinimal ()
return 0;
}
return 0;
}
+
static int
testVerbose ()
{
static int
testVerbose ()
{
@@
-63,18
+63,19
@@
testVerbose ()
};
if (3 != GNUNET_GETOPT_run ("test", verboseoptionlist, 4, myargv))
};
if (3 != GNUNET_GETOPT_run ("test", verboseoptionlist, 4, myargv))
-
{
-
GNUNET_break (0);
-
return 1;
-
}
+ {
+ GNUNET_break (0);
+ return 1;
+ }
if (vflags != 2)
if (vflags != 2)
-
{
-
GNUNET_break (0);
-
return 1;
-
}
+ {
+ GNUNET_break (0);
+ return 1;
+ }
return 0;
}
return 0;
}
+
static int
testVersion ()
{
static int
testVersion ()
{
@@
-88,14
+89,15
@@
testVersion ()
GNUNET_GETOPT_OPTION_END
};
GNUNET_GETOPT_OPTION_END
};
- if (
-1
!= GNUNET_GETOPT_run ("test_getopt", versionoptionlist, 2, myargv))
-
{
-
GNUNET_break (0);
-
return 1;
-
}
+ if (
0
!= GNUNET_GETOPT_run ("test_getopt", versionoptionlist, 2, myargv))
+ {
+ GNUNET_break (0);
+ return 1;
+ }
return 0;
}
return 0;
}
+
static int
testAbout ()
{
static int
testAbout ()
{
@@
-109,14
+111,15
@@
testAbout ()
GNUNET_GETOPT_OPTION_END
};
GNUNET_GETOPT_OPTION_END
};
- if (
-1
!= GNUNET_GETOPT_run ("test_getopt", aboutoptionlist, 2, myargv))
-
{
-
GNUNET_break (0);
-
return 1;
-
}
+ if (
0
!= GNUNET_GETOPT_run ("test_getopt", aboutoptionlist, 2, myargv))
+ {
+ GNUNET_break (0);
+ return 1;
+ }
return 0;
}
return 0;
}
+
static int
testLogOpts ()
{
static int
testLogOpts ()
{
@@
-136,23
+139,24
@@
testLogOpts ()
};
if (5 != GNUNET_GETOPT_run ("test_getopt", logoptionlist, 5, myargv))
};
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_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;
}
GNUNET_free (level);
GNUNET_free (fn);
return 0;
}
+
static int
testFlagNum ()
{
static int
testFlagNum ()
{
@@
-178,18
+182,19
@@
testFlagNum ()
};
if (6 != GNUNET_GETOPT_run ("test_getopt", logoptionlist, 6, myargv))
};
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))
if ((1 != flag) || (42 != num) || (42 != lnum))
-
{
-
GNUNET_break (0);
-
return 1;
-
}
+ {
+ GNUNET_break (0);
+ return 1;
+ }
return 0;
}
return 0;
}
+
int
main (int argc, char *argv[])
{
int
main (int argc, char *argv[])
{