diff options
author | Maximilian Szengel <gnunet@maxsz.de> | 2012-06-21 19:03:36 +0000 |
---|---|---|
committer | Maximilian Szengel <gnunet@maxsz.de> | 2012-06-21 19:03:36 +0000 |
commit | cce70bba3782e392b4aaf13d144ddc374cc5b1d0 (patch) | |
tree | e2bb7d06b477c6b14c45973140f2fd455f2baed4 /src/regex/test_regex_eval_api.c | |
parent | fbd971b93aee289f9e9015adee9a3437c38787fb (diff) | |
download | gnunet-cce70bba3782e392b4aaf13d144ddc374cc5b1d0.tar.gz gnunet-cce70bba3782e392b4aaf13d144ddc374cc5b1d0.zip |
Updated testcase to use fewer random regexes.
Diffstat (limited to 'src/regex/test_regex_eval_api.c')
-rw-r--r-- | src/regex/test_regex_eval_api.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/regex/test_regex_eval_api.c b/src/regex/test_regex_eval_api.c index 89a757806..b875f4088 100644 --- a/src/regex/test_regex_eval_api.c +++ b/src/regex/test_regex_eval_api.c | |||
@@ -265,7 +265,7 @@ main (int argc, char *argv[]) | |||
265 | int check_rand; | 265 | int check_rand; |
266 | char *check_proof; | 266 | char *check_proof; |
267 | 267 | ||
268 | struct Regex_String_Pair rxstr[12] = { | 268 | struct Regex_String_Pair rxstr[14] = { |
269 | {"ab?(abcd)?", 5, | 269 | {"ab?(abcd)?", 5, |
270 | {"ababcd", "abab", "aabcd", "a", "abb"}, | 270 | {"ababcd", "abab", "aabcd", "a", "abb"}, |
271 | {match, nomatch, match, match, nomatch}}, | 271 | {match, nomatch, match, match, nomatch}}, |
@@ -302,6 +302,12 @@ main (int argc, char *argv[]) | |||
302 | {"ab(c|d)+c*(a(b|c)+d)+(bla)+", 1, | 302 | {"ab(c|d)+c*(a(b|c)+d)+(bla)+", 1, |
303 | {"abcabdblaacdbla"}, | 303 | {"abcabdblaacdbla"}, |
304 | {nomatch}}, | 304 | {nomatch}}, |
305 | {"(ac|b)+", 8, | ||
306 | {"b", "bb", "ac", "", "acb", "bacbacac", "acacac", "abc"}, | ||
307 | {match, match, match, nomatch, match, match, match, nomatch}}, | ||
308 | {"(ab|c)+", 7, | ||
309 | {"", "ab", "c", "abc", "ababcc", "acc", "abac"}, | ||
310 | {nomatch, match, match, match, match, nomatch, nomatch}}, | ||
305 | {"ab(c|d)+c*(a(b|c)d)+", 1, | 311 | {"ab(c|d)+c*(a(b|c)d)+", 1, |
306 | {"abacd"}, | 312 | {"abacd"}, |
307 | {nomatch}} | 313 | {nomatch}} |
@@ -311,7 +317,7 @@ main (int argc, char *argv[]) | |||
311 | check_dfa = 0; | 317 | check_dfa = 0; |
312 | check_rand = 0; | 318 | check_rand = 0; |
313 | 319 | ||
314 | for (i = 0; i < 12; i++) | 320 | for (i = 0; i < 14; i++) |
315 | { | 321 | { |
316 | if (0 != regcomp (&rx, rxstr[i].regex, REG_EXTENDED)) | 322 | if (0 != regcomp (&rx, rxstr[i].regex, REG_EXTENDED)) |
317 | { | 323 | { |
@@ -341,8 +347,8 @@ main (int argc, char *argv[]) | |||
341 | } | 347 | } |
342 | 348 | ||
343 | srand (time (NULL)); | 349 | srand (time (NULL)); |
344 | for (i = 0; i < 150; i++) | 350 | for (i = 0; i < 50; i++) |
345 | check_rand += test_random (150, 200, 25); | 351 | check_rand += test_random (100, 120, 20); |
346 | 352 | ||
347 | return check_nfa + check_dfa + check_rand; | 353 | return check_nfa + check_dfa + check_rand; |
348 | } | 354 | } |