From 049fa03c2f8c52e88bf5c5d205beddc92784c0c2 Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Wed, 23 Apr 2014 08:33:33 +0200 Subject: Check the right object's height in qCompare for QImage and QPixmap. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes http://www.viva64.com/en/b/0251/, Typo No. 3 and 4 Change-Id: Icbd33534dbf424e00e4c351ae5ee0e3daa99e7b9 Reviewed-by: Jørgen Lind --- src/testlib/qtest_gui.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/testlib') diff --git a/src/testlib/qtest_gui.h b/src/testlib/qtest_gui.h index a9ac7777c3..7c68b0fd77 100644 --- a/src/testlib/qtest_gui.h +++ b/src/testlib/qtest_gui.h @@ -98,7 +98,7 @@ inline bool qCompare(QImage const &t1, QImage const &t2, } if (t1Null && t2Null) return compare_helper(true, 0, 0, 0, actual, expected, file, line); - if (t1.width() != t2.width() || t2.height() != t2.height()) { + if (t1.width() != t2.width() || t1.height() != t2.height()) { qsnprintf(msg, 1024, "Compared QImages differ in size.\n" " Actual (%s): %dx%d\n" " Expected (%s): %dx%d", @@ -132,7 +132,7 @@ inline bool qCompare(QPixmap const &t1, QPixmap const &t2, const char *actual, c } if (t1Null && t2Null) return compare_helper(true, 0, 0, 0, actual, expected, file, line); - if (t1.width() != t2.width() || t2.height() != t2.height()) { + if (t1.width() != t2.width() || t1.height() != t2.height()) { qsnprintf(msg, 1024, "Compared QPixmaps differ in size.\n" " Actual (%s): %dx%d\n" " Expected (%s): %dx%d", -- cgit v1.2.3 From eaffcab287347badbf44e26416f5c2136101e1d2 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 3 Apr 2014 14:58:03 -0700 Subject: Doc: add info about the -perf benchmark switch to QtTest's manual Change-Id: I923dcf4f59db8281800950684fdd6dcc6715508e Reviewed-by: Jerome Pasion --- src/testlib/doc/src/qttestlib-manual.qdoc | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'src/testlib') diff --git a/src/testlib/doc/src/qttestlib-manual.qdoc b/src/testlib/doc/src/qttestlib-manual.qdoc index 13654972ec..4125e63ddc 100644 --- a/src/testlib/doc/src/qttestlib-manual.qdoc +++ b/src/testlib/doc/src/qttestlib-manual.qdoc @@ -315,12 +315,15 @@ \row \li CPU tick counter \li -tickcounter \li Windows, Mac OS X, Linux, many UNIX-like systems. - \row \li Valgrind Callgrind - \li -callgrind - \li Linux (if installed) \row \li Event Counter \li -eventcounter \li All platforms + \row \li Valgrind Callgrind + \li -callgrind + \li Linux (if installed) + \row \li Linux Perf + \li -perf + \li Linux \endtable In short, walltime is always available but requires many repetitions to @@ -335,6 +338,16 @@ that were received by the event loop before they are sent to their corresponding targets (this might include non-Qt events). + The Linux Performance Monitoring solution is available only on Linux and + provides many different counters, which can be selected by passing an + additional option \c {-perfcounter countername}, such as \c {-perfcounter + cache-misses}, \c {-perfcounter branch-misses}, or \c {-perfcounter + l1d-load-misses}. The default counter is \c {cpu-cycles}. The full list of + counters can be obtained by running any benchmark executable with the + option \c -perfcounterlist. + + Note that using the performance counter may require enabling access to non-privileged applications. + \note Depending on the device configuration, tick counters on the Windows CE platform may not be as fine-grained, compared to other platforms. Devices that do not support high-resolution timers default to -- cgit v1.2.3 From 090124eab6f184abbe9be04f4bc1a9eee5285207 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Fri, 28 Feb 2014 21:36:13 -0800 Subject: Remove duplicate symbol name: QTest::currentAppName It's declared in qtestcase.h as a function, so let's not declare the one in qtestresult.cpp as a static variable. None of the variables in qtestresult.cpp need to be in the QTest namespace, but we don't need to change them now. Change-Id: If6cc34642fdfe3ccda3b8cea7d053ead0db9ccbd Reviewed-by: Olivier Goffart --- src/testlib/qtestresult.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/testlib') diff --git a/src/testlib/qtestresult.cpp b/src/testlib/qtestresult.cpp index a9abca0ef8..859f6743cd 100644 --- a/src/testlib/qtestresult.cpp +++ b/src/testlib/qtestresult.cpp @@ -51,6 +51,8 @@ #include #include +static const char *currentAppName = 0; + QT_BEGIN_NAMESPACE namespace QTest @@ -64,8 +66,6 @@ namespace QTest static const char *expectFailComment = 0; static int expectFailMode = 0; - - static const char *currentAppName = 0; } void QTestResult::reset() @@ -322,12 +322,12 @@ bool QTestResult::skipCurrentTest() void QTestResult::setCurrentAppName(const char *appName) { - QTest::currentAppName = appName; + ::currentAppName = appName; } const char *QTestResult::currentAppName() { - return QTest::currentAppName; + return ::currentAppName; } QT_END_NAMESPACE -- cgit v1.2.3 From fd644f3bd0eee59a9cacfd0dd51a620c31c8e87d Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Wed, 2 Apr 2014 20:51:55 +0200 Subject: Improve accessibility event failure output MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Simpler code and more information ;) Change-Id: I5ca6b2ee88e51dbbd3ec2f08c4ea79bc11b649fa Reviewed-by: Jan Arve Sæther --- src/testlib/qtestaccessible.h | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/testlib') diff --git a/src/testlib/qtestaccessible.h b/src/testlib/qtestaccessible.h index f27651c3ad..ef6f61bd82 100644 --- a/src/testlib/qtestaccessible.h +++ b/src/testlib/qtestaccessible.h @@ -253,12 +253,10 @@ private: { QString rc; QDebug str = QDebug(&rc).nospace(); - str << "Event " << needle->object() << ", type: " - << needle->type() << ", child: " << needle->child() - << " not found at head of event list of size " << haystack.size() << " :"; + str << "Event " << *needle + << " not found at head of event list of size " << haystack.size() << " :"; Q_FOREACH (const QAccessibleEvent *e, haystack) - str << ' ' << e->object() << ", type: " - << e->type() << ", child: " << e->child(); + str << ' ' << *e; return rc; } -- cgit v1.2.3