summaryrefslogtreecommitdiff
path: root/sc/qa/unit
diff options
context:
space:
mode:
authorJan Kantert <jan-lo@kantert.net>2015-02-18 11:17:42 +0100
committerMarkus Mohrhard <markus.mohrhard@collabora.co.uk>2015-02-20 05:55:25 +0100
commit023fb64de84792337092f98d416e83a235a852fb (patch)
tree18659dfb43694185cb5ff337a2db234192abae64 /sc/qa/unit
parent368954b3e9135de38a5a74f506ff27481b8d7a76 (diff)
move unit test for tdf#89330 to subsequent_filters-test and enable it
Change-Id: Ia64ed4735a8ce13780d090688b0e206c5c080b5b
Diffstat (limited to 'sc/qa/unit')
-rw-r--r--sc/qa/unit/data/ods/blank.odsbin0 -> 10434 bytes
-rw-r--r--sc/qa/unit/subsequent_filters-test.cxx24
-rw-r--r--sc/qa/unit/ucalc.hxx2
-rw-r--r--sc/qa/unit/ucalc_formula.cxx19
4 files changed, 24 insertions, 21 deletions
diff --git a/sc/qa/unit/data/ods/blank.ods b/sc/qa/unit/data/ods/blank.ods
new file mode 100644
index 000000000000..cb57e98ba368
--- /dev/null
+++ b/sc/qa/unit/data/ods/blank.ods
Binary files differ
diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx
index 2012876a3d3f..ba48b129aca5 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 1937e4a25004..d9f1e5807294 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 a3fee83765ca..ca731a232bb5 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");