diff --git a/test/ClientTest.cpp b/test/ClientTest.cpp index c4d6b7a9..e66059fe 100644 --- a/test/ClientTest.cpp +++ b/test/ClientTest.cpp @@ -395,7 +395,13 @@ std::string LocalTests::createItem(int item, const std::string &revision, int si } prop = nextProp + 1; } - data.replace(data.find("<>"), strlen("<>"), revision); + /** add check for if not found, STL will crash */ + if(data.find("<>") != std::string::npos) { + data.replace(data.find("<>"), strlen("<>"), revision); + } else if (data.find("REVISION") != std::string::npos) { + /* change "<>" to "REVISION" for memo */ + data.replace(data.find("REVISION"), strlen("REVISION"), revision); + } if (size > 0 && (int)data.size() < size) { int additionalBytes = size - (int)data.size(); int added = 0; @@ -3683,7 +3689,7 @@ void ClientTest::getTestData(const char *type, Config &config) "METHOD:PUBLISH\n" "BEGIN:VJOURNAL\n" "SUMMARY:Summary\n" - "DESCRIPTION:Summary\\nBody text<>\n" + "DESCRIPTION:Summary\\nBody text REVISION\n" "END:VJOURNAL\n" "END:VCALENDAR\n"; config.updateItem = diff --git a/test/testcases/imemo20.ics b/test/testcases/imemo20.ics index 30832faf..fbc403bd 100644 --- a/test/testcases/imemo20.ics +++ b/test/testcases/imemo20.ics @@ -13,7 +13,7 @@ VERSION:2.0 METHOD:PUBLISH BEGIN:VJOURNAL SUMMARY:Summary -DESCRIPTION:Summary\nBody +DESCRIPTION:Summary\nBody <> END:VJOURNAL END:VCALENDAR diff --git a/test/testcases/imemo20.ics.memotoo.tem.patch b/test/testcases/imemo20.ics.memotoo.tem.patch index 5fd4dbd5..4956a2ae 100644 --- a/test/testcases/imemo20.ics.memotoo.tem.patch +++ b/test/testcases/imemo20.ics.memotoo.tem.patch @@ -2,7 +2,7 @@ METHOD:PUBLISH BEGIN:VJOURNAL SUMMARY:Summary --DESCRIPTION:Summary\nBody +-DESCRIPTION:Summary\nBody <> +DESCRIPTION:Summary\nBody Revision END:VJOURNAL END:VCALENDAR