Mercurial > hg > orthanc
comparison 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 |
comparison
equal
deleted
inserted
replaced
1087:e07b90fb00eb | 1088:6fd4434c1bcf |
---|---|
39 #include "../Core/OrthancException.h" | 39 #include "../Core/OrthancException.h" |
40 #include "../Core/ImageFormats/ImageBuffer.h" | 40 #include "../Core/ImageFormats/ImageBuffer.h" |
41 #include "../Core/ImageFormats/PngReader.h" | 41 #include "../Core/ImageFormats/PngReader.h" |
42 #include "../Core/ImageFormats/PngWriter.h" | 42 #include "../Core/ImageFormats/PngWriter.h" |
43 #include "../Core/Uuid.h" | 43 #include "../Core/Uuid.h" |
44 #include "../Resources/EncodingTests.h" | |
44 | 45 |
45 using namespace Orthanc; | 46 using namespace Orthanc; |
46 | 47 |
47 TEST(DicomFormat, Tag) | 48 TEST(DicomFormat, Tag) |
48 { | 49 { |
174 | 175 |
175 o.EmbedImage(img.GetAccessor()); | 176 o.EmbedImage(img.GetAccessor()); |
176 o.SaveToFile("UnitTestsResults/png4.dcm"); | 177 o.SaveToFile("UnitTestsResults/png4.dcm"); |
177 } | 178 } |
178 } | 179 } |
180 | |
181 | |
182 TEST(Toolbox, Encodings1) | |
183 { | |
184 for (unsigned int i = 0; i < testEncodingsCount; i++) | |
185 { | |
186 std::string source(testEncodingsEncoded[i]); | |
187 std::string expected(testEncodingsExpected[i]); | |
188 std::string s = Toolbox::ConvertToUtf8(source, testEncodings[i]); | |
189 ASSERT_EQ(expected, s); | |
190 } | |
191 } |