aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormontellese <montellese@xbmc.org>2013-02-26 10:51:15 +0100
committermontellese <montellese@xbmc.org>2013-02-27 09:28:54 +0100
commit3715563d9762a065b8b8643153dbc640ba1d5763 (patch)
treee390218910c6b5717e49c64318833dd31290e7a3
parent06d0b88c2a76e4a3b205d4b1d34a1f913a513f07 (diff)
[test] add unit test for StringUtils::Paramify
-rw-r--r--xbmc/utils/test/TestStringUtils.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/xbmc/utils/test/TestStringUtils.cpp b/xbmc/utils/test/TestStringUtils.cpp
index 4844ab4a9f..046e77f3fe 100644
--- a/xbmc/utils/test/TestStringUtils.cpp
+++ b/xbmc/utils/test/TestStringUtils.cpp
@@ -462,3 +462,12 @@ TEST(TestStringUtils, FindBestMatch)
EXPECT_EQ(refint, varint);
EXPECT_EQ(refdouble, vardouble);
}
+
+TEST(TestStringUtils, Paramify)
+{
+ const char *input = "some, very \\ odd \"string\"";
+ const char *ref = "\"some, very \\\\ odd \\\"string\\\"\"";
+
+ std::string result = StringUtils::Paramify(input);
+ EXPECT_STREQ(ref, result.c_str());
+}