From e8175c7b23047fefd52f85afe05e2864b2a9bba8 Mon Sep 17 00:00:00 2001 From: geronimo Date: Sat, 4 Aug 2012 11:10:44 +0200 Subject: created new icons to enable visual feedback on mediatype selection, changed json-parser and enabled virtual mediatype usage --- cmps/tests/StringBuilderTest.cc | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'cmps/tests') 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; } -- cgit v1.2.3