Mercurial > hg > orthanc
comparison UnitTestsSources/DicomMapTests.cpp @ 3203:810772486249
URI "/instances/.../file" can return DICOMweb JSON or XML, depending on Accept header
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 06 Feb 2019 15:45:16 +0100 |
parents | ef4d86d05503 |
children | f6374c36a671 |
comparison
equal
deleted
inserted
replaced
3202:ef4d86d05503 | 3203:810772486249 |
---|---|
584 const Json::Value& tag = visitor.GetResult() ["00200032"]; | 584 const Json::Value& tag = visitor.GetResult() ["00200032"]; |
585 ASSERT_EQ(EnumerationToString(ValueRepresentation_DecimalString), tag["vr"].asString()); | 585 ASSERT_EQ(EnumerationToString(ValueRepresentation_DecimalString), tag["vr"].asString()); |
586 ASSERT_EQ(1u, tag.getMemberNames().size()); | 586 ASSERT_EQ(1u, tag.getMemberNames().size()); |
587 } | 587 } |
588 | 588 |
589 pugi::xml_document xml; | 589 std::string xml; |
590 visitor.FormatXml(xml); | 590 visitor.FormatXml(xml); |
591 } | 591 } |
592 | 592 |
593 | 593 |
594 TEST(DicomWebJson, NullValue) | 594 TEST(DicomWebJson, NullValue) |
614 ASSERT_EQ(Json::realValue, value[3].type()); | 614 ASSERT_EQ(Json::realValue, value[3].type()); |
615 ASSERT_FLOAT_EQ(1.5f, value[0].asFloat()); | 615 ASSERT_FLOAT_EQ(1.5f, value[0].asFloat()); |
616 ASSERT_FLOAT_EQ(2.5f, value[3].asFloat()); | 616 ASSERT_FLOAT_EQ(2.5f, value[3].asFloat()); |
617 } | 617 } |
618 | 618 |
619 pugi::xml_document xml; | 619 std::string xml; |
620 visitor.FormatXml(xml); | 620 visitor.FormatXml(xml); |
621 } | 621 } |
622 | 622 |
623 | 623 |
624 TEST(DicomWebJson, ValueRepresentation) | 624 TEST(DicomWebJson, ValueRepresentation) |
756 | 756 |
757 ASSERT_EQ("UT", visitor.GetResult() ["00400031"]["vr"].asString()); | 757 ASSERT_EQ("UT", visitor.GetResult() ["00400031"]["vr"].asString()); |
758 ASSERT_EQ("UT", visitor.GetResult() ["00400031"]["Value"][0].asString()); | 758 ASSERT_EQ("UT", visitor.GetResult() ["00400031"]["Value"][0].asString()); |
759 | 759 |
760 | 760 |
761 pugi::xml_document xml; | 761 std::string xml; |
762 visitor.FormatXml(xml); | 762 visitor.FormatXml(xml); |
763 } | 763 } |
764 | 764 |
765 | 765 |
766 TEST(DicomWebJson, Sequence) | 766 TEST(DicomWebJson, Sequence) |
800 ASSERT_EQ(3u, items.size()); | 800 ASSERT_EQ(3u, items.size()); |
801 ASSERT_TRUE(items.find("item0") != items.end()); | 801 ASSERT_TRUE(items.find("item0") != items.end()); |
802 ASSERT_TRUE(items.find("item1") != items.end()); | 802 ASSERT_TRUE(items.find("item1") != items.end()); |
803 ASSERT_TRUE(items.find("item2") != items.end()); | 803 ASSERT_TRUE(items.find("item2") != items.end()); |
804 | 804 |
805 pugi::xml_document xml; | 805 std::string xml; |
806 visitor.FormatXml(xml); | 806 visitor.FormatXml(xml); |
807 } | 807 } |