From: Charles Yin Date: Fri, 25 Nov 2011 01:41:04 +0000 (+1000) Subject: qmltestrunner reports wrong LOC for failed test cases X-Git-Tag: qt-v5.0.0-alpha1~1017 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fa2ec635aa77965dee617ea804947dcb557bde2e;p=profile%2Fivi%2Fqtdeclarative.git 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 --- 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;