Allow to build zlib and lzma statically
This should fix issues on Darwin.
This commit is contained in:
32
3rdparty/zlib/test/Test/Codec/Compression/Zlib/Internal.hs
vendored
Normal file
32
3rdparty/zlib/test/Test/Codec/Compression/Zlib/Internal.hs
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
{-# OPTIONS_GHC -fno-warn-orphans #-}
|
||||
|
||||
-- | Test code and properties for "Codec.Compression.Zlib.Internal"
|
||||
--
|
||||
module Test.Codec.Compression.Zlib.Internal where
|
||||
|
||||
import Codec.Compression.Zlib.Internal
|
||||
import Test.Codec.Compression.Zlib.Stream ()
|
||||
import Test.QuickCheck
|
||||
|
||||
import Control.Monad (ap)
|
||||
|
||||
|
||||
instance Arbitrary CompressParams where
|
||||
arbitrary = return CompressParams `ap` arbitrary `ap` arbitrary
|
||||
`ap` arbitrary `ap` arbitrary
|
||||
`ap` arbitrary `ap` arbitraryBufferSize
|
||||
`ap` return Nothing
|
||||
|
||||
arbitraryBufferSize :: Gen Int
|
||||
arbitraryBufferSize = frequency $ [(10, return n) | n <- [1..1024]] ++
|
||||
[(20, return n) | n <- [1025..8192]] ++
|
||||
[(40, return n) | n <- [8193..131072]] ++
|
||||
[(1, return n) | n <- [131072..1048576]]
|
||||
|
||||
|
||||
instance Arbitrary DecompressParams where
|
||||
arbitrary = return DecompressParams `ap` arbitrary
|
||||
`ap` arbitraryBufferSize
|
||||
`ap` return Nothing
|
||||
`ap` arbitrary
|
||||
|
||||
40
3rdparty/zlib/test/Test/Codec/Compression/Zlib/Stream.hs
vendored
Normal file
40
3rdparty/zlib/test/Test/Codec/Compression/Zlib/Stream.hs
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
{-# OPTIONS_GHC -fno-warn-orphans #-}
|
||||
|
||||
-- | Test code and properties for "Codec.Compression.Zlib.Stream"
|
||||
--
|
||||
module Test.Codec.Compression.Zlib.Stream where
|
||||
|
||||
import Codec.Compression.Zlib.Internal
|
||||
import Test.QuickCheck
|
||||
|
||||
|
||||
instance Arbitrary Format where
|
||||
-- GZipOrZlib omitted since it's not symmetric
|
||||
arbitrary = elements [gzipFormat, zlibFormat, rawFormat]
|
||||
|
||||
|
||||
instance Arbitrary Method where
|
||||
arbitrary = return deflateMethod
|
||||
|
||||
|
||||
instance Arbitrary CompressionLevel where
|
||||
arbitrary = elements $ [defaultCompression, noCompression,
|
||||
bestCompression, bestSpeed]
|
||||
++ map compressionLevel [1..9]
|
||||
|
||||
|
||||
instance Arbitrary WindowBits where
|
||||
arbitrary = elements $ defaultWindowBits:map windowBits [9..15]
|
||||
|
||||
|
||||
instance Arbitrary MemoryLevel where
|
||||
arbitrary = elements $ [defaultMemoryLevel, minMemoryLevel, maxMemoryLevel]
|
||||
++ [memoryLevel n | n <- [1..9]]
|
||||
|
||||
|
||||
|
||||
instance Arbitrary CompressionStrategy where
|
||||
arbitrary = elements $ [defaultStrategy, filteredStrategy, huffmanOnlyStrategy]
|
||||
-- These are disabled by default in the package
|
||||
-- as they are only available with zlib >=1.2
|
||||
-- ++ [RLE, Fixed]
|
||||
Reference in New Issue
Block a user