On Wed, Feb 5, 2014 at 11:16 AM, Jose A. Lopes <[email protected]> wrote:
> Good catch :)
>
> There are other occurrences of this bug in the same module and other
> modules. Could you please add them to this patch?
I caught a few more by git-grepping for "Different result". Of course,
now the commit requires a commit message...
diff --git a/test/hs/Test/Ganeti/JQueue.hs b/test/hs/Test/Ganeti/JQueue.hs
index bb53a2e..7f8f36d 100644
--- a/test/hs/Test/Ganeti/JQueue.hs
+++ b/test/hs/Test/Ganeti/JQueue.hs
@@ -170,7 +170,7 @@ case_JobStatusPri_py_equiv = do
let hs_sp = (jobStatusToRaw $ calcJobStatus job,
calcJobPriority job)
in assertEqual ("Different result after encoding/decoding for " ++
- show job) py_sp hs_sp
+ show job) hs_sp py_sp
) $ zip decoded jobs
-- | Tests listing of Job ids.
diff --git a/test/hs/Test/Ganeti/Objects.hs b/test/hs/Test/Ganeti/Objects.hs
index 61debaf..027a14f 100644
--- a/test/hs/Test/Ganeti/Objects.hs
+++ b/test/hs/Test/Ganeti/Objects.hs
@@ -404,7 +404,7 @@ casePyCompatNetworks = do
HUnit.assertEqual "Mismatch in number of returned networks"
(length decoded) (length networks_with_properties)
mapM_ (uncurry (HUnit.assertEqual "Different result after encoding/decoding")
- ) $ zip decoded networks_with_properties
+ ) $ zip networks_with_properties decoded
-- | Creates a tuple of the given network combined with some of its properties
-- to be compared against the same properties generated by the python code.
@@ -447,7 +447,7 @@ casePyCompatNodegroups = do
HUnit.assertEqual "Mismatch in number of returned node groups"
(length decoded) (length groups)
mapM_ (uncurry (HUnit.assertEqual "Different result after encoding/decoding")
- ) $ zip decoded groups
+ ) $ zip groups decoded
-- | Generates a node group with up to 3 networks.
-- | FIXME: This generates still somewhat completely random data,
without normal
@@ -541,7 +541,7 @@ casePyCompatInstances = do
HUnit.assertEqual "Mismatch in number of returned instances"
(length decoded) (length instances)
mapM_ (uncurry (HUnit.assertEqual "Different result after encoding/decoding")
- ) $ zip decoded instances
+ ) $ zip instances decoded
-- | Tests that the logical ID is correctly found in a plain disk
caseIncludeLogicalIdPlain :: HUnit.Assertion
diff --git a/test/hs/Test/Ganeti/OpCodes.hs b/test/hs/Test/Ganeti/OpCodes.hs
index 429e379..c312506 100644
--- a/test/hs/Test/Ganeti/OpCodes.hs
+++ b/test/hs/Test/Ganeti/OpCodes.hs
@@ -636,7 +636,7 @@ case_py_compat_fields = do
HUnit.assertEqual "Mismatch in OP_ID" py_id hs_id
HUnit.assertEqual ("Mismatch in fields for " ++ hs_id)
py_flds hs_flds
- ) $ zip py_fields hs_fields
+ ) $ zip hs_fields py_fields
-- | Checks that setOpComment works correctly.
prop_setOpComment :: OpCodes.MetaOpCode -> String -> Property
diff --git a/test/hs/Test/Ganeti/Runtime.hs b/test/hs/Test/Ganeti/Runtime.hs
index 605859f..0c15fbe 100644
--- a/test/hs/Test/Ganeti/Runtime.hs
+++ b/test/hs/Test/Ganeti/Runtime.hs
@@ -64,7 +64,7 @@ case_LogFiles = do
assertEqual "Mismatch in number of returned log files"
(length decoded) (length daemons)
mapM_ (uncurry (assertEqual "Different result after encoding/decoding")
- ) $ zip decoded dfiles
+ ) $ zip dfiles decoded
-- | Tests the compatibility between Haskell and Python users.
case_UsersGroups :: Assertion
@@ -114,9 +114,9 @@ case_UsersGroups = do
assertEqual "Mismatch in number of returned users"
(length py_groups) (length groups)
mapM_ (uncurry (assertEqual "Different result for users")
- ) $ zip py_users users
+ ) $ zip users py_users
mapM_ (uncurry (assertEqual "Different result for groups")
- ) $ zip py_groups groups
+ ) $ zip groups py_groups
testSuite "Runtime"
[ 'case_LogFiles
--
Raffa Santi
Google Germany GmbH
Dienerstr. 12
80331 München
Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg
Geschäftsführer: Graham Law, Christine Elizabeth Flores