TEST(CommonFunctions, EscapeString){
+ // Test the escape string function.
+
+ EscapeStringData = "\"Example\"";
+
+ ASSERT_EQ("\\\"Example\\\"", EscapeStringData(&EscapeStringData, false));
+
+ EscapeStringData = "Here we go, an \"example\" of escaping string.";
+
+ ASSERT_EQ("Here we go\\, an \\\"example\\\" of escaping string.", EscapeStringData(&EscapeStringData, false));
+
+ EscapeStringData = "Lets put some \nnew \nlines \nin \nhere.";
+
+ ASSERT_EQ("Lets put some \\nnew \\nlines \\nin \\nhere.", EscapeStringData(&EscapeStringData, false));
+
+ EscapeStringData = "Lets put some \r\nnew \r\nlines \r\nin \r\nhere.";
+
+ 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){