summaryrefslogtreecommitdiff
path: root/cmps/tests/StringBuilderTest.cc
diff options
context:
space:
mode:
authorgeronimo <geronimo013@gmx.de>2012-08-04 09:10:44 (GMT)
committergeronimo <geronimo013@gmx.de>2012-08-04 09:10:44 (GMT)
commite8175c7b23047fefd52f85afe05e2864b2a9bba8 (patch)
tree8dab4e287545805d173a6c8e297c1798a1a01599 /cmps/tests/StringBuilderTest.cc
parentc7d67f443bdfe842c2e356d4edbe345338e3e08d (diff)
downloadcmp-e8175c7b23047fefd52f85afe05e2864b2a9bba8.tar.gz
cmp-e8175c7b23047fefd52f85afe05e2864b2a9bba8.tar.bz2
created new icons to enable visual feedback on mediatype selection, changed json-parser and enabled virtual mediatype usage
Diffstat (limited to 'cmps/tests/StringBuilderTest.cc')
-rw-r--r--cmps/tests/StringBuilderTest.cc17
1 files changed, 17 insertions, 0 deletions
diff --git a/cmps/tests/StringBuilderTest.cc b/cmps/tests/StringBuilderTest.cc
index 9814411..8d2b150 100644
--- a/cmps/tests/StringBuilderTest.cc
+++ b/cmps/tests/StringBuilderTest.cc
@@ -75,6 +75,22 @@ void basicTests()
free(result);
}
+void replaceTest()
+{
+ const char char2Replace[] = { '"', '\0' };
+ const char *replacements[] = { "\\\"", NULL };
+ const char *sample = "mal sehen, was \"hier\" so abgeht?!";
+ cStringBuilder sb(17);
+
+ sb.Append(sample, char2Replace, replacements);
+ char *result = sb.toString();
+
+ std::cout << "result with replace: " << result << std::endl;
+// std::cout << "result with replace (size " << sb.Size() << "): " << result << std::endl;
+ std::cout << "size-check: " << strlen(sample) << " <> " << strlen(result) << std::endl;
+ free(result);
+}
+
void lineReaderTest()
{
cLineReader lr(new cFileReader(new cFile("srclient.conf")));
@@ -92,6 +108,7 @@ int main()
lineReaderTest();
basicTests();
rangeTests();
+ replaceTest();
return 0;
}