From 2bea70ee7f25462a6942dff15a21a6d5377433d3 Mon Sep 17 00:00:00 2001 From: ninerider Date: Fri, 25 Sep 2009 12:47:30 +0200 Subject: Fixed the image comparison tests for Windows Mobile 5 The image comparison reference snapshots were not up to date. Also the comparison ignores the title bar completely. Reviewed-by: banana joe --- .../windowsmobile/test/testQMenuBar_current.png | Bin 23702 -> 22964 bytes .../windowsmobile/test/testSimpleWidget_current.png | Bin 22034 -> 23841 bytes tests/auto/windowsmobile/test/tst_windowsmobile.cpp | 17 ++++++++++++++--- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/tests/auto/windowsmobile/test/testQMenuBar_current.png b/tests/auto/windowsmobile/test/testQMenuBar_current.png index d03e69a..f0042b8 100644 Binary files a/tests/auto/windowsmobile/test/testQMenuBar_current.png and b/tests/auto/windowsmobile/test/testQMenuBar_current.png differ diff --git a/tests/auto/windowsmobile/test/testSimpleWidget_current.png b/tests/auto/windowsmobile/test/testSimpleWidget_current.png index 09a10a3..8086c41 100644 Binary files a/tests/auto/windowsmobile/test/testSimpleWidget_current.png and b/tests/auto/windowsmobile/test/testSimpleWidget_current.png differ diff --git a/tests/auto/windowsmobile/test/tst_windowsmobile.cpp b/tests/auto/windowsmobile/test/tst_windowsmobile.cpp index 2d7c9ea..7a86a51 100644 --- a/tests/auto/windowsmobile/test/tst_windowsmobile.cpp +++ b/tests/auto/windowsmobile/test/tst_windowsmobile.cpp @@ -57,6 +57,8 @@ class tst_WindowsMobile : public QObject public: tst_WindowsMobile() { + qApp->setCursorFlashTime (24 * 3600 * 1000); // once a day + // qApp->setCursorFlashTime (INT_MAX); #ifdef Q_OS_WINCE_WM q_initDD(); #endif @@ -123,11 +125,20 @@ void compareScreenshots(const QString &image1, const QString &image2) QImage screenShot(image1); QImage original(image2); - //ignore the clock + // cut away the title bar before comparing + QDesktopWidget desktop; + QRect desktopFrameRect = desktop.frameGeometry(); + QRect desktopClientRect = desktop.availableGeometry(); + QPainter p1(&screenShot); QPainter p2(&original); - p1.fillRect(310, 6, 400, 34, Qt::black); - p2.fillRect(310, 6, 400, 34, Qt::black); + + //screenShot.save("scr1.png", "PNG"); + p1.fillRect(0, 0, desktopFrameRect.width(), desktopClientRect.y(), Qt::black); + p2.fillRect(0, 0, desktopFrameRect.width(), desktopClientRect.y(), Qt::black); + + //screenShot.save("scr2.png", "PNG"); + //original.save("orig1.png", "PNG"); QVERIFY(original == screenShot); } -- cgit v0.12