WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Affero General Public License for more details.
-
+
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-*/
+
+ SPDX-License-Identifier: AGPL3.0-or-later
+ */
/**
* @file regex/test_regex_iterate_api.c
* @brief test for regex.c
static void
key_iterator (void *cls, const struct GNUNET_HashCode *key,
- const char *proof,
+ const char *proof,
int accepting, unsigned int num_edges,
const struct REGEX_BLOCK_Edge *edges)
{
error = 0;
const struct RegexStringPair rxstr[13] = {
- {INITIAL_PADDING "ab(c|d)+c*(a(b|c)+d)+(bla)+", 2,
- {INITIAL_PADDING "abcdcdca", INITIAL_PADDING "abcabdbl"}},
- {INITIAL_PADDING
- "abcdefghixxxxxxxxxxxxxjklmnop*qstoisdjfguisdfguihsdfgbdsuivggsd", 1,
- {INITIAL_PADDING "abcdefgh"}},
- {INITIAL_PADDING "VPN-4-1(0|1)*", 2,
- {INITIAL_PADDING "VPN-4-10", INITIAL_PADDING "VPN-4-11"}},
- {INITIAL_PADDING "(a+X*y+c|p|R|Z*K*y*R+w|Y*6+n+h*k*w+V*F|W*B*e*)", 2,
- {INITIAL_PADDING "aaaaaaaa", INITIAL_PADDING "aaXXyyyc"}},
- {INITIAL_PADDING "a*", 1, {INITIAL_PADDING "aaaaaaaa"}},
- {INITIAL_PADDING "xzxzxzxzxz", 1, {INITIAL_PADDING "xzxzxzxz"}},
- {INITIAL_PADDING "xyz*", 1, {INITIAL_PADDING "xyzzzzzz"}},
- {INITIAL_PADDING
- "abcd:(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1):(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)",
- 2, {INITIAL_PADDING "abcd:000", INITIAL_PADDING "abcd:101"}},
- {INITIAL_PADDING "(x*|(0|1|2)(a|b|c|d)+)", 2,
- {INITIAL_PADDING "xxxxxxxx", INITIAL_PADDING "0abcdbad"}},
- {INITIAL_PADDING "(0|1)(0|1)23456789ABC", 1, {INITIAL_PADDING "11234567"}},
- {INITIAL_PADDING "0*123456789ABC*", 3,
- {INITIAL_PADDING "00123456", INITIAL_PADDING "00000000",
- INITIAL_PADDING "12345678"}},
- {INITIAL_PADDING "0123456789A*BC", 1, {INITIAL_PADDING "01234567"}},
- {"GNUNETVPN000100000IPEX6-fc5a:4e1:c2ba::1", 1, {"GNUNETVPN000100000IPEX6-"}}
+ { INITIAL_PADDING "ab(c|d)+c*(a(b|c)+d)+(bla)+", 2,
+ { INITIAL_PADDING "abcdcdca", INITIAL_PADDING "abcabdbl" } },
+ { INITIAL_PADDING
+ "abcdefghixxxxxxxxxxxxxjklmnop*qstoisdjfguisdfguihsdfgbdsuivggsd", 1,
+ { INITIAL_PADDING "abcdefgh" } },
+ { INITIAL_PADDING "VPN-4-1(0|1)*", 2,
+ { INITIAL_PADDING "VPN-4-10", INITIAL_PADDING "VPN-4-11" } },
+ { INITIAL_PADDING "(a+X*y+c|p|R|Z*K*y*R+w|Y*6+n+h*k*w+V*F|W*B*e*)", 2,
+ { INITIAL_PADDING "aaaaaaaa", INITIAL_PADDING "aaXXyyyc" } },
+ { INITIAL_PADDING "a*", 1, { INITIAL_PADDING "aaaaaaaa" } },
+ { INITIAL_PADDING "xzxzxzxzxz", 1, { INITIAL_PADDING "xzxzxzxz" } },
+ { INITIAL_PADDING "xyz*", 1, { INITIAL_PADDING "xyzzzzzz" } },
+ { INITIAL_PADDING
+ "abcd:(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1):(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)(0|1)",
+ 2, { INITIAL_PADDING "abcd:000", INITIAL_PADDING "abcd:101" } },
+ { INITIAL_PADDING "(x*|(0|1|2)(a|b|c|d)+)", 2,
+ { INITIAL_PADDING "xxxxxxxx", INITIAL_PADDING "0abcdbad" } },
+ { INITIAL_PADDING "(0|1)(0|1)23456789ABC", 1,
+ { INITIAL_PADDING "11234567" } },
+ { INITIAL_PADDING "0*123456789ABC*", 3,
+ { INITIAL_PADDING "00123456", INITIAL_PADDING "00000000",
+ INITIAL_PADDING "12345678" } },
+ { INITIAL_PADDING "0123456789A*BC", 1, { INITIAL_PADDING "01234567" } },
+ { "GNUNETVPN000100000IPEX6-fc5a:4e1:c2ba::1", 1,
+ { "GNUNETVPN000100000IPEX6-" } }
};
const char *graph_start_str = "digraph G {\nrankdir=LR\n";
ctx.strings = rxstr[i].strings;
ctx.match_count = 0;
dfa =
- REGEX_INTERNAL_construct_dfa (rxstr[i].regex, strlen (rxstr[i].regex), 0);
+ REGEX_INTERNAL_construct_dfa (rxstr[i].regex, strlen (rxstr[i].regex), 0);
REGEX_INTERNAL_iterate_all_edges (dfa, key_iterator, &ctx);
num_transitions =
- REGEX_INTERNAL_get_transition_count (dfa) - dfa->start->transition_count;
+ REGEX_INTERNAL_get_transition_count (dfa) - dfa->start->transition_count;
if (transition_counter < num_transitions)
{
ctx.match_count = 0;
dfa =
- REGEX_INTERNAL_construct_dfa (rxstr[i].regex, strlen (rxstr[i].regex), 0);
+ REGEX_INTERNAL_construct_dfa (rxstr[i].regex, strlen (rxstr[i].regex), 0);
REGEX_INTERNAL_dfa_add_multi_strides (NULL, dfa, 2);
REGEX_INTERNAL_iterate_all_edges (dfa, key_iterator, &ctx);