aboutsummaryrefslogtreecommitdiff
path: root/src/util/test_getopt.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2017-03-15 10:16:42 +0100
committerChristian Grothoff <christian@grothoff.org>2017-03-15 11:14:58 +0100
commit164eed8f5171824cf27b318afeab12f8c6ba9262 (patch)
treec84580c2569579cd554bf2f1426010eadaef0f90 /src/util/test_getopt.c
parent30eb0faa8d4894659cc90c76cc634148df86eab9 (diff)
downloadgnunet-164eed8f5171824cf27b318afeab12f8c6ba9262.tar.gz
gnunet-164eed8f5171824cf27b318afeab12f8c6ba9262.zip
fix test case, implement base32 argument parser logic
Diffstat (limited to 'src/util/test_getopt.c')
-rw-r--r--src/util/test_getopt.c30
1 files changed, 22 insertions, 8 deletions
diff --git a/src/util/test_getopt.c b/src/util/test_getopt.c
index 8e578640d..faa6a07a1 100644
--- a/src/util/test_getopt.c
+++ b/src/util/test_getopt.c
@@ -170,21 +170,35 @@ testFlagNum ()
170 unsigned long long lnum = 0; 170 unsigned long long lnum = 0;
171 171
172 const struct GNUNET_GETOPT_CommandLineOption logoptionlist[] = { 172 const struct GNUNET_GETOPT_CommandLineOption logoptionlist[] = {
173 {'f', "--flag", NULL, "helptext", 0, &GNUNET_GETOPT_set_one, 173 GNUNET_GETOPT_OPTION_SET_ONE ('f',
174 (void *) &flag}, 174 "--flag",
175 {'n', "--num", "ARG", "helptext", 1, &GNUNET_GETOPT_set_uint, 175 "helptext",
176 (void *) &num}, 176 &flag),
177 {'N', "--lnum", "ARG", "helptext", 1, &GNUNET_GETOPT_set_ulong, 177 GNUNET_GETOPT_OPTION_SET_UINT ('n',
178 (void *) &lnum}, 178 "--num",
179 "ARG",
180 "helptext",
181 &num),
182 GNUNET_GETOPT_OPTION_SET_ULONG ('N',
183 "--lnum",
184 "ARG",
185 "helptext",
186 &lnum),
179 GNUNET_GETOPT_OPTION_END 187 GNUNET_GETOPT_OPTION_END
180 }; 188 };
181 189
182 if (6 != GNUNET_GETOPT_run ("test_getopt", logoptionlist, 6, myargv)) 190 if (6 !=
191 GNUNET_GETOPT_run ("test_getopt",
192 logoptionlist,
193 6,
194 myargv))
183 { 195 {
184 GNUNET_break (0); 196 GNUNET_break (0);
185 return 1; 197 return 1;
186 } 198 }
187 if ((1 != flag) || (42 != num) || (42 != lnum)) 199 if ( (1 != flag) ||
200 (42 != num) ||
201 (42 != lnum))
188 { 202 {
189 GNUNET_break (0); 203 GNUNET_break (0);
190 return 1; 204 return 1;