aboutsummaryrefslogtreecommitdiff
path: root/src/regex/test_regex_proofs.c
diff options
context:
space:
mode:
authorMaximilian Szengel <gnunet@maxsz.de>2012-06-26 13:52:08 +0000
committerMaximilian Szengel <gnunet@maxsz.de>2012-06-26 13:52:08 +0000
commitd6871d5ea20b9cd746431f4cefcc78740e246a99 (patch)
treeda33ba19c9b8b8cdd46556ccddd2b168305437d4 /src/regex/test_regex_proofs.c
parent3a3e4c0f1b588f687ff98fcee4952fa02e97dfb2 (diff)
downloadgnunet-d6871d5ea20b9cd746431f4cefcc78740e246a99.tar.gz
gnunet-d6871d5ea20b9cd746431f4cefcc78740e246a99.zip
doxygen fixes
Diffstat (limited to 'src/regex/test_regex_proofs.c')
-rw-r--r--src/regex/test_regex_proofs.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/regex/test_regex_proofs.c b/src/regex/test_regex_proofs.c
index 47cc4ee5b..5d0aabd00 100644
--- a/src/regex/test_regex_proofs.c
+++ b/src/regex/test_regex_proofs.c
@@ -40,6 +40,7 @@ main (int argc, char *argv[])
40 40
41 int error; 41 int error;
42 int i; 42 int i;
43
43 const char *regex[21] = { 44 const char *regex[21] = {
44 "ab(c|d)+c*(a(b|c)+d)+(bla)+", 45 "ab(c|d)+c*(a(b|c)+d)+(bla)+",
45 "(bla)*", 46 "(bla)*",
@@ -63,7 +64,7 @@ main (int argc, char *argv[])
63 "(ab|cs|df|sdf)*", 64 "(ab|cs|df|sdf)*",
64 "a|aa*a" 65 "a|aa*a"
65 }; 66 };
66 char *computed_regex; 67 char *canonical_regex;
67 struct GNUNET_REGEX_Automaton *dfa; 68 struct GNUNET_REGEX_Automaton *dfa;
68 69
69 error = 0; 70 error = 0;
@@ -71,14 +72,18 @@ main (int argc, char *argv[])
71 for (i = 0; i < 21; i++) 72 for (i = 0; i < 21; i++)
72 { 73 {
73 dfa = GNUNET_REGEX_construct_dfa (regex[i], strlen (regex[i])); 74 dfa = GNUNET_REGEX_construct_dfa (regex[i], strlen (regex[i]));
74 computed_regex = GNUNET_strdup (GNUNET_REGEX_get_computed_regex (dfa)); 75 canonical_regex = GNUNET_strdup (GNUNET_REGEX_get_canonical_regex (dfa));
75 GNUNET_REGEX_automaton_destroy (dfa); 76 GNUNET_REGEX_automaton_destroy (dfa);
76 77
77 dfa = GNUNET_REGEX_construct_dfa (computed_regex, strlen (computed_regex)); 78 dfa =
78 error += (0 == strcmp (computed_regex, GNUNET_REGEX_get_computed_regex (dfa))) ? 0 : 1; 79 GNUNET_REGEX_construct_dfa (canonical_regex, strlen (canonical_regex));
79 GNUNET_free (computed_regex); 80 error +=
81 (0 ==
82 strcmp (canonical_regex,
83 GNUNET_REGEX_get_canonical_regex (dfa))) ? 0 : 1;
84 GNUNET_free (canonical_regex);
80 GNUNET_REGEX_automaton_destroy (dfa); 85 GNUNET_REGEX_automaton_destroy (dfa);
81 } 86 }
82 87
83 return error; 88 return error;
84} 89}