- add 2s for new state, reduce buffer
[oweals/gnunet.git] / src / tun / test_regex.c
index 341d8b9a09d4e5441684584bad102d6330a26b5f..21a2eed1e33e64824f2b4fd21175bbf73a3e5fc0 100644 (file)
@@ -121,12 +121,17 @@ test_policy6toregex (const char *policy,
 int
 main (int argc, char *argv[])
 {
-  GNUNET_log_setup ("test-regex", "WARNING", NULL);
-
   int error;
+  char *r;
 
+  GNUNET_log_setup ("test-regex", "WARNING", NULL);
   error = 0;
 
+  /* this is just a performance test ... */
+  r = GNUNET_TUN_ipv4policy2regex ("1.2.3.4/16:!25;");
+  GNUNET_break (NULL != r);
+  GNUNET_free (r);
+
   error +=
     test_iptoregex ("192.1.2.3", 2086,
                     "4-0826-C0010203",
@@ -148,7 +153,10 @@ main (int argc, char *argv[])
                          "4-(0050|0051)-C001....");
   error +=
     test_policy4toregex ("192.1.0.0/8:!3-65535;",
-                         "4-(0001|0002)-C0......");
+                         "4-000(0|1|2)-C0......");
+  error +=
+    test_policy4toregex ("192.1.0.0/8:!25-56;",
+                         "4-(0(0(0.|1(0|1|2|3|4|5|6|7|8)|3(9|A|B|C|D|E|F)|(4|5|6|7|8|9|A|B|C|D|E|F).)|(1|2|3|4|5|6|7|8|9|A|B|C|D|E|F)..)|(1|2|3|4|5|6|7|8|9|A|B|C|D|E|F)...)-C0......");
   error +=
     test_policy6toregex ("E1E1::1;",
                          "6-....-E1E10000000000000000000000000001");