aboutsummaryrefslogtreecommitdiff
path: root/src/util/test_getopt.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2017-03-15 11:14:36 +0100
committerChristian Grothoff <christian@grothoff.org>2017-03-15 11:14:59 +0100
commitf09c53eb6f8c540cc3bc3730f9e34be596ed3716 (patch)
tree524957bd395bfca32e006163d44601936bf2afda /src/util/test_getopt.c
parentdc0d60c9c8a635221c0d656611f8f93e0256ed84 (diff)
downloadgnunet-f09c53eb6f8c540cc3bc3730f9e34be596ed3716.tar.gz
gnunet-f09c53eb6f8c540cc3bc3730f9e34be596ed3716.zip
add way to mark options as mandatory, get tests to pass again
Diffstat (limited to 'src/util/test_getopt.c')
-rw-r--r--src/util/test_getopt.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/util/test_getopt.c b/src/util/test_getopt.c
index faa6a07a1..13cedd7f5 100644
--- a/src/util/test_getopt.c
+++ b/src/util/test_getopt.c
@@ -136,13 +136,16 @@ testLogOpts ()
136 GNUNET_GETOPT_OPTION_END 136 GNUNET_GETOPT_OPTION_END
137 }; 137 };
138 138
139 if (5 != GNUNET_GETOPT_run ("test_getopt", logoptionlist, 5, myargv)) 139 if (5 != GNUNET_GETOPT_run ("test_getopt",
140 logoptionlist,
141 5, myargv))
140 { 142 {
141 GNUNET_break (0); 143 GNUNET_break (0);
142 return 1; 144 return 1;
143 } 145 }
144 GNUNET_assert (fn != NULL); 146 GNUNET_assert (NULL != fn);
145 if ((0 != strcmp (level, "WARNING")) || (0 != strcmp (fn, "filename"))) 147 if ( (0 != strcmp (level, "WARNING")) ||
148 (NULL == strstr (fn, "/filename")) )
146 { 149 {
147 GNUNET_break (0); 150 GNUNET_break (0);
148 GNUNET_free (level); 151 GNUNET_free (level);
@@ -212,7 +215,9 @@ main (int argc, char *argv[])
212{ 215{
213 int errCnt = 0; 216 int errCnt = 0;
214 217
215 GNUNET_log_setup ("test_getopt", "WARNING", NULL); 218 GNUNET_log_setup ("test_getopt",
219 "WARNING",
220 NULL);
216 /* suppress output from -h, -v options */ 221 /* suppress output from -h, -v options */
217#ifndef MINGW 222#ifndef MINGW
218 GNUNET_break (0 == CLOSE (1)); 223 GNUNET_break (0 == CLOSE (1));