Commit 6fe810f5 authored by Robert Loehning's avatar Robert Loehning

Squish: Compare sets directly instead of differences

Generates better output with less code.

Change-Id: I3a5fa02c5aca97561e20dc4ddf4153596a3a60ae
Reviewed-by: default avatarChristian Stenger <christian.stenger@theqtcompany.com>
parent 34131303
......@@ -106,9 +106,8 @@ def testSaveChangesAndMakeWritable(modifiedFiles, readOnlyFiles):
"window=':WritePermissions_Core::Internal::ReadOnlyFilesDialog'}")
items = map(os.path.expanduser, map(os.path.join, dumpItems(filesTree.model(), column=4),
dumpItems(filesTree.model(), column=3)))
difference = set(readOnlyFiles) ^ set(items)
test.verify(len(difference) == 0, "Verifying whether all modified files without write "
"permission are listed.")
test.compare(set(readOnlyFiles), set(items),
"Verifying whether all modified files without write permission are listed.")
clickButton("{text='Change Permission' type='QPushButton' visible='1' unnamed='1' "
"window=':WritePermissions_Core::Internal::ReadOnlyFilesDialog'}")
except:
......
......@@ -299,12 +299,8 @@ def __compareDebuggers__(foundDebuggers, expectedDebuggers):
else:
foundSet = set(foundDebuggers)
expectedSet = set(expectedDebuggers)
if not (test.verify(not foundSet.symmetric_difference(expectedSet),
"Verifying expected and found debuggers match.")):
test.log("Found debuggers: %s" % foundDebuggers,
"Expected debuggers: %s" % expectedDebuggers)
return False
return True
return test.compare(foundSet, expectedSet,
"Verifying expected and found debuggers match.")
def __lowerStrs__(iterable):
for it in iterable:
......
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