changeset 337:26218c4de7e0

test added
author Sebastien Jodogne <s.jodogne@gmail.com>
date Sun, 13 Jan 2013 22:06:31 +0100
parents 3c291753231f
children 3a3b3ba8c1e0
files Core/Toolbox.cpp UnitTests/main.cpp
diffstat 2 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/Core/Toolbox.cpp	Sun Jan 13 21:50:11 2013 +0100
+++ b/Core/Toolbox.cpp	Sun Jan 13 22:06:31 2013 +0100
@@ -594,7 +594,7 @@
   }
 
 
-  static uint8_t Hex2Dec(char c)
+  static char Hex2Dec(char c)
   {
     return ((c >= '0' && c <= '9') ? c - '0' :
             ((c >= 'a' && c <= 'f') ? c - 'a' + 10 : c - 'A' + 10));
--- a/UnitTests/main.cpp	Sun Jan 13 21:50:11 2013 +0100
+++ b/UnitTests/main.cpp	Sun Jan 13 22:06:31 2013 +0100
@@ -305,9 +305,12 @@
   Toolbox::UrlDecode(s);
   ASSERT_EQ("Hello World", s);
 
-  s = "%21%23%24%26%27%28%29%2A%2B%2c%2f%3A%3b%3d%3f%40%5B%5D";
+  s = "%21%23%24%26%27%28%29%2A%2B%2c%2f%3A%3b%3d%3f%40%5B%5D%90%ff";
   Toolbox::UrlDecode(s);
-  ASSERT_EQ("!#$&'()*+,/:;=?@[]", s);
+  std::string ss = "!#$&'()*+,/:;=?@[]"; 
+  ss.push_back((char) 144); 
+  ss.push_back((char) 255);
+  ASSERT_EQ(ss, s);
 
   s = "(2000%2C00A4)+Other";
   Toolbox::UrlDecode(s);