Ticket #5601: 0002-Fix-test-suite-and-get-rid-of-some-warnings.patch

File 0002-Fix-test-suite-and-get-rid-of-some-warnings.patch, 3.4 KB (added by basvandijk, 2 years ago)
  • Data/ByteString/Fusion.hs

    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 b  
    11{-# OPTIONS_HADDOCK hide #-} 
     2{-# LANGUAGE CPP #-} 
    23#if __GLASGOW_HASKELL__ >= 701 
    34{-# LANGUAGE Safe #-} 
    45#endif 
  • Data/ByteString/Internal.hs

    diff --git a/Data/ByteString/Internal.hs b/Data/ByteString/Internal.hs
    index 1dce1c1..d39647b 100644
    a b module Data.ByteString.Internal ( 
    6868import Foreign.ForeignPtr       (ForeignPtr, withForeignPtr) 
    6969import Foreign.Ptr              (Ptr, FunPtr, plusPtr) 
    7070import Foreign.Storable         (Storable(..)) 
    71 import Foreign.C.Types          (CInt(..), CSize(..), CULong(..)) 
     71import Foreign.C.Types          (CInt, CSize, CULong) 
    7272import Foreign.C.String         (CString) 
    7373 
    7474import Control.DeepSeq          (NFData) 
  • bytestring.cabal

    diff --git a/bytestring.cabal b/bytestring.cabal
    index ec86c75..79fd364 100644
    a b test-suite prop-compiled 
    7171  type:             exitcode-stdio-1.0 
    7272  main-is:          Properties.hs 
    7373  hs-source-dirs:   . tests 
    74   build-depends:    base, deepseq, random, directory, 
     74  build-depends:    base, deepseq, random >= 1.0.1, directory, 
    7575                    QuickCheck >= 2.3 && < 3 
    7676  if impl(ghc >= 6.10) 
    7777    build-depends:  ghc-prim 
  • tests/Properties.hs

    diff --git a/tests/Properties.hs b/tests/Properties.hs
    index 55bf350..2edbe1c 100644
    a b  
    1 {-# LANGUAGE PatternSignatures #-} 
     1{-# LANGUAGE ScopedTypeVariables, BangPatterns #-} 
    22-- 
    33-- Must have rules off, otherwise the fusion rules will replace the rhs 
    44-- with the lhs, and we only end up testing lhs == lhs 
     
    88-- -fhpc interferes with rewrite rules firing. 
    99-- 
    1010 
    11 import Foreign 
     11import Foreign.Storable (peekElemOff, pokeElemOff) 
     12import Foreign.Marshal.Alloc (free) 
    1213import Foreign.ForeignPtr 
    1314import Foreign.Marshal.Array 
    1415import GHC.Ptr 
  • tests/QuickCheckUtils.hs

    diff --git a/tests/QuickCheckUtils.hs b/tests/QuickCheckUtils.hs
    index d07fc91..7a20b0b 100644
    a b  
    1 {-# OPTIONS_GHC -fglasgow-exts #-} 
     1{-# LANGUAGE MultiParamTypeClasses, FlexibleInstances #-} 
    22-- 
    33-- Uses multi-param type classes 
    44-- 
    mytest p n = do 
    7474 
    7575------------------------------------------------------------------------ 
    7676 
    77 instance Random Word8 where 
    78   randomR = integralRandomR 
    79   random = randomR (minBound,maxBound) 
    80  
    81 instance Random CChar where 
    82   randomR = integralRandomR 
    83   random = randomR (minBound,maxBound) 
    84  
    85 instance Random Int64 where 
    86   randomR = integralRandomR 
    87   random  = randomR (minBound,maxBound) 
    88  
    8977integralRandomR :: (Integral a, RandomGen g) => (a,a) -> g -> (a,g) 
    9078integralRandomR  (a,b) g = case randomR (fromIntegral a :: Integer, 
    9179                                         fromIntegral b :: Integer) g of