8 #include <cppunit/TestFixture.h>
9 #include <cppunit/extensions/HelperMacros.h>
11 #include "regexConfProvider.hpp"
18 CPPUNIT_TEST (simpleTest);
19 CPPUNIT_TEST (simpleReplacementTest);
20 CPPUNIT_TEST (multipleReplacementTest);
21 CPPUNIT_TEST (testForInfiniteRecursion);
23 CPPUNIT_TEST_SUITE_END ();
37 const string& testString,
38 const string& testKey)
40 string testIdentity(
"testIdentity");
48 CPPUNIT_ASSERT_MESSAGE(
"The generated string should match the expected string",
49 0 == strcmp(testString.c_str(),
61 string testString =
"Lorem Ipsum";
62 string testKey =
"TEST";
63 string testLine = testKey +
"=" + testString +
"\n";
64 istringstream testStream(testLine);
66 regexConfProviderTest(testStream,testString,testKey);
76 string testString =
"Lorem Ipsum";
77 string testKey =
"TEST";
79 testKey +
"=" +
"Lorem \n" +
80 testKey +
"=__" + testKey +
"__Ipsum\n";
81 istringstream testStream(testLine);
83 regexConfProviderTest(testStream,testString,testKey);
93 string testString =
"Lorem Ipsum";
94 string testKey =
"TEST";
98 "INFIX1=rem__SPACE__I\n" +
99 testKey +
"=Lo__INFIX1__p__INFIX2__m\n";
100 istringstream testStream(testLine);
102 regexConfProviderTest(testStream,testString,testKey);
113 string testString =
"Lorem Ipsum";
114 string testKey =
"TEST";
116 string(
"LOREM=Lorem__LOREM__ \n") +
117 testKey +
"=__LOREM__Ipsum\n";
118 istringstream testStream(testLine);
120 string testIdentity(
"testIdentity");
128 CPPUNIT_ASSERT_MESSAGE(
"This should just terminate (the return value is not specified)",
Provide regex using conf file.
void maybeLoad(const std::string &identity)
Check if identity already loaded in RegexMap, if not load them.
const char * getRegexValue(const std::string &name, const std::string &key)
Get the regex as string from the RegexMap.
void simpleReplacementTest()
void multipleReplacementTest()
void testForInfiniteRecursion()
void regexConfProviderTest(istringstream &testStream, const string &testString, const string &testKey)
Test RegexConfProvider.