diff UnitTestsSources/FromDcmtkTests.cpp @ 1981:4b545a8b1f95

return code in Toolbox::DecodeDataUriScheme
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 22 Apr 2016 09:05:06 +0200
parents 869a87c08673
children b5d4f9c156ad
line wrap: on
line diff
--- a/UnitTestsSources/FromDcmtkTests.cpp	Fri Apr 22 08:57:33 2016 +0200
+++ b/UnitTestsSources/FromDcmtkTests.cpp	Fri Apr 22 09:05:06 2016 +0200
@@ -154,7 +154,7 @@
   std::string s = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==";
 
   std::string m, cc;
-  Toolbox::DecodeDataUriScheme(m, cc, s);
+  ASSERT_TRUE(Toolbox::DecodeDataUriScheme(m, cc, s));
 
   ASSERT_EQ("image/png", m);
 
@@ -566,7 +566,7 @@
   ASSERT_EQ("Some public tag", v["7050,1000"].asString());
   std::string mime, content;
   ASSERT_EQ(Json::stringValue, v["7053,1000"].type());
-  Toolbox::DecodeDataUriScheme(mime, content, v["7053,1000"].asString());
+  ASSERT_TRUE(Toolbox::DecodeDataUriScheme(mime, content, v["7053,1000"].asString()));
   ASSERT_EQ("application/octet-stream", mime);
   ASSERT_EQ("Some private tag", content);
 
@@ -587,7 +587,7 @@
   ASSERT_FALSE(v.isMember("7053,1000"));
   ASSERT_EQ("Some public tag", v["7050,1000"].asString());
   ASSERT_EQ(Json::stringValue, v["7052,1000"].type());
-  Toolbox::DecodeDataUriScheme(mime, content, v["7052,1000"].asString());
+  ASSERT_TRUE(Toolbox::DecodeDataUriScheme(mime, content, v["7052,1000"].asString()));
   ASSERT_EQ("application/octet-stream", mime);
   ASSERT_EQ("Some unknown tag", content);
 
@@ -633,7 +633,7 @@
   ASSERT_TRUE(v.isMember("7fe0,0010"));  
   ASSERT_EQ(Json::stringValue, v["7fe0,0010"].type());
   std::string mime, content;
-  Toolbox::DecodeDataUriScheme(mime, content, v["7fe0,0010"].asString());
+  ASSERT_TRUE(Toolbox::DecodeDataUriScheme(mime, content, v["7fe0,0010"].asString()));
   ASSERT_EQ("application/octet-stream", mime);
   ASSERT_EQ("Pixels", content);
 }
@@ -733,7 +733,7 @@
     dicom->ToJson(vv, DicomToJsonFormat_Human, static_cast<DicomToJsonFlags>(DicomToJsonFlags_IncludePixelData), 0);
 
     std::string mime, content;
-    Toolbox::DecodeDataUriScheme(mime, content, vv["PixelData"].asString());
+    ASSERT_TRUE(Toolbox::DecodeDataUriScheme(mime, content, vv["PixelData"].asString()));
     ASSERT_EQ("application/octet-stream", mime);
     ASSERT_EQ(5u * 5u * 3u /* the red dot is 5x5 pixels in RGB24 */ + 1 /* for padding */, content.size());
   }