From cc710e4f9b67ce29b938f10b691e9ec6ac76c325 Mon Sep 17 00:00:00 2001
From: Bas van Dijk <v.dijk.bas@gmail.com>
Date: Wed, 26 Oct 2011 21:43:25 +0200
Subject: [PATCH 2/2] Fix test-suite and get rid of some warnings

---
 Data/ByteString/Fusion.hs   |    1 +
 Data/ByteString/Internal.hs |    2 +-
 bytestring.cabal            |    2 +-
 tests/Properties.hs         |    5 +++--
 tests/QuickCheckUtils.hs    |   14 +-------------
 5 files changed, 7 insertions(+), 17 deletions(-)

diff --git a/Data/ByteString/Fusion.hs b/Data/ByteString/Fusion.hs
index bf102f3..70711b6 100644
--- a/Data/ByteString/Fusion.hs
+++ b/Data/ByteString/Fusion.hs
@@ -1,4 +1,5 @@
 {-# OPTIONS_HADDOCK hide #-}
+{-# LANGUAGE CPP #-}
 #if __GLASGOW_HASKELL__ >= 701
 {-# LANGUAGE Safe #-}
 #endif
diff --git a/Data/ByteString/Internal.hs b/Data/ByteString/Internal.hs
index 1dce1c1..d39647b 100644
--- a/Data/ByteString/Internal.hs
+++ b/Data/ByteString/Internal.hs
@@ -68,7 +68,7 @@ module Data.ByteString.Internal (
 import Foreign.ForeignPtr       (ForeignPtr, withForeignPtr)
 import Foreign.Ptr              (Ptr, FunPtr, plusPtr)
 import Foreign.Storable         (Storable(..))
-import Foreign.C.Types          (CInt(..), CSize(..), CULong(..))
+import Foreign.C.Types          (CInt, CSize, CULong)
 import Foreign.C.String         (CString)
 
 import Control.DeepSeq          (NFData)
diff --git a/bytestring.cabal b/bytestring.cabal
index ec86c75..79fd364 100644
--- a/bytestring.cabal
+++ b/bytestring.cabal
@@ -71,7 +71,7 @@ test-suite prop-compiled
   type:             exitcode-stdio-1.0
   main-is:          Properties.hs
   hs-source-dirs:   . tests
-  build-depends:    base, deepseq, random, directory,
+  build-depends:    base, deepseq, random >= 1.0.1, directory,
                     QuickCheck >= 2.3 && < 3
   if impl(ghc >= 6.10)
     build-depends:  ghc-prim
diff --git a/tests/Properties.hs b/tests/Properties.hs
index 55bf350..2edbe1c 100644
--- a/tests/Properties.hs
+++ b/tests/Properties.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE PatternSignatures #-}
+{-# LANGUAGE ScopedTypeVariables, BangPatterns #-}
 --
 -- Must have rules off, otherwise the fusion rules will replace the rhs
 -- with the lhs, and we only end up testing lhs == lhs
@@ -8,7 +8,8 @@
 -- -fhpc interferes with rewrite rules firing.
 --
 
-import Foreign
+import Foreign.Storable (peekElemOff, pokeElemOff)
+import Foreign.Marshal.Alloc (free)
 import Foreign.ForeignPtr
 import Foreign.Marshal.Array
 import GHC.Ptr
diff --git a/tests/QuickCheckUtils.hs b/tests/QuickCheckUtils.hs
index d07fc91..7a20b0b 100644
--- a/tests/QuickCheckUtils.hs
+++ b/tests/QuickCheckUtils.hs
@@ -1,4 +1,4 @@
-{-# OPTIONS_GHC -fglasgow-exts #-}
+{-# LANGUAGE MultiParamTypeClasses, FlexibleInstances #-}
 --
 -- Uses multi-param type classes
 --
@@ -74,18 +74,6 @@ mytest p n = do
 
 ------------------------------------------------------------------------
 
-instance Random Word8 where
-  randomR = integralRandomR
-  random = randomR (minBound,maxBound)
-
-instance Random CChar where
-  randomR = integralRandomR
-  random = randomR (minBound,maxBound)
-
-instance Random Int64 where
-  randomR = integralRandomR
-  random  = randomR (minBound,maxBound)
-
 integralRandomR :: (Integral a, RandomGen g) => (a,a) -> g -> (a,g)
 integralRandomR  (a,b) g = case randomR (fromIntegral a :: Integer,
                                          fromIntegral b :: Integer) g of
-- 
1.7.5.4

