summaryrefslogtreecommitdiff
path: root/gnu/packages/patches/ilmbase-fix-test-arm.patch
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/packages/patches/ilmbase-fix-test-arm.patch')
-rw-r--r--gnu/packages/patches/ilmbase-fix-test-arm.patch60
1 files changed, 60 insertions, 0 deletions
diff --git a/gnu/packages/patches/ilmbase-fix-test-arm.patch b/gnu/packages/patches/ilmbase-fix-test-arm.patch
new file mode 100644
index 0000000000..2dbc55e8c4
--- /dev/null
+++ b/gnu/packages/patches/ilmbase-fix-test-arm.patch
@@ -0,0 +1,60 @@
+Fix a test failure on ARM platforms:
+
+https://github.com/AcademySoftwareFoundation/openexr/issues/713
+
+Taken from upstream:
+
+https://github.com/AcademySoftwareFoundation/openexr/commit/76d9839cd1b300398f8b801dfcb4bcf2f8c0096f
+
+diff --git a/OpenEXR/IlmImfTest/testHuf.cpp b/OpenEXR/IlmImfTest/testHuf.cpp
+index 4c887ee8..a93b8ea9 100644
+--- a/OpenEXR/IlmImfTest/testHuf.cpp
++++ b/OpenEXR/IlmImfTest/testHuf.cpp
+@@ -181,9 +181,9 @@ compressUncompressSubset(const unsigned short raw[], int n)
+ // This DEK hash is determined from an aprior initial run of this
+ // test noting its value from the assert message compressVerify().
+ //
+-#define HUF_COMPRESS_DEK_HASH_FOR_FILL4_USHRT_MAX_PLUS_ONE 2956869585U
+-#define HUF_COMPRESS_DEK_HASH_FOR_FILL4_N 3414126535U
+-#define HUF_COMPRESS_DEK_HASH_FOR_FILL5_N 169791374U
++#define HUF_COMPRESS_DEK_HASH_FOR_FILL4_USHRT_MAX_PLUS_ONE 2013380646U
++#define HUF_COMPRESS_DEK_HASH_FOR_FILL4_N 213880353U
++#define HUF_COMPRESS_DEK_HASH_FOR_FILL5_N 2492982090U
+
+ void
+ compressVerify (const unsigned short raw[],
+@@ -200,7 +200,7 @@ compressVerify (const unsigned short raw[],
+ // under the topic of sorting and search chapter 6.4.
+ //
+ unsigned int compressedHash = nCompressed;
+- const char* cptr = compressed;
++ const unsigned char* cptr = reinterpret_cast<const unsigned char*>( (const char*) compressed);
+ for (int i = 0; i < nCompressed; ++i)
+ {
+ compressedHash =
+@@ -210,6 +210,25 @@ compressVerify (const unsigned short raw[],
+ cout << "verifying compressed checksum hash = "
+ << compressedHash << std::endl;
+
++ if (compressedHash != dekHash)
++ {
++ cout << "hash verification failed. Got " << compressedHash << " expected " << dekHash << std::endl;
++ const unsigned char* cptr = reinterpret_cast<const unsigned char*>( (const char*) compressed);
++ for(int i = 0 ; i < nCompressed ; ++i )
++ {
++ cout << std::hex << (0xFF & (int) (*cptr++));
++ if ( (i & 0xF) ==0 )
++ {
++ cout << '\n';
++ }
++ else
++ {
++ cout << ' ';
++ }
++ }
++ cout << "\n";
++ }
++
+ assert (compressedHash == dekHash);
+ }
+