Commit b2ef08a5 authored by Robert Loehning's avatar Robert Loehning
Browse files

Squish: Shortened verifyBreakPoint()



Change-Id: I98ed094ec4a6ad2545ee804934fe1674c4b97d9e
Reviewed-by: default avatarChristian Stenger <christian.stenger@digia.com>
parent ce49ca84
......@@ -206,22 +206,14 @@ def verifyBreakPoint(bpToVerify):
if isinstance(bpToVerify, dict):
fileName = bpToVerify.keys()[0]
editor = getEditorForFileSuffix(fileName)
if editor == None:
return False
textPos = editor.textCursor().position()
line = str(editor.plainText)[:textPos].count("\n") + 1
windowTitle = str(waitForObject(":Qt Creator_Core::Internal::MainWindow").windowTitle)
if fileName in windowTitle:
test.passes("Creator's window title changed according to current file")
else:
test.fail("Creator's window title did not change according to current file")
if line == bpToVerify.values()[0]:
test.passes("Breakpoint at expected line (%d) inside expected file (%s)"
% (line, fileName))
return True
else:
test.fail("Breakpoint did not match expected line/file",
"Found: %d in %s" % (line, fileName))
if editor:
textPos = editor.textCursor().position()
line = str(editor.plainText)[:textPos].count("\n") + 1
windowTitle = str(waitForObject(":Qt Creator_Core::Internal::MainWindow").windowTitle)
test.verify(fileName in windowTitle,
"Verify that Creator's window title changed according to current file")
return test.compare(line, bpToVerify.values()[0],
"Compare hit breakpoint to expected line number in %s" % fileName)
else:
test.fatal("Expected a dict for bpToVerify - got '%s'" % className(bpToVerify))
return False
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