aboutsummaryrefslogtreecommitdiff
path: root/src/regex/test_regex_iterate_api.c
diff options
context:
space:
mode:
authorMaximilian Szengel <gnunet@maxsz.de>2012-07-09 15:18:12 +0000
committerMaximilian Szengel <gnunet@maxsz.de>2012-07-09 15:18:12 +0000
commit4c888f99b9c42fae1e5bd419a7c3ce5416b89152 (patch)
tree68dc06f730b5a8550aa9006feb86a8b9a84048b7 /src/regex/test_regex_iterate_api.c
parent244cfa6605ff9807ffead349e937be3f327257ee (diff)
downloadgnunet-4c888f99b9c42fae1e5bd419a7c3ce5416b89152.tar.gz
gnunet-4c888f99b9c42fae1e5bd419a7c3ce5416b89152.zip
regex: fixed iterating over the initial states
Diffstat (limited to 'src/regex/test_regex_iterate_api.c')
-rw-r--r--src/regex/test_regex_iterate_api.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/regex/test_regex_iterate_api.c b/src/regex/test_regex_iterate_api.c
index 246ae7767..96f1087e7 100644
--- a/src/regex/test_regex_iterate_api.c
+++ b/src/regex/test_regex_iterate_api.c
@@ -37,15 +37,20 @@ key_iterator (void *cls, const struct GNUNET_HashCode *key, const char *proof,
37 37
38 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Iterating... (accepting: %i)\n", 38 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Iterating... (accepting: %i)\n",
39 accepting); 39 accepting);
40
41 if (NULL != proof)
42 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Proof: %s\n", proof);
43
44 if (NULL != key)
45 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Hash: %s\n", GNUNET_h2s (key));
46
40 for (i = 0; i < num_edges; i++) 47 for (i = 0; i < num_edges; i++)
41 { 48 {
42 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Edge %i: %s\n", i, edges[i].label); 49 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Edge %i: Label: %s Destination: %s\n",
50 i, edges[i].label, GNUNET_h2s (&edges[i].destination));
43 } 51 }
44 52
45 *error += (GNUNET_OK == GNUNET_REGEX_check_proof (proof, key)) ? 0 : 1; 53 *error += (GNUNET_OK == GNUNET_REGEX_check_proof (proof, key)) ? 0 : 1;
46
47 if (NULL != proof)
48 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Proof: %s\n", proof);
49} 54}
50 55
51int 56int
@@ -82,7 +87,7 @@ main (int argc, char *argv[])
82 "ab|cd|ef|gh", 87 "ab|cd|ef|gh",
83 "a|b|c|d|e|f|g", 88 "a|b|c|d|e|f|g",
84 "(ab)|(ac)", 89 "(ab)|(ac)",
85 "a(b|c)" 90 "x*|(0|1|2)(a|b|c|d)"
86 }; 91 };
87 92
88 for (i = 0; i < 17; i++) 93 for (i = 0; i < 17; i++)
@@ -91,6 +96,6 @@ main (int argc, char *argv[])
91 GNUNET_REGEX_iterate_all_edges (dfa, key_iterator, &error); 96 GNUNET_REGEX_iterate_all_edges (dfa, key_iterator, &error);
92 GNUNET_REGEX_automaton_destroy (dfa); 97 GNUNET_REGEX_automaton_destroy (dfa);
93 } 98 }
94 99
95 return error; 100 return error;
96} 101}