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

Jan Kantert jan-lo at kantert.net
Thu Feb 19 20:57:14 PST 2015


 sc/qa/unit/data/ods/blank.ods          |binary
 sc/qa/unit/subsequent_filters-test.cxx |   24 ++++++++++++++++++++++++
 sc/qa/unit/ucalc.hxx                   |    2 --
 sc/qa/unit/ucalc_formula.cxx           |   19 -------------------
 4 files changed, 24 insertions(+), 21 deletions(-)

New commits:
commit 023fb64de84792337092f98d416e83a235a852fb
Author: Jan Kantert <jan-lo at kantert.net>
Date:   Wed Feb 18 11:17:42 2015 +0100

    move unit test for tdf#89330 to subsequent_filters-test and enable it
    
    Change-Id: Ia64ed4735a8ce13780d090688b0e206c5c080b5b

diff --git a/sc/qa/unit/data/ods/blank.ods b/sc/qa/unit/data/ods/blank.ods
new file mode 100644
index 0000000..cb57e98
Binary files /dev/null and b/sc/qa/unit/data/ods/blank.ods differ
diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx
index 2012876..ba48b12 100644
--- a/sc/qa/unit/subsequent_filters-test.cxx
+++ b/sc/qa/unit/subsequent_filters-test.cxx
@@ -52,6 +52,8 @@
 #include <scopetools.hxx>
 #include <columnspanset.hxx>
 #include <tokenstringcontext.hxx>
+#include <formula/errorcodes.hxx>
+
 
 #include <com/sun/star/drawing/XDrawPageSupplier.hpp>
 #include <com/sun/star/drawing/XControlShape.hpp>
@@ -139,6 +141,7 @@ public:
      * by one. (fdo#76032)
      */
     void testRowIndex1BasedXLSX();
+    void testErrorOnExternalReferences();
 
     //misc tests unrelated to the import filters
 #if !defined(MACOSX) && !defined(DRAGONFLY) && !defined(WNT)
@@ -275,6 +278,7 @@ public:
     CPPUNIT_TEST(testCopyMergedNumberFormats);
     CPPUNIT_TEST(testVBAUserFunctionXLSM);
     CPPUNIT_TEST(testEmbeddedImageXLS);
+    CPPUNIT_TEST(testErrorOnExternalReferences);
     CPPUNIT_TEST_SUITE_END();
 
 private:
@@ -2815,6 +2819,26 @@ void ScFiltersTest::testEmbeddedImageXLS()
     xDocSh->DoClose();
 }
 
+void ScFiltersTest::testErrorOnExternalReferences()
+{
+    ScDocShellRef xDocSh = loadDoc("blank.", ODS);
+    CPPUNIT_ASSERT_MESSAGE("Failed to open empty doc", xDocSh.Is());
+
+    ScDocument& rDoc = xDocSh->GetDocument();
+
+    // Test tdf#89330
+    rDoc.SetString(ScAddress(0,0,0), "='file:///Path/To/FileA.ods'#$Sheet1.A1A");
+
+    ScFormulaCell* pFC = rDoc.GetFormulaCell(ScAddress(0,0,0));
+    CPPUNIT_ASSERT(pFC);
+    CPPUNIT_ASSERT_EQUAL(ScErrorCodes::errNoName, pFC->GetErrCode());
+
+    if (!checkFormula(rDoc, ScAddress(0,0,0), "'file:///Path/To/FileA.ods'#$Sheet1.A1A"))
+        CPPUNIT_FAIL("Formula changed");
+
+    xDocSh->DoClose();
+}
+
 ScFiltersTest::ScFiltersTest()
       : ScBootstrapFixture( "/sc/qa/unit/data" )
 {
diff --git a/sc/qa/unit/ucalc.hxx b/sc/qa/unit/ucalc.hxx
index 1937e4a..d9f1e58 100644
--- a/sc/qa/unit/ucalc.hxx
+++ b/sc/qa/unit/ucalc.hxx
@@ -151,7 +151,6 @@ public:
     void testFormulaRefUpdateNameCopySheet();
     void testFormulaRefUpdateNameDelete();
     void testFormulaRefUpdateValidity();
-    //void testErrorOnExternalReferences();
     void testMultipleOperations();
     void testFuncCOLUMN();
     void testFuncCOUNT();
@@ -464,7 +463,6 @@ public:
     CPPUNIT_TEST(testFormulaRefUpdateNameCopySheet);
     CPPUNIT_TEST(testFormulaRefUpdateNameDelete);
     CPPUNIT_TEST(testFormulaRefUpdateValidity);
-    //CPPUNIT_TEST(testErrorOnExternalReferences);
     CPPUNIT_TEST(testMultipleOperations);
     CPPUNIT_TEST(testFuncCOLUMN);
     CPPUNIT_TEST(testFuncCOUNT);
diff --git a/sc/qa/unit/ucalc_formula.cxx b/sc/qa/unit/ucalc_formula.cxx
index a3fee83..ca731a2 100644
--- a/sc/qa/unit/ucalc_formula.cxx
+++ b/sc/qa/unit/ucalc_formula.cxx
@@ -1384,25 +1384,6 @@ void Test::testFormulaRefUpdateRange()
     m_pDoc->DeleteTab(0);
 }
 
-/*
-void Test::testErrorOnExternalReferences()
-{
-    // Test tdf#89330
-    m_pDoc->InsertTab(0, "Sheet1");
-    m_pDoc->SetString(ScAddress(0,0,0), "='file:///Path/To/FileA.ods'#$Sheet1.A1A");
-
-    ScFormulaCell* pFC = m_pDoc->GetFormulaCell(ScAddress(0,0,0));
-    CPPUNIT_ASSERT(pFC);
-    CPPUNIT_ASSERT_EQUAL(ScErrorCodes::errNoName, pFC->GetErrCode());
-
-    if (!checkFormula(*m_pDoc, ScAddress(0,0,0), "'file:///Path/To/FileA.ods'#$Sheet1.A1A"))
-        CPPUNIT_FAIL("Formula changed");
-
-    m_pDoc->DeleteTab(0);
-}
-*/
-
-
 void Test::testFormulaRefUpdateSheets()
 {
     m_pDoc->InsertTab(0, "Sheet1");


More information about the Libreoffice-commits mailing list