aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/imports/testlib/TestCase.qml13
-rw-r--r--src/qmltest/quicktestresult.cpp4
-rw-r--r--src/qmltest/quicktestresult_p.h2
3 files changed, 10 insertions, 9 deletions
diff --git a/src/imports/testlib/TestCase.qml b/src/imports/testlib/TestCase.qml
index fd04c786a2..432f96ccf1 100644
--- a/src/imports/testlib/TestCase.qml
+++ b/src/imports/testlib/TestCase.qml
@@ -271,8 +271,8 @@ Item {
}
function compare(actual, expected, msg) {
- var act = qtest_formatValue(actual)
- var exp = qtest_formatValue(expected)
+ var act = testCase.qtest_formatValue(actual)
+ var exp = testCase.qtest_formatValue(expected)
var success = qtest_compareInternal(actual, expected)
if (msg === undefined) {
@@ -297,8 +297,8 @@ Item {
i += 50
}
var actual = obj[prop]
- var act = qtest_formatValue(actual)
- var exp = qtest_formatValue(value)
+ var act = testCase.qtest_formatValue(actual)
+ var exp = testCase.qtest_formatValue(value)
var success = qtest_compareInternal(actual, value)
if (!qtest_results.compare(success, "property " + prop, act, exp, util.callerFile(), util.callerLine()))
throw new Error("QtQuickTest::fail")
@@ -348,7 +348,7 @@ Item {
function warn(msg) {
if (msg === undefined)
msg = ""
- qtest_results.warn(msg);
+ qtest_results.warn(msg, util.callerFile(), util.callerLine());
}
function ignoreWarning(msg) {
@@ -619,7 +619,8 @@ Item {
qtest_results.dataTag = ""
}
if (!haveData)
- qtest_results.warn("no data supplied for " + prop + "() by " + datafunc + "()")
+ qtest_results.warn("no data supplied for " + prop + "() by " + datafunc + "()"
+ , util.callerFile(), util.callerLine());
qtest_results.clearTestTable()
}
} else if (isBenchmark) {
diff --git a/src/qmltest/quicktestresult.cpp b/src/qmltest/quicktestresult.cpp
index 1924be0d26..7d8080fc08 100644
--- a/src/qmltest/quicktestresult.cpp
+++ b/src/qmltest/quicktestresult.cpp
@@ -430,9 +430,9 @@ bool QuickTestResult::expectFailContinue
QTest::Continue, qtest_fixFile(file).toLatin1().constData(), line);
}
-void QuickTestResult::warn(const QString &message)
+void QuickTestResult::warn(const QString &message, const QString &file, int line)
{
- QTestLog::warn(message.toLatin1().constData(), 0, 0);
+ QTestLog::warn(message.toLatin1().constData(), qtest_fixFile(file).toLatin1().constData(), line);
}
void QuickTestResult::ignoreWarning(const QString &message)
diff --git a/src/qmltest/quicktestresult_p.h b/src/qmltest/quicktestresult_p.h
index 8707b563e4..fdadf9c3a3 100644
--- a/src/qmltest/quicktestresult_p.h
+++ b/src/qmltest/quicktestresult_p.h
@@ -134,7 +134,7 @@ public Q_SLOTS:
const QString &file, int line);
bool expectFailContinue(const QString &tag, const QString &comment,
const QString &file, int line);
- void warn(const QString &message);
+ void warn(const QString &message, const QString &file, int line);
void ignoreWarning(const QString &message);