From: Steve Brokenshire Date: Wed, 23 Mar 2016 22:43:11 +0000 (+0000) Subject: Added unit tests for CommonFunctions/ResetUnusedString X-Git-Tag: release-0.11~7 X-Git-Url: http://Server1/repobrowser/?a=commitdiff_plain;h=298d2bd787b9b695d017ba16c7357bb5c05b43f7;p=xestiaab%2F.git Added unit tests for CommonFunctions/ResetUnusedString --- diff --git a/source/tests/xestiaab_common.h b/source/tests/xestiaab_common.h index f373df0..76384bb 100644 --- a/source/tests/xestiaab_common.h +++ b/source/tests/xestiaab_common.h @@ -296,6 +296,24 @@ TEST(CommonFunctions, CaptureString){ TEST(CommonFunctions, ResetUnusedString){ + // Tests for resetting an unused string. + + wxString ResetUnusedStringData = "Random string with a \\\\\\\\serverpath\\\\location"; + ResetUnusedString(&ResetUnusedStringData); + ASSERT_EQ("Random string with a \\\\serverpath\\location", ResetUnusedStringData.ToStdString()); + + ResetUnusedStringData = "Some text \\nwith new \\nlines!"; + ResetUnusedString(&ResetUnusedStringData); + ASSERT_EQ("Some text \nwith new \nlines!", ResetUnusedStringData.ToStdString()); + + ResetUnusedStringData = "Some text \\nwith new \\nlines!"; + ResetUnusedString(&ResetUnusedStringData); + ASSERT_EQ("Some text \nwith new \nlines!", ResetUnusedStringData.ToStdString()); + + ResetUnusedStringData = "And now the list of characters: \\\\ \\n \\; \\,"; + ResetUnusedString(&ResetUnusedStringData); + ASSERT_EQ("And now the list of characters: \\ \n ; ,", ResetUnusedStringData.ToStdString()); + } TEST(CommonFunctions, ConvertToHTML){