Mercurial > hg > orthanc
diff UnitTestsSources/DicomMapTests.cpp @ 3519:fc26659493b6
added support for COLUMNS/ROWS tags with invalid 800\0 value observed in some US images
author | amazy |
---|---|
date | Thu, 19 Sep 2019 13:10:10 +0200 |
parents | db71bd11affc |
children | 77bede920d22 |
line wrap: on
line diff
--- a/UnitTestsSources/DicomMapTests.cpp Thu Sep 05 13:11:35 2019 +0200 +++ b/UnitTestsSources/DicomMapTests.cpp Thu Sep 19 13:10:10 2019 +0200 @@ -239,6 +239,7 @@ int64_t j; uint32_t k; uint64_t l; + unsigned int ui; std::string s; m.SetValue(DICOM_TAG_PATIENT_NAME, " ", false); // Empty value @@ -375,6 +376,15 @@ ASSERT_FLOAT_EQ(-2147483649.0f, f); ASSERT_DOUBLE_EQ(-2147483649.0, d); ASSERT_EQ(-2147483649ll, j); + + + // "800\0" in US COLMUNS tag + m.SetValue(DICOM_TAG_COLUMNS, "800\0", false); + ASSERT_TRUE(m.GetValue(DICOM_TAG_COLUMNS).ParseFirstUnsignedInteger(ui)); + ASSERT_EQ(800, ui); + m.SetValue(DICOM_TAG_COLUMNS, "800", false); + ASSERT_TRUE(m.GetValue(DICOM_TAG_COLUMNS).ParseFirstUnsignedInteger(ui)); + ASSERT_EQ(800, ui); }