From 298d2bd787b9b695d017ba16c7357bb5c05b43f7 Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Wed, 23 Mar 2016 22:43:11 +0000 Subject: [PATCH] Added unit tests for CommonFunctions/ResetUnusedString --- source/tests/xestiaab_common.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) 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){ -- 2.39.5