projects
/
oweals
/
gnunet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge remote-tracking branch 'origin/master' into credentials
[oweals/gnunet.git]
/
src
/
regex
/
test_regex_proofs.c
diff --git
a/src/regex/test_regex_proofs.c
b/src/regex/test_regex_proofs.c
index 92a3a411fc8225d9194c2aa7b7b223d024718003..5458e46ec014c8a4c8f837394f5063a47ca53894 100644
(file)
--- a/
src/regex/test_regex_proofs.c
+++ b/
src/regex/test_regex_proofs.c
@@
-1,6
+1,6
@@
/*
This file is part of GNUnet
/*
This file is part of GNUnet
- (C) 2012 Christian Grothoff (and other contributing authors)
+ Copyright (C) 2012 GNUnet e.V.
GNUnet is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
GNUnet is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
@@
-14,8
+14,8
@@
You should have received a copy of the GNU General Public License
along with GNUnet; see the file COPYING. If not, write to the
You should have received a copy of the GNU General Public License
along with GNUnet; see the file COPYING. If not, write to the
- Free Software Foundation, Inc., 5
9 Temple Place - Suite 330
,
- Boston, MA 0211
1-1307
, USA.
+ Free Software Foundation, Inc., 5
1 Franklin Street, Fifth Floor
,
+ Boston, MA 0211
0-1301
, USA.
*/
/**
* @file regex/test_regex_proofs.c
*/
/**
* @file regex/test_regex_proofs.c
@@
-23,7
+23,8
@@
* @author Maximilian Szengel
*/
#include "platform.h"
* @author Maximilian Szengel
*/
#include "platform.h"
-#include "gnunet_regex_lib.h"
+#include "regex_internal_lib.h"
+#include "regex_test_lib.h"
#include "regex_internal.h"
#include "regex_internal.h"
@@
-42,17
+43,17
@@
static unsigned int
test_proof (const char *regex)
{
unsigned int error;
test_proof (const char *regex)
{
unsigned int error;
- struct
GNUNET_REGEX
_Automaton *dfa;
+ struct
REGEX_INTERNAL
_Automaton *dfa;
char *c_rx1;
const char *c_rx2;
char *c_rx1;
const char *c_rx2;
- dfa =
GNUNET_REGEX
_construct_dfa (regex, strlen (regex), 1);
+ dfa =
REGEX_INTERNAL
_construct_dfa (regex, strlen (regex), 1);
GNUNET_assert (NULL != dfa);
GNUNET_assert (NULL != dfa);
- c_rx1 = GNUNET_strdup (
GNUNET_REGEX
_get_canonical_regex (dfa));
-
GNUNET_REGEX
_automaton_destroy (dfa);
- dfa =
GNUNET_REGEX
_construct_dfa (c_rx1, strlen (c_rx1), 1);
+ c_rx1 = GNUNET_strdup (
REGEX_INTERNAL
_get_canonical_regex (dfa));
+
REGEX_INTERNAL
_automaton_destroy (dfa);
+ dfa =
REGEX_INTERNAL
_construct_dfa (c_rx1, strlen (c_rx1), 1);
GNUNET_assert (NULL != dfa);
GNUNET_assert (NULL != dfa);
- c_rx2 =
GNUNET_REGEX
_get_canonical_regex (dfa);
+ c_rx2 =
REGEX_INTERNAL
_get_canonical_regex (dfa);
error = (0 == strcmp (c_rx1, c_rx2)) ? 0 : 1;
error = (0 == strcmp (c_rx1, c_rx2)) ? 0 : 1;
@@
-64,7
+65,7
@@
test_proof (const char *regex)
}
GNUNET_free (c_rx1);
}
GNUNET_free (c_rx1);
-
GNUNET_REGEX
_automaton_destroy (dfa);
+
REGEX_INTERNAL
_automaton_destroy (dfa);
return error;
}
return error;
}
@@
-90,7
+91,7
@@
test_proofs_random (unsigned int count, size_t rx_length)
for (i = 0; i < count; i++)
{
for (i = 0; i < count; i++)
{
- rand_rx =
GNUNET_REGEX
_generate_random_regex (rx_length, NULL);
+ rand_rx =
REGEX_TEST
_generate_random_regex (rx_length, NULL);
failures += test_proof (rand_rx);
GNUNET_free (rand_rx);
}
failures += test_proof (rand_rx);
GNUNET_free (rand_rx);
}
@@
-123,20
+124,20
@@
test_proofs_static ()
const char *canon_rx1;
const char *canon_rx2;
const char *canon_rx1;
const char *canon_rx2;
- struct
GNUNET_REGEX
_Automaton *dfa1;
- struct
GNUNET_REGEX
_Automaton *dfa2;
+ struct
REGEX_INTERNAL
_Automaton *dfa1;
+ struct
REGEX_INTERNAL
_Automaton *dfa2;
error = 0;
for (i = 0; i < 8; i += 2)
{
error = 0;
for (i = 0; i < 8; i += 2)
{
- dfa1 =
GNUNET_REGEX
_construct_dfa (regex[i], strlen (regex[i]), 1);
- dfa2 =
GNUNET_REGEX
_construct_dfa (regex[i + 1], strlen (regex[i + 1]), 1);
+ dfa1 =
REGEX_INTERNAL
_construct_dfa (regex[i], strlen (regex[i]), 1);
+ dfa2 =
REGEX_INTERNAL
_construct_dfa (regex[i + 1], strlen (regex[i + 1]), 1);
GNUNET_assert (NULL != dfa1);
GNUNET_assert (NULL != dfa2);
GNUNET_assert (NULL != dfa1);
GNUNET_assert (NULL != dfa2);
- canon_rx1 =
GNUNET_REGEX
_get_canonical_regex (dfa1);
- canon_rx2 =
GNUNET_REGEX
_get_canonical_regex (dfa2);
+ canon_rx1 =
REGEX_INTERNAL
_get_canonical_regex (dfa1);
+ canon_rx2 =
REGEX_INTERNAL
_get_canonical_regex (dfa2);
error += (0 == strcmp (canon_rx1, canon_rx2)) ? 0 : 1;
error += (0 == strcmp (canon_rx1, canon_rx2)) ? 0 : 1;
@@
-147,8
+148,8
@@
test_proofs_static ()
regex[i], canon_rx1, regex[i + 1], canon_rx2);
}
regex[i], canon_rx1, regex[i + 1], canon_rx2);
}
-
GNUNET_REGEX
_automaton_destroy (dfa1);
-
GNUNET_REGEX
_automaton_destroy (dfa2);
+
REGEX_INTERNAL
_automaton_destroy (dfa1);
+
REGEX_INTERNAL
_automaton_destroy (dfa2);
}
return error;
}
return error;