aboutsummaryrefslogtreecommitdiff
path: root/src/regex
diff options
context:
space:
mode:
authorMaximilian Szengel <gnunet@maxsz.de>2012-09-27 14:11:42 +0000
committerMaximilian Szengel <gnunet@maxsz.de>2012-09-27 14:11:42 +0000
commitefaee22e6bc145305a6f8104c68914cfa07b1ac3 (patch)
tree127828caf63c032dcb6b76f0a0541db632aaec51 /src/regex
parentbb325e4a419aa2ec5ddff34b45a49dcaaa53d0ab (diff)
downloadgnunet-efaee22e6bc145305a6f8104c68914cfa07b1ac3.tar.gz
gnunet-efaee22e6bc145305a6f8104c68914cfa07b1ac3.zip
tests
Diffstat (limited to 'src/regex')
-rw-r--r--src/regex/test_regex_eval_api.c8
-rw-r--r--src/regex/test_regex_graph_api.c8
-rw-r--r--src/regex/test_regex_iptoregex.c24
-rw-r--r--src/regex/test_regex_iterate_api.c8
-rw-r--r--src/regex/test_regex_proofs.c8
5 files changed, 18 insertions, 38 deletions
diff --git a/src/regex/test_regex_eval_api.c b/src/regex/test_regex_eval_api.c
index 98d354bdb..593c29dcb 100644
--- a/src/regex/test_regex_eval_api.c
+++ b/src/regex/test_regex_eval_api.c
@@ -242,13 +242,7 @@ test_automaton (struct GNUNET_REGEX_Automaton *a, regex_t * rx,
242int 242int
243main (int argc, char *argv[]) 243main (int argc, char *argv[])
244{ 244{
245 GNUNET_log_setup ("test-regex", 245 GNUNET_log_setup ("test-regex", "WARNING", NULL);
246#if VERBOSE
247 "DEBUG",
248#else
249 "WARNING",
250#endif
251 NULL);
252 246
253 struct GNUNET_REGEX_Automaton *a; 247 struct GNUNET_REGEX_Automaton *a;
254 regex_t rx; 248 regex_t rx;
diff --git a/src/regex/test_regex_graph_api.c b/src/regex/test_regex_graph_api.c
index b20a6d07f..ea1c7fb78 100644
--- a/src/regex/test_regex_graph_api.c
+++ b/src/regex/test_regex_graph_api.c
@@ -77,13 +77,7 @@ filecheck (const char *filename)
77int 77int
78main (int argc, char *argv[]) 78main (int argc, char *argv[])
79{ 79{
80 GNUNET_log_setup ("test-regex", 80 GNUNET_log_setup ("test-regex", "WARNING", NULL);
81#if VERBOSE
82 "DEBUG",
83#else
84 "WARNING",
85#endif
86 NULL);
87 81
88 int error; 82 int error;
89 struct GNUNET_REGEX_Automaton *a; 83 struct GNUNET_REGEX_Automaton *a;
diff --git a/src/regex/test_regex_iptoregex.c b/src/regex/test_regex_iptoregex.c
index 7fe1c384f..004d79041 100644
--- a/src/regex/test_regex_iptoregex.c
+++ b/src/regex/test_regex_iptoregex.c
@@ -65,13 +65,7 @@ test_iptoregex (const char *ipv4, const char *netmask, const char *expectedv4,
65int 65int
66main (int argc, char *argv[]) 66main (int argc, char *argv[])
67{ 67{
68 GNUNET_log_setup ("test-regex", 68 GNUNET_log_setup ("test-regex", "WARNING", NULL);
69#if VERBOSE
70 "DEBUG",
71#else
72 "WARNING",
73#endif
74 NULL);
75 69
76 int error; 70 int error;
77 71
@@ -83,16 +77,26 @@ main (int argc, char *argv[])
83 "1111111111111111(0|1)+"); 77 "1111111111111111(0|1)+");
84 78
85 error += 79 error +=
80 test_iptoregex ("187.238.225.0", "255.255.255.128",
81 "1011101111101110111000010(0|1)+", "E1E1:73F9:51BE::0", 49,
82 "1110000111100001011100111111100101010001101111100(0|1)+");
83
84 error +=
86 test_iptoregex ("255.255.255.255", "255.255.255.255", 85 test_iptoregex ("255.255.255.255", "255.255.255.255",
87 "11111111111111111111111111111111", 86 "11111111111111111111111111111111",
88 "FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF", 128, 87 "FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF", 128,
89 "11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111"); 88 "11111111111111111111111111111111"
89 "11111111111111111111111111111111"
90 "11111111111111111111111111111111"
91 "11111111111111111111111111111111");
90 92
91 error += 93 error +=
92 test_iptoregex ("0.0.0.0", "255.255.255.255", 94 test_iptoregex ("0.0.0.0", "255.255.255.255",
93 "00000000000000000000000000000000", "0::0", 128, 95 "00000000000000000000000000000000", "0::0", 128,
94 "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"); 96 "00000000000000000000000000000000"
95 97 "00000000000000000000000000000000"
98 "00000000000000000000000000000000"
99 "00000000000000000000000000000000");
96 100
97 return error; 101 return error;
98} 102}
diff --git a/src/regex/test_regex_iterate_api.c b/src/regex/test_regex_iterate_api.c
index 37475ee91..8dce07615 100644
--- a/src/regex/test_regex_iterate_api.c
+++ b/src/regex/test_regex_iterate_api.c
@@ -104,13 +104,7 @@ key_iterator (void *cls, const struct GNUNET_HashCode *key, const char *proof,
104int 104int
105main (int argc, char *argv[]) 105main (int argc, char *argv[])
106{ 106{
107 GNUNET_log_setup ("test-regex", 107 GNUNET_log_setup ("test-regex", "WARNING", NULL);
108#if VERBOSE
109 "DEBUG",
110#else
111 "WARNING",
112#endif
113 NULL);
114 108
115 int error; 109 int error;
116 struct GNUNET_REGEX_Automaton *dfa; 110 struct GNUNET_REGEX_Automaton *dfa;
diff --git a/src/regex/test_regex_proofs.c b/src/regex/test_regex_proofs.c
index 8ba0e142f..8ccbe00ad 100644
--- a/src/regex/test_regex_proofs.c
+++ b/src/regex/test_regex_proofs.c
@@ -152,13 +152,7 @@ test_proofs_static (void)
152int 152int
153main (int argc, char *argv[]) 153main (int argc, char *argv[])
154{ 154{
155 GNUNET_log_setup ("test-regex", 155 GNUNET_log_setup ("test-regex", "WARNING", NULL);
156#if VERBOSE
157 "DEBUG",
158#else
159 "WARNING",
160#endif
161 NULL);
162 156
163 int error; 157 int error;
164 158