Commit 4ff1deda authored by Klaus Aehlig's avatar Klaus Aehlig Committed by Petr Pudlak

Get QuickCheck 2.7 compatibility

Replace deprecated `printTestCase` by its replacement `counterexample`.
Note that commit 077c415a added a CPP-guarded fallback for QuickCheck < 2.7.
Signed-off-by: default avatarKlaus Aehlig <aehlig@google.com>
Reviewed-by: default avatarPetr Pudlak <pudlak@google.com>

Cherry-picked-from: 693db8a9Signed-off-by: default avatarPetr Pudlak <pudlak@google.com>
Reviewed-by: default avatarKlaus Aehlig <aehlig@google.com>
parent db399602
......@@ -257,12 +257,12 @@ prop_UpdateIdempotent =
forAll (arbitrary :: Gen [LockRequest TestLock]) $ \req ->
let (state', (answer', _)) = updateLocks owner req state
(state'', (answer'', nfy)) = updateLocks owner req state'
in conjoin [ printTestCase ("repeated updateLocks waiting gave different\
\ answers: " ++ show answer' ++ " /= "
++ show answer'') $ answer' == answer''
, printTestCase "updateLocks not idempotent"
in conjoin [ counterexample ("repeated updateLocks waiting gave different\
\ answers: " ++ show answer' ++ " /= "
++ show answer'') $ answer' == answer''
, counterexample "updateLocks not idempotent"
$ extRepr state' == extRepr state''
, printTestCase ("notifications (" ++ show nfy ++ ") on replay")
, counterexample ("notifications (" ++ show nfy ++ ") on replay")
$ S.null nfy
]
......@@ -322,13 +322,13 @@ prop_SafeUpdateWaitingCorrect =
forAll (arbitrary :: Gen [LockRequest TestLock]) $ \req ->
let (state', answer') = updateLocksWaiting prio owner req state
(state'', answer'') = safeUpdateLocksWaiting prio owner req state
in conjoin [ printTestCase ("safeUpdateLocksWaiting gave different answer: "
in conjoin [ counterexample ("safeUpdateLocksWaiting gave different answer: "
++ show answer' ++ " /= " ++ show answer'')
$ answer' == answer''
, printTestCase ("safeUpdateLocksWaiting gave different states\
\ after answer " ++ show answer' ++ ": "
++ show (extRepr state') ++ " /= "
++ show (extRepr state''))
, counterexample ("safeUpdateLocksWaiting gave different states\
\ after answer " ++ show answer' ++ ": "
++ show (extRepr state') ++ " /= "
++ show (extRepr state''))
$ extRepr state' == extRepr state''
]
......@@ -342,12 +342,12 @@ prop_SafeUpdateWaitingIdempotent =
forAll (arbitrary :: Gen [LockRequest TestLock]) $ \req ->
let (state', (answer', _)) = safeUpdateLocksWaiting prio owner req state
(state'', (answer'', nfy)) = safeUpdateLocksWaiting prio owner req state'
in conjoin [ printTestCase ("repeated safeUpdateLocks waiting gave different\
\ answers: " ++ show answer' ++ " /= "
++ show answer'') $ answer' == answer''
, printTestCase "safeUpdateLocksWaiting not idempotent"
in conjoin [ counterexample ("repeated safeUpdateLocks waiting gave different\
\ answers: " ++ show answer' ++ " /= "
++ show answer'') $ answer' == answer''
, counterexample "safeUpdateLocksWaiting not idempotent"
$ extRepr state' == extRepr state''
, printTestCase ("notifications (" ++ show nfy ++ ") on replay")
, counterexample ("notifications (" ++ show nfy ++ ") on replay")
$ S.null nfy
]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment