From fdb2e8d45d713e3e9170b3415a3cd5602688b99b Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Mon, 11 Feb 2008 12:02:20 +0000 Subject: [PATCH] Printed out more information when generateMapping fails (keys to VarMap not matching) --- checks/ArrayUsageCheckTest.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/checks/ArrayUsageCheckTest.hs b/checks/ArrayUsageCheckTest.hs index b916950..52cd592 100644 --- a/checks/ArrayUsageCheckTest.hs +++ b/checks/ArrayUsageCheckTest.hs @@ -838,9 +838,9 @@ testIndexes = TestList -- from one to the indexes of the next. If any of the keys in the map don't match -- (i.e. if (keys m0 /= keys m1)) Nothing will be returned -generateMapping :: TestMonad m r => VarMap -> VarMap -> m [(CoeffIndex,CoeffIndex)] -generateMapping m0 m1 - = do testEqual "Keys in variable mapping" (Map.keys m0) (Map.keys m1) +generateMapping :: TestMonad m r => String -> VarMap -> VarMap -> m [(CoeffIndex,CoeffIndex)] +generateMapping msg m0 m1 + = do testEqual ("Keys in variable mapping " ++ msg) (Map.keys m0) (Map.keys m1) return $ Map.elems $ zipMap mergeMaybe m0 m1 -- | Given a forward mapping list, translates equations across @@ -915,7 +915,7 @@ assertEquivalentProblems title exp act m ( label, ((EqualityProblem, InequalityProblem), (EqualityProblem, InequalityProblem))) transform s (el, vmexp, (e_eq, e_ineq)) (al, vmact, (a_eq, a_ineq)) = do testEqualCustomShow s "Labels did not match" el al - mapping <- generateMapping (vmexp) (vmact) + mapping <- generateMapping (showListCustom showOccam $ sort . nub $ map (fst . fst . fst3) exp ++ map (fst . snd . fst3) exp) (vmexp) (vmact) translatedExp <- translateEquations mapping (resize e_eq, resize e_ineq) return (el, (sortP translatedExp, sortP (resize a_eq, resize a_ineq))) where