Description: Fix test-suite on some big-endian archs Author: Dennis Gilmore Bug-Debian: https://bugs.debian.org/793040 Origin: vendor, https://github.com/openexr/openexr/issues/81 Reviewed-by: Mathieu Malaterre Index: openexr/IlmImfTest/testFutureProofing.cpp =================================================================== --- openexr.orig/IlmImfTest/testFutureProofing.cpp +++ openexr/IlmImfTest/testFutureProofing.cpp @@ -40,6 +40,7 @@ #include #include #include +#include #include "tmpDir.h" #include "testFutureProofing.h" @@ -64,6 +65,7 @@ #include #include #include +#include namespace IMF = OPENEXR_IMF_NAMESPACE; using namespace IMF; @@ -1234,6 +1236,12 @@ modifyType (bool modify_version) //length of attribute fread(&length,4,1,f); + if (!GLOBAL_SYSTEM_LITTLE_ENDIAN) + { + int tmp = bswap_32(length); + length = tmp; + } + if(!modify_version && attrib_name=="type") { // modify the type of part 1 to be 'X' Index: openexr/IlmImfTest/testMultiPartFileMixingBasic.cpp =================================================================== --- openexr.orig/IlmImfTest/testMultiPartFileMixingBasic.cpp +++ openexr/IlmImfTest/testMultiPartFileMixingBasic.cpp @@ -40,6 +40,7 @@ #include #include #include +#include #include "tmpDir.h" #include "testMultiPartFileMixingBasic.h" @@ -59,6 +60,7 @@ #include #include #include +#include namespace IMF = OPENEXR_IMF_NAMESPACE; using namespace IMF; @@ -1383,6 +1385,11 @@ killOffsetTables (const std::string & fn //length of attribute fread(&length,4,1,f); + if (!GLOBAL_SYSTEM_LITTLE_ENDIAN) + { + int tmp = bswap_32(length); + length = tmp; + } //value of attribute for(int i=0;i