diff UnitTestsSources/FromDcmtkTests.cpp @ 1088:6fd4434c1bcf

unit tests for encodings
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 04 Aug 2014 19:24:28 +0200
parents 2f76b92addd4
children 5ea0b56e850d
line wrap: on
line diff
--- a/UnitTestsSources/FromDcmtkTests.cpp	Mon Aug 04 18:12:21 2014 +0200
+++ b/UnitTestsSources/FromDcmtkTests.cpp	Mon Aug 04 19:24:28 2014 +0200
@@ -41,6 +41,7 @@
 #include "../Core/ImageFormats/PngReader.h"
 #include "../Core/ImageFormats/PngWriter.h"
 #include "../Core/Uuid.h"
+#include "../Resources/EncodingTests.h"
 
 using namespace Orthanc;
 
@@ -176,3 +177,15 @@
     o.SaveToFile("UnitTestsResults/png4.dcm");
   }
 }
+
+
+TEST(Toolbox, Encodings1)
+{
+  for (unsigned int i = 0; i < testEncodingsCount; i++)
+  {
+    std::string source(testEncodingsEncoded[i]);
+    std::string expected(testEncodingsExpected[i]);
+    std::string s = Toolbox::ConvertToUtf8(source, testEncodings[i]);
+    ASSERT_EQ(expected, s);
+  }
+}