Skip to content

Commit 9ea09f1

Browse files
committed
#46 Fix tests on s390x architecture
1 parent 7c12a2d commit 9ea09f1

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

test/Test.hs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,16 @@ test_non_gzip = conjoin
180180

181181
, ioProperty $ withSampleData "not-gzip" $ \hnd -> do
182182
let decomp = decompressIO rawFormat defaultDecompressParams
183-
assertDecompressError hnd (assertDataFormatError "invalid code lengths set") decomp
183+
checkError err = disjoin
184+
-- The majority of platforms throw this:
185+
[ assertDataFormatError "invalid code lengths set" err
186+
-- But on z15+ mainframes zlib employs CPU instruction DFLTCC,
187+
-- which returns error code with the same meaning.
188+
-- See http://publibfp.dhe.ibm.com/epubs/pdf/a227832c.pdf, page 26-37
189+
-- and https://github.com/haskell/zlib/issues/46
190+
, assertDataFormatError "Operation-Ending-Supplemental Code is 0x27" err
191+
]
192+
assertDecompressError hnd checkError decomp
184193

185194
, ioProperty $ withSampleData "not-gzip" $ \hnd -> do
186195
let decomp = decompressIO gzipOrZlibFormat defaultDecompressParams

0 commit comments

Comments
 (0)