[Libreoffice-commits] .: 2 commits - sw/qa

Caolán McNamara caolan at kemper.freedesktop.org
Fri Jun 17 08:43:55 PDT 2011


 sw/qa/core/filters-test.cxx |   17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

New commits:
commit 71ba5b400ff6d8ab505ffd4dd95025355b2a08ad
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Jun 17 16:43:45 2011 +0100

    make it easy to dump undetermined pass/fail files in for testing

diff --git a/sw/qa/core/data/ww8/indeterminate/.gitignore b/sw/qa/core/data/ww8/indeterminate/.gitignore
new file mode 100644
index 0000000..e69de29
commit 280723d57f0b44838061c36fd126fc620a52104a
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Jun 17 16:43:19 2011 +0100

    make it easy to dump undetermined pass/fail files in for testing

diff --git a/sw/qa/core/filters-test.cxx b/sw/qa/core/filters-test.cxx
index 75262f7..6a2d611 100644
--- a/sw/qa/core/filters-test.cxx
+++ b/sw/qa/core/filters-test.cxx
@@ -65,6 +65,8 @@
 SO2_DECL_REF(SwDocShell)
 SO2_IMPL_REF(SwDocShell)
 
+const int indeterminate = 2;
+
 using namespace ::com::sun::star;
 
 /* Implementation of Filters test */
@@ -78,7 +80,7 @@ public:
     virtual void setUp();
     virtual void tearDown();
 
-    void recursiveScan(const rtl::OUString &rFilter, const rtl::OUString &rURL, const rtl::OUString &rUserData, bool bExpected);
+    void recursiveScan(const rtl::OUString &rFilter, const rtl::OUString &rURL, const rtl::OUString &rUserData, int nExpected);
     bool load(const rtl::OUString &rFilter, const rtl::OUString &rURL, const rtl::OUString &rUserData);
 
     bool testLoad(const rtl::OUString &rFilter,
@@ -115,7 +117,7 @@ bool FiltersTest::load(const rtl::OUString &rFilter, const rtl::OUString &rURL,
     return xDocShRef->DoLoad(&aSrcMed);
 }
 
-void FiltersTest::recursiveScan(const rtl::OUString &rFilter, const rtl::OUString &rURL, const rtl::OUString &rUserData, bool bExpected)
+void FiltersTest::recursiveScan(const rtl::OUString &rFilter, const rtl::OUString &rURL, const rtl::OUString &rUserData, int nExpected)
 {
     osl::Directory aDir(rURL);
 
@@ -127,7 +129,7 @@ void FiltersTest::recursiveScan(const rtl::OUString &rFilter, const rtl::OUStrin
         aItem.getFileStatus(aFileStatus);
         rtl::OUString sURL = aFileStatus.getFileURL();
         if (aFileStatus.getFileType() == osl::FileStatus::Directory)
-            recursiveScan(rFilter, sURL, rUserData, bExpected);
+            recursiveScan(rFilter, sURL, rUserData, nExpected);
         else
         {
             sal_Int32 nGitIndex = sURL.lastIndexOfAsciiL(
@@ -138,7 +140,12 @@ void FiltersTest::recursiveScan(const rtl::OUString &rFilter, const rtl::OUStrin
 
             bool bRes = load(rFilter, sURL, rUserData);
             rtl::OString aRes(rtl::OUStringToOString(sURL, osl_getThreadTextEncoding()));
-            CPPUNIT_ASSERT_MESSAGE(aRes.getStr(), bRes == bExpected);
+            if (nExpected == indeterminate)
+            {
+                printf("indeterminate pass/fail %s was %d\n", aRes.getStr(), bRes);
+                continue;
+            }
+            CPPUNIT_ASSERT_MESSAGE(aRes.getStr(), bRes == nExpected);
         }
     }
     CPPUNIT_ASSERT(osl::FileBase::E_None == aDir.close());
@@ -176,6 +183,8 @@ void FiltersTest::testCVEs()
 
     recursiveScan(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MS Word 97")), m_aSrcRoot + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/clone/writer/sw/qa/core/data/ww8/fail")), rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CWW8")), false);
 
+    recursiveScan(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MS Word 97")), m_aSrcRoot + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/clone/writer/sw/qa/core/data/ww8/indeterminate")), rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CWW8")), indeterminate);
+
 #endif
 }
 


More information about the Libreoffice-commits mailing list