From fa2ec635aa77965dee617ea804947dcb557bde2e Mon Sep 17 00:00:00 2001 From: Charles Yin Date: Fri, 25 Nov 2011 11:41:04 +1000 Subject: [PATCH] qmltestrunner reports wrong LOC for failed test cases The callerFile() and callerLine() calls GetFrame() with incorrect index, the right index should be the current frame index + 1. Task-number:QTBUG-22887 Change-Id: I694073b80853bf66e02414a158c8e155f8be8390 Reviewed-by: Chris Adams --- src/imports/testlib/main.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/imports/testlib/main.cpp b/src/imports/testlib/main.cpp index c78a1c4..c7d7d91 100644 --- a/src/imports/testlib/main.cpp +++ b/src/imports/testlib/main.cpp @@ -108,8 +108,8 @@ public Q_SLOTS: { v8::Local stacks = v8::StackTrace::CurrentStackTrace(10, v8::StackTrace::kDetailed); int count = stacks->GetFrameCount(); - if (count >= frameIndex + 2) { - v8::Local frame = stacks->GetFrame(frameIndex + 2); + if (count >= frameIndex + 1) { + v8::Local frame = stacks->GetFrame(frameIndex + 1); return QDeclarativeV8Handle::fromHandle(frame->GetScriptNameOrSourceURL()); } return QDeclarativeV8Handle(); @@ -118,8 +118,8 @@ public Q_SLOTS: { v8::Local stacks = v8::StackTrace::CurrentStackTrace(10, v8::StackTrace::kDetailed); int count = stacks->GetFrameCount(); - if (count >= frameIndex + 2) { - v8::Local frame = stacks->GetFrame(frameIndex + 2); + if (count >= frameIndex + 1) { + v8::Local frame = stacks->GetFrame(frameIndex + 1); return frame->GetLineNumber(); } return -1; -- 2.7.4