summaryrefslogtreecommitdiff
path: root/src/regex/test_regex_eval_api.c
diff options
context:
space:
mode:
authorMaximilian Szengel <gnunet@maxsz.de>2012-05-07 11:16:53 +0000
committerMaximilian Szengel <gnunet@maxsz.de>2012-05-07 11:16:53 +0000
commit2e7a6b023989a31954928972150e6ee4d10e06df (patch)
tree119f5c29e308c55e5cd337732f38e156a3cd39fb /src/regex/test_regex_eval_api.c
parent426bcaa9b80ce3507873be65f0da57e6e4d45ae7 (diff)
downloadgnunet-2e7a6b023989a31954928972150e6ee4d10e06df.tar.gz
gnunet-2e7a6b023989a31954928972150e6ee4d10e06df.zip
- State merging fix
- Proof creation WIP
Diffstat (limited to 'src/regex/test_regex_eval_api.c')
-rw-r--r--src/regex/test_regex_eval_api.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/regex/test_regex_eval_api.c b/src/regex/test_regex_eval_api.c
index 371d19ec1..c63e97c11 100644
--- a/src/regex/test_regex_eval_api.c
+++ b/src/regex/test_regex_eval_api.c
@@ -248,7 +248,7 @@ main (int argc, char *argv[])
248 int check_dfa; 248 int check_dfa;
249 int check_rand; 249 int check_rand;
250 250
251 struct Regex_String_Pair rxstr[5] = { 251 struct Regex_String_Pair rxstr[8] = {
252 {"ab?(abcd)?", 5, 252 {"ab?(abcd)?", 5,
253 {"ababcd", "abab", "aabcd", "a", "abb"}, 253 {"ababcd", "abab", "aabcd", "a", "abb"},
254 {match, nomatch, match, match, nomatch}}, 254 {match, nomatch, match, match, nomatch}},
@@ -260,11 +260,20 @@ main (int argc, char *argv[])
260 {"abcdcdcdcdddddabd", "abcd", "abcddddddccccccccccccccccccccccccabdacdabd", 260 {"abcdcdcdcdddddabd", "abcd", "abcddddddccccccccccccccccccccccccabdacdabd",
261 "abccccca", "abcdcdcdccdabdabd"}, 261 "abccccca", "abcdcdcdccdabdabd"},
262 {nomatch, nomatch, nomatch, nomatch, nomatch}}, 262 {nomatch, nomatch, nomatch, nomatch, nomatch}},
263 {"a+X*y+c|p|R|Z*K*y*R+w|Y*6+n+h*k*w+V*F|W*B*e*", 1,
264 {"kaXycQepRZKyRwY6nhkwVFWBegNVtLPj39XhJJ6bEifRSZRYZg"},
265 {nomatch}},
263 {"k|a+X*y+c|Q*e|p|R|Z*K*y*R+w|Y*6+n+h*k*w+V*F|W*B*e*g|N+V|t+L|P*j*3*9+X*h*J|J*6|b|E*i*f*R+S|Z|R|Y*Z|g*", 1, 266 {"k|a+X*y+c|Q*e|p|R|Z*K*y*R+w|Y*6+n+h*k*w+V*F|W*B*e*g|N+V|t+L|P*j*3*9+X*h*J|J*6|b|E*i*f*R+S|Z|R|Y*Z|g*", 1,
264 {"kaXycQepRZKyRwY6nhkwVFWBegNVtLPj39XhJJ6bEifRSZRYZg"}, 267 {"kaXycQepRZKyRwY6nhkwVFWBegNVtLPj39XhJJ6bEifRSZRYZg"},
265 {nomatch}}, 268 {nomatch}},
266 {"F?W+m+2*6*c*s|P?U?a|B|y*i+t+A|V|6*C*7*e?Z*n*i|J?5+g?W*V?7*j?p?1|r?B?C+E+3+6*i+W*P?K?0|D+7?y*m+3?g?K?", 1, 269 {"F?W+m+2*6*c*s|P?U?a|B|y*i+t+A|V|6*C*7*e?Z*n*i|J?5+g?W*V?7*j?p?1|r?B?C+E+3+6*i+W*P?K?0|D+7?y*m+3?g?K?", 1,
267 {"osfjsodfonONONOnosndfsdnfsd"}, 270 {"osfjsodfonONONOnosndfsdnfsd"},
271 {nomatch}},
272 {"V|M*o?x*p*d+h+b|E*m?h?Y*E*O?W*W*P+o?Z+H*M|I*q+C*a+5?5*9|b?z|G*y*k?R|p+u|8*h?B+l*H|e|L*O|1|F?v*0?5|C+", 1,
273 {"VMoxpdhbEmhYEOWWPoZHMIqCa559bzGykRpu8hBlHeLO1Fv05C"},
274 {nomatch}},
275 {"ab(c|d)+c*(a(b|c)d)+", 1,
276 {"abacd"},
268 {nomatch}} 277 {nomatch}}
269 }; 278 };
270 279
@@ -272,7 +281,7 @@ main (int argc, char *argv[])
272 check_dfa = 0; 281 check_dfa = 0;
273 check_rand = 0; 282 check_rand = 0;
274 283
275 for (i = 0; i < 5; i++) 284 for (i = 0; i < 8; i++)
276 { 285 {
277 if (0 != regcomp (&rx, rxstr[i].regex, REG_EXTENDED)) 286 if (0 != regcomp (&rx, rxstr[i].regex, REG_EXTENDED))
278 { 287 {
@@ -295,8 +304,8 @@ main (int argc, char *argv[])
295 } 304 }
296 305
297 srand (time (NULL)); 306 srand (time (NULL));
298 for (i = 0; i < 100; i++) 307 for (i = 0; i < 150; i++)
299 check_rand += test_random (100, 150, 20); 308 check_rand += test_random (150, 200, 25);
300 309
301 return check_nfa + check_dfa + check_rand; 310 return check_nfa + check_dfa + check_rand;
302} 311}