Added multi-striding capabilities to regex.
[oweals/gnunet.git] / src / regex / test_regex_iterate_api.c
index 246ae77670478b4addabfcaf071278773b235dc2..96f1087e7cbdd32aa6b9897a873cff7528a4041c 100644 (file)
@@ -37,15 +37,20 @@ key_iterator (void *cls, const struct GNUNET_HashCode *key, const char *proof,
 
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Iterating... (accepting: %i)\n",
               accepting);
+
+  if (NULL != proof)
+    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Proof: %s\n", proof);
+
+  if (NULL != key)
+    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Hash: %s\n", GNUNET_h2s (key));
+
   for (i = 0; i < num_edges; i++)
   {
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Edge %i: %s\n", i, edges[i].label);
+    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Edge %i: Label: %s Destination: %s\n",
+                i, edges[i].label, GNUNET_h2s (&edges[i].destination));
   }
 
   *error += (GNUNET_OK == GNUNET_REGEX_check_proof (proof, key)) ? 0 : 1;
-
-  if (NULL != proof)
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Proof: %s\n", proof);
 }
 
 int
@@ -82,7 +87,7 @@ main (int argc, char *argv[])
     "ab|cd|ef|gh",
     "a|b|c|d|e|f|g",
     "(ab)|(ac)",
-    "a(b|c)"
+    "x*|(0|1|2)(a|b|c|d)"
   };
 
   for (i = 0; i < 17; i++)
@@ -91,6 +96,6 @@ main (int argc, char *argv[])
     GNUNET_REGEX_iterate_all_edges (dfa, key_iterator, &error);
     GNUNET_REGEX_automaton_destroy (dfa);
   }
-  
+
   return error;
 }