[Libreoffice-commits] core.git: sc/qa

Andreas Heinisch (via logerrit) logerrit at kemper.freedesktop.org
Wed Jul 15 17:52:10 UTC 2020


 sc/qa/extras/macros-test.cxx              |   14 +++++++++++++-
 sc/qa/extras/testdocuments/tdf107885.xlsm |binary
 2 files changed, 13 insertions(+), 1 deletion(-)

New commits:
commit f013b5127e3048914d829cf918df2a43f133d108
Author:     Andreas Heinisch <andreas.heinisch at yahoo.de>
AuthorDate: Mon Jul 13 21:58:37 2020 +0200
Commit:     Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Wed Jul 15 19:51:23 2020 +0200

    tdf#107885: sc_macros_test: Add unittest
    
    Split unit test for auto filter into two separate functions testing
    string and numeric conditions.
    
    Change-Id: I940718215bf3d1de490726a6e430b3cdd7b62f2f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98694
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>

diff --git a/sc/qa/extras/macros-test.cxx b/sc/qa/extras/macros-test.cxx
index 2630484e4122..af619d12459c 100644
--- a/sc/qa/extras/macros-test.cxx
+++ b/sc/qa/extras/macros-test.cxx
@@ -388,9 +388,10 @@ void ScMacrosTest::testTdf107885()
     CPPUNIT_ASSERT(!rDoc.RowHidden(3,0));
     CPPUNIT_ASSERT(!rDoc.RowHidden(4,0));
 
+    // Call auto filter macro using a string condition
     SfxObjectShell::CallXScript(
         xComponent,
-        "vnd.sun.Star.script:VBAProject.Module1.AF?language=Basic&location=document",
+        "vnd.sun.Star.script:VBAProject.Module1.AFString?language=Basic&location=document",
         aParams, aRet, aOutParamIndex, aOutParam);
 
     //Without the fix in place, all rows in autofilter would have been hidden
@@ -399,6 +400,17 @@ void ScMacrosTest::testTdf107885()
     CPPUNIT_ASSERT(!rDoc.RowHidden(3,0));
     CPPUNIT_ASSERT(!rDoc.RowHidden(4,0));
 
+    // Call auto filter macro using a numeric condition without any locale
+    SfxObjectShell::CallXScript(
+        xComponent,
+        "vnd.sun.Star.script:VBAProject.Module1.AFNumeric?language=Basic&location=document",
+        aParams, aRet, aOutParamIndex, aOutParam);
+
+    CPPUNIT_ASSERT(rDoc.RowHidden(1,0));
+    CPPUNIT_ASSERT(rDoc.RowHidden(2,0));
+    CPPUNIT_ASSERT(!rDoc.RowHidden(3,0));
+    CPPUNIT_ASSERT(!rDoc.RowHidden(4,0));
+
     pDocSh->DoClose();
 }
 
diff --git a/sc/qa/extras/testdocuments/tdf107885.xlsm b/sc/qa/extras/testdocuments/tdf107885.xlsm
index 9553ba9d88ca..f16d8b1b3837 100644
Binary files a/sc/qa/extras/testdocuments/tdf107885.xlsm and b/sc/qa/extras/testdocuments/tdf107885.xlsm differ


More information about the Libreoffice-commits mailing list