From 5a9b670ef04232c7cd5017bd5e241c6ed975be6e Mon Sep 17 00:00:00 2001
From: Shane Kearns <shane.kearns@accenture.com>
Date: Tue, 16 Nov 2010 13:43:14 +0000
Subject: Test coverage - ensure tst_qfileinfo tests dir & absoluteDir
 functions

The existing dir test function is appropriate, now it checks the dir
functions as well as the path functions.

Reviewed-By: Prasanth Ullattil
---
 tests/auto/qfileinfo/qfileinfo.pro     |  1 +
 tests/auto/qfileinfo/tst_qfileinfo.cpp | 13 +++++++++++--
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/tests/auto/qfileinfo/qfileinfo.pro b/tests/auto/qfileinfo/qfileinfo.pro
index 101128c..fdbcd26 100644
--- a/tests/auto/qfileinfo/qfileinfo.pro
+++ b/tests/auto/qfileinfo/qfileinfo.pro
@@ -30,3 +30,4 @@ wince* {
     DEFINES += SRCDIR=\\\"$$PWD/\\\"
 }
 
+contains(QT_CONFIG, qt3support): QT += qt3support
diff --git a/tests/auto/qfileinfo/tst_qfileinfo.cpp b/tests/auto/qfileinfo/tst_qfileinfo.cpp
index 07e33d3..d021df5 100644
--- a/tests/auto/qfileinfo/tst_qfileinfo.cpp
+++ b/tests/auto/qfileinfo/tst_qfileinfo.cpp
@@ -705,10 +705,19 @@ void tst_QFileInfo::dir()
     QFETCH(QString, expected);
 
     QFileInfo fi(file);
-    if (absPath)
+    if (absPath) {
         QCOMPARE(fi.absolutePath(), expected);
-    else
+        QCOMPARE(fi.absoluteDir().path(), expected);
+#ifdef QT3_SUPPORT
+        QCOMPARE(fi.dir(true).path(), expected);
+#endif
+    } else {
         QCOMPARE(fi.path(), expected);
+        QCOMPARE(fi.dir().path(), expected);
+#ifdef QT3_SUPPORT
+        QCOMPARE(fi.dir(false).path(), expected);
+#endif
+    }
 }
 
 
-- 
cgit v0.12