19 #include <cppunit/TestFixture.h> 20 #include <cppunit/extensions/HelperMacros.h> 22 #include "regexConfProvider.hpp" 29 CPPUNIT_TEST (simpleTest);
30 CPPUNIT_TEST (simpleReplacementTest);
31 CPPUNIT_TEST (multipleReplacementTest);
32 CPPUNIT_TEST (testForInfiniteRecursion);
34 CPPUNIT_TEST_SUITE_END ();
48 const string& testString,
49 const string& testKey)
51 string testIdentity(
"testIdentity");
59 CPPUNIT_ASSERT_MESSAGE(
"The generated string should match the expected string",
60 0 == strcmp(testString.c_str(),
72 string testString =
"Lorem Ipsum";
73 string testKey =
"TEST";
74 string testLine = testKey +
"=" + testString +
"\n";
75 istringstream testStream(testLine);
77 regexConfProviderTest(testStream,testString,testKey);
87 string testString =
"Lorem Ipsum";
88 string testKey =
"TEST";
90 testKey +
"=" +
"Lorem \n" +
91 testKey +
"=__" + testKey +
"__Ipsum\n";
92 istringstream testStream(testLine);
94 regexConfProviderTest(testStream,testString,testKey);
104 string testString =
"Lorem Ipsum";
105 string testKey =
"TEST";
107 string(
"SPACE= \n") +
109 "INFIX1=rem__SPACE__I\n" +
110 testKey +
"=Lo__INFIX1__p__INFIX2__m\n";
111 istringstream testStream(testLine);
113 regexConfProviderTest(testStream,testString,testKey);
124 string testString =
"Lorem Ipsum";
125 string testKey =
"TEST";
127 string(
"LOREM=Lorem__LOREM__ \n") +
128 testKey +
"=__LOREM__Ipsum\n";
129 istringstream testStream(testLine);
131 string testIdentity(
"testIdentity");
139 CPPUNIT_ASSERT_MESSAGE(
"This should just terminate (the return value is not specified)",
Provide regex using conf file.
void testForInfiniteRecursion()
void regexConfProviderTest(istringstream &testStream, const string &testString, const string &testKey)
Test RegexConfProvider.
const char * getRegexValue(const std::string &name, const std::string &key)
Get the regex as string from the RegexMap.
void simpleReplacementTest()
void maybeLoad(const std::string &identity)
Check if identity already loaded in RegexMap, if not load them.
void multipleReplacementTest()