changeset 3974:bd0af2e11325

fix for big-endian
author Sebastien Jodogne <s.jodogne@gmail.com>
date Sat, 23 May 2020 12:50:34 +0200
parents d86bddb50972
children ef907d3b38d5
files UnitTestsSources/FromDcmtkTests.cpp UnitTestsSources/ServerIndexTests.cpp
diffstat 2 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/UnitTestsSources/FromDcmtkTests.cpp	Fri May 22 18:40:35 2020 +0200
+++ b/UnitTestsSources/FromDcmtkTests.cpp	Sat May 23 12:50:34 2020 +0200
@@ -514,7 +514,9 @@
 
   std::string s;
   ASSERT_TRUE(f.LookupTransferSyntax(s));
-  ASSERT_EQ(s, GetTransferSyntaxUid(DicomTransferSyntax_LittleEndianExplicit));
+  // The default transfer syntax depends on the OS endianness
+  ASSERT_TRUE(s == GetTransferSyntaxUid(DicomTransferSyntax_LittleEndianExplicit) ||
+              s == GetTransferSyntaxUid(DicomTransferSyntax_BigEndianExplicit));
 
   ASSERT_THROW(f.Replace(DICOM_TAG_ACCESSION_NUMBER, std::string("Accession"),
                          false, DicomReplaceMode_ThrowIfAbsent, ""), OrthancException);
--- a/UnitTestsSources/ServerIndexTests.cpp	Fri May 22 18:40:35 2020 +0200
+++ b/UnitTestsSources/ServerIndexTests.cpp	Sat May 23 12:50:34 2020 +0200
@@ -734,8 +734,10 @@
     ASSERT_TRUE(instanceMetadata.find(MetadataType_Instance_TransferSyntax) != instanceMetadata.end());
     ASSERT_TRUE(instanceMetadata.find(MetadataType_Instance_SopClassUid) != instanceMetadata.end());
 
-    // By default, an Explicit VR Little Endian is used by Orthanc
-    ASSERT_EQ("1.2.840.10008.1.2.1", instanceMetadata[MetadataType_Instance_TransferSyntax]);
+    // The default transfer syntax depends on the OS endianness
+    std::string s = instanceMetadata[MetadataType_Instance_TransferSyntax];
+    ASSERT_TRUE(s == "1.2.840.10008.1.2.1" ||
+                s == "1.2.840.10008.1.2.2");
 
     ASSERT_EQ("1.2.840.10008.5.1.4.1.1.1", instanceMetadata[MetadataType_Instance_SopClassUid]);