Mercurial > hg > orthanc
comparison UnitTestsSources/FromDcmtkTests.cpp @ 1787:1b1d5470233f worklists
refactoring of DicomFindAnswers
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 18 Nov 2015 15:50:32 +0100 |
parents | df331354cea2 |
children | bdcc1dba4a53 |
comparison
equal
deleted
inserted
replaced
1786:164d78911382 | 1787:1b1d5470233f |
---|---|
41 #include "../Core/Images/ImageBuffer.h" | 41 #include "../Core/Images/ImageBuffer.h" |
42 #include "../Core/Images/PngReader.h" | 42 #include "../Core/Images/PngReader.h" |
43 #include "../Core/Images/PngWriter.h" | 43 #include "../Core/Images/PngWriter.h" |
44 #include "../Core/Uuid.h" | 44 #include "../Core/Uuid.h" |
45 #include "../Resources/EncodingTests.h" | 45 #include "../Resources/EncodingTests.h" |
46 #include "../OrthancServer/DicomProtocol/DicomFindAnswers.h" | |
46 | 47 |
47 #include <dcmtk/dcmdata/dcelem.h> | 48 #include <dcmtk/dcmdata/dcelem.h> |
48 | 49 |
49 using namespace Orthanc; | 50 using namespace Orthanc; |
50 | 51 |
604 std::string mime, content; | 605 std::string mime, content; |
605 Toolbox::DecodeDataUriScheme(mime, content, v["7fe0,0010"].asString()); | 606 Toolbox::DecodeDataUriScheme(mime, content, v["7fe0,0010"].asString()); |
606 ASSERT_EQ("application/octet-stream", mime); | 607 ASSERT_EQ("application/octet-stream", mime); |
607 ASSERT_EQ("Pixels", content); | 608 ASSERT_EQ("Pixels", content); |
608 } | 609 } |
610 | |
611 | |
612 TEST(DicomFindAnswers, Basic) | |
613 { | |
614 DicomFindAnswers a; | |
615 | |
616 { | |
617 DicomMap m; | |
618 m.SetValue(DICOM_TAG_PATIENT_ID, "hello"); | |
619 a.Add(m); | |
620 } | |
621 | |
622 { | |
623 DicomMap m; | |
624 m.SetValue(DICOM_TAG_PATIENT_ID, "world"); | |
625 a.Add(m); | |
626 } | |
627 | |
628 Json::Value j; | |
629 a.ToJson(j, true); | |
630 ASSERT_EQ(2u, j.size()); | |
631 } |