From 26c542881613813bd6a671a56e78f129944f68e6 Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Tue, 22 Mar 2016 22:39:36 +0000 Subject: [PATCH] Updated code for testing EscapeString in CommonFunctions/EscapeString --- source/tests/xestiaab_common.h | 29 ++++++++++++----------------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/source/tests/xestiaab_common.h b/source/tests/xestiaab_common.h index 203278f..6dbfb9f 100644 --- a/source/tests/xestiaab_common.h +++ b/source/tests/xestiaab_common.h @@ -249,30 +249,25 @@ TEST(CommonFunctions, EscapeString){ // Test the escape string function. - EscapeStringData = "\"Example\""; - - ASSERT_EQ("\\\"Example\\\"", EscapeStringData(&EscapeStringData, false)); + wxString EscapeStringData = "Example"; + EscapeString(&EscapeStringData, false); + ASSERT_EQ("Example", EscapeStringData.ToStdString()); EscapeStringData = "Here we go, an \"example\" of escaping string."; - - ASSERT_EQ("Here we go\\, an \\\"example\\\" of escaping string.", EscapeStringData(&EscapeStringData, false)); + EscapeString(&EscapeStringData, false); + ASSERT_EQ("Here we go\\, an \"example\" of escaping string.", EscapeStringData.ToStdString()); EscapeStringData = "Lets put some \nnew \nlines \nin \nhere."; - - ASSERT_EQ("Lets put some \\nnew \\nlines \\nin \\nhere.", EscapeStringData(&EscapeStringData, false)); + EscapeString(&EscapeStringData, false); + ASSERT_EQ("Lets put some \\nnew \\nlines \\nin \\nhere.", EscapeStringData.ToStdString()); EscapeStringData = "Lets put some \r\nnew \r\nlines \r\nin \r\nhere."; + EscapeString(&EscapeStringData, false); + ASSERT_EQ("Lets put some \\nnew \\nlines \\nin \\nhere.", EscapeStringData.ToStdString()); - ASSERT_EQ("Lets put some \\nnew \\nlines \\nin \\nhere.", EscapeStringData(&EscapeStringData, false)); - - EscapeStringData = "A:\path\example\lets\have\some\fun"; - - ASSERT_EQ("A:\\path\\example\\lets\\have\\some\\fun", EscapeStringData(&EscapeStringData, false)); - - -} - -TEST(CommonFunctions, GetEscapeString){ + EscapeStringData = "A:\\path\\example\\lets\\have\\some\\fun"; + EscapeString(&EscapeStringData, false); + ASSERT_EQ("A:\\\\path\\\\example\\\\lets\\\\have\\\\some\\\\fun", EscapeStringData.ToStdString()); } -- 2.39.5