Kaydet (Commit) 023fb64d authored tarafından Jan Kantert's avatar Jan Kantert Kaydeden (comit) Markus Mohrhard

move unit test for tdf#89330 to subsequent_filters-test and enable it

Change-Id: Ia64ed4735a8ce13780d090688b0e206c5c080b5b
üst 368954b3
...@@ -52,6 +52,8 @@ ...@@ -52,6 +52,8 @@
#include <scopetools.hxx> #include <scopetools.hxx>
#include <columnspanset.hxx> #include <columnspanset.hxx>
#include <tokenstringcontext.hxx> #include <tokenstringcontext.hxx>
#include <formula/errorcodes.hxx>
#include <com/sun/star/drawing/XDrawPageSupplier.hpp> #include <com/sun/star/drawing/XDrawPageSupplier.hpp>
#include <com/sun/star/drawing/XControlShape.hpp> #include <com/sun/star/drawing/XControlShape.hpp>
...@@ -139,6 +141,7 @@ public: ...@@ -139,6 +141,7 @@ public:
* by one. (fdo#76032) * by one. (fdo#76032)
*/ */
void testRowIndex1BasedXLSX(); void testRowIndex1BasedXLSX();
void testErrorOnExternalReferences();
//misc tests unrelated to the import filters //misc tests unrelated to the import filters
#if !defined(MACOSX) && !defined(DRAGONFLY) && !defined(WNT) #if !defined(MACOSX) && !defined(DRAGONFLY) && !defined(WNT)
...@@ -275,6 +278,7 @@ public: ...@@ -275,6 +278,7 @@ public:
CPPUNIT_TEST(testCopyMergedNumberFormats); CPPUNIT_TEST(testCopyMergedNumberFormats);
CPPUNIT_TEST(testVBAUserFunctionXLSM); CPPUNIT_TEST(testVBAUserFunctionXLSM);
CPPUNIT_TEST(testEmbeddedImageXLS); CPPUNIT_TEST(testEmbeddedImageXLS);
CPPUNIT_TEST(testErrorOnExternalReferences);
CPPUNIT_TEST_SUITE_END(); CPPUNIT_TEST_SUITE_END();
private: private:
...@@ -2815,6 +2819,26 @@ void ScFiltersTest::testEmbeddedImageXLS() ...@@ -2815,6 +2819,26 @@ void ScFiltersTest::testEmbeddedImageXLS()
xDocSh->DoClose(); 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() ScFiltersTest::ScFiltersTest()
: ScBootstrapFixture( "/sc/qa/unit/data" ) : ScBootstrapFixture( "/sc/qa/unit/data" )
{ {
......
...@@ -151,7 +151,6 @@ public: ...@@ -151,7 +151,6 @@ public:
void testFormulaRefUpdateNameCopySheet(); void testFormulaRefUpdateNameCopySheet();
void testFormulaRefUpdateNameDelete(); void testFormulaRefUpdateNameDelete();
void testFormulaRefUpdateValidity(); void testFormulaRefUpdateValidity();
//void testErrorOnExternalReferences();
void testMultipleOperations(); void testMultipleOperations();
void testFuncCOLUMN(); void testFuncCOLUMN();
void testFuncCOUNT(); void testFuncCOUNT();
...@@ -464,7 +463,6 @@ public: ...@@ -464,7 +463,6 @@ public:
CPPUNIT_TEST(testFormulaRefUpdateNameCopySheet); CPPUNIT_TEST(testFormulaRefUpdateNameCopySheet);
CPPUNIT_TEST(testFormulaRefUpdateNameDelete); CPPUNIT_TEST(testFormulaRefUpdateNameDelete);
CPPUNIT_TEST(testFormulaRefUpdateValidity); CPPUNIT_TEST(testFormulaRefUpdateValidity);
//CPPUNIT_TEST(testErrorOnExternalReferences);
CPPUNIT_TEST(testMultipleOperations); CPPUNIT_TEST(testMultipleOperations);
CPPUNIT_TEST(testFuncCOLUMN); CPPUNIT_TEST(testFuncCOLUMN);
CPPUNIT_TEST(testFuncCOUNT); CPPUNIT_TEST(testFuncCOUNT);
......
...@@ -1384,25 +1384,6 @@ void Test::testFormulaRefUpdateRange() ...@@ -1384,25 +1384,6 @@ void Test::testFormulaRefUpdateRange()
m_pDoc->DeleteTab(0); 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() void Test::testFormulaRefUpdateSheets()
{ {
m_pDoc->InsertTab(0, "Sheet1"); m_pDoc->InsertTab(0, "Sheet1");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment