Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Added unit tests for CommonFunctions/ResetUnusedString
authorSteve Brokenshire <sbrokenshire@xestia.co.uk>
Wed, 23 Mar 2016 22:43:11 +0000 (22:43 +0000)
committerSteve Brokenshire <sbrokenshire@xestia.co.uk>
Wed, 23 Mar 2016 22:43:11 +0000 (22:43 +0000)
source/tests/xestiaab_common.h

index f373df0..76384bb 100644 (file)
@@ -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){
Xestia Software Development
Yn Maystri
© 2006 - 2019 Xestia Software Development
Software

Xestia Address Book
Xestia Calendar
Development

Xestia Gelforn
Everything else

About
News
Privacy Policy