summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKatarina Behrens <Katarina.Behrens@cib.de>2015-08-17 14:16:14 +0200
committerKatarina Behrens <Katarina.Behrens@cib.de>2015-08-17 14:28:09 +0200
commit1d1d5f9013399065e606d95f8bebaebe464c7e96 (patch)
tree928140178225793d739923ea2d25125742d75c52
parent3e3c5369e87066a4bfdead5fc9dbfe128f84df52 (diff)
Move export tests where they really belong
Change-Id: Ia231bd3e355c398d4ea3ef3d8adcd64b7074847c
-rw-r--r--sc/qa/unit/subsequent_export-test.cxx57
-rw-r--r--sc/qa/unit/subsequent_filters-test.cxx50
2 files changed, 59 insertions, 48 deletions
diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx
index fe1e8597ec8e..c8036c791b99 100644
--- a/sc/qa/unit/subsequent_export-test.cxx
+++ b/sc/qa/unit/subsequent_export-test.cxx
@@ -155,6 +155,9 @@ public:
void testMatrixMultiplication();
void testPreserveTextWhitespaceXLSX();
+ void testRefStringXLSX();
+ void testRefStringConfigXLSX();
+
CPPUNIT_TEST_SUITE(ScExportTest);
CPPUNIT_TEST(test);
#if !defined(MACOSX) && !defined(DRAGONFLY)
@@ -216,6 +219,8 @@ public:
CPPUNIT_TEST(testMoveCellAnchoredShapes);
CPPUNIT_TEST(testMatrixMultiplication);
+ CPPUNIT_TEST(testRefStringXLSX);
+ CPPUNIT_TEST(testRefStringConfigXLSX);
CPPUNIT_TEST_SUITE_END();
@@ -2901,6 +2906,58 @@ void ScExportTest::testMatrixMultiplication()
xDocSh->DoClose();
}
+
+void ScExportTest::testRefStringXLSX()
+{
+ ScDocShellRef xDocSh = loadDoc("ref_string.", XLSX);
+ CPPUNIT_ASSERT_MESSAGE("Failed to open doc", xDocSh.Is());
+
+ //make sure ref syntax gets saved for MSO-produced docs
+ xDocSh = saveAndReload( &(*xDocSh), XLSX);
+ CPPUNIT_ASSERT_MESSAGE("Failed to reload doc", xDocSh.Is());
+
+ ScDocument& rDoc = xDocSh->GetDocument();
+ ScCalcConfig aCalcConfig = rDoc.GetCalcConfig();
+ CPPUNIT_ASSERT_EQUAL(formula::FormulaGrammar::CONV_XL_A1, aCalcConfig.meStringRefAddressSyntax);
+
+ xDocSh->DoClose();
+}
+
+void ScExportTest::testRefStringConfigXLSX()
+{
+ ScDocShellRef xDocSh = loadDoc("empty.", XLSX);
+ CPPUNIT_ASSERT_MESSAGE("Failed to open doc", xDocSh.Is());
+
+ xDocSh = saveAndReload( &(*xDocSh), XLSX);
+ CPPUNIT_ASSERT_MESSAGE("Failed to reload doc", xDocSh.Is());
+
+ ScDocument& rDoc = xDocSh->GetDocument();
+ ScCalcConfig aConfig = rDoc.GetCalcConfig();
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("String ref syntax doesn't match", formula::FormulaGrammar::CONV_OOO,
+ aConfig.meStringRefAddressSyntax);
+
+ xDocSh = loadDoc("empty-noconf.", XLSX);
+ CPPUNIT_ASSERT_MESSAGE("Failed to open 2nd doc", xDocSh.Is());
+
+ //set ref syntax to something else than ExcelA1 (native to xlsx format) ...
+ ScDocument& rDoc2 = xDocSh->GetDocument();
+ aConfig = rDoc2.GetCalcConfig();
+ aConfig.meStringRefAddressSyntax = formula::FormulaGrammar::CONV_A1_XL_A1;
+ rDoc2.SetCalcConfig( aConfig );
+
+ ScDocShellRef xNewDocSh = saveAndReload( &(*xDocSh), XLSX);
+ CPPUNIT_ASSERT_MESSAGE("Failed to reload 2nd doc", xNewDocSh.Is());
+
+ // ... and make sure it got saved
+ ScDocument& rDoc3 = xNewDocSh->GetDocument();
+ aConfig = rDoc3.GetCalcConfig();
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("String ref syntax doesn't match", formula::FormulaGrammar::CONV_A1_XL_A1,
+ aConfig.meStringRefAddressSyntax);
+
+ xDocSh->DoClose();
+ xNewDocSh->DoClose();
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(ScExportTest);
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx
index 3eb33b0094be..51b83d01806e 100644
--- a/sc/qa/unit/subsequent_filters-test.cxx
+++ b/sc/qa/unit/subsequent_filters-test.cxx
@@ -204,7 +204,6 @@ public:
void testEmbeddedImageXLS();
void testEditEngStrikeThroughXLSX();
void testRefStringXLSX();
- void testRefStringConfigXLSX();
void testBnc762542();
@@ -302,7 +301,6 @@ public:
CPPUNIT_TEST(testErrorOnExternalReferences);
CPPUNIT_TEST(testEditEngStrikeThroughXLSX);
CPPUNIT_TEST(testRefStringXLSX);
- CPPUNIT_TEST(testRefStringConfigXLSX);
CPPUNIT_TEST(testBnc762542);
@@ -3109,53 +3107,9 @@ void ScFiltersTest::testRefStringXLSX()
double nVal = rDoc.GetValue(2, 2, 0);
ASSERT_DOUBLES_EQUAL(3.0, nVal);
- ScCalcConfig aCalcConfig = rDoc.GetCalcConfig();
- CPPUNIT_ASSERT_EQUAL(formula::FormulaGrammar::CONV_XL_A1, aCalcConfig.meStringRefAddressSyntax);
+ const ScCalcConfig& rCalcConfig = rDoc.GetCalcConfig();
+ CPPUNIT_ASSERT_EQUAL(formula::FormulaGrammar::CONV_XL_A1, rCalcConfig.meStringRefAddressSyntax);
- //make sure ref syntax gets saved for MSO-produced docs
- xDocSh = saveAndReload( &(*xDocSh), XLSX);
- CPPUNIT_ASSERT_MESSAGE("Failed to reload doc", xDocSh.Is());
-
- ScDocument& rDoc2 = xDocSh->GetDocument();
- aCalcConfig = rDoc2.GetCalcConfig();
- CPPUNIT_ASSERT_EQUAL(formula::FormulaGrammar::CONV_XL_A1, aCalcConfig.meStringRefAddressSyntax);
-
- xDocSh->DoClose();
-}
-
-void ScFiltersTest::testRefStringConfigXLSX()
-{
- ScDocShellRef xDocSh = loadDoc("empty.", XLSX);
- CPPUNIT_ASSERT_MESSAGE("Failed to open doc", xDocSh.Is());
-
- xDocSh = saveAndReload( &(*xDocSh), XLSX);
- CPPUNIT_ASSERT_MESSAGE("Failed to reload doc", xDocSh.Is());
-
- ScDocument& rDoc = xDocSh->GetDocument();
- ScCalcConfig aConfig = rDoc.GetCalcConfig();
- CPPUNIT_ASSERT_EQUAL_MESSAGE("String ref syntax doesn't match", formula::FormulaGrammar::CONV_OOO,
- aConfig.meStringRefAddressSyntax);
-
- xDocSh = loadDoc("empty-noconf.", XLSX);
- CPPUNIT_ASSERT_MESSAGE("Failed to open 2nd doc", xDocSh.Is());
-
- //set ref syntax to something else than ExcelA1 (native to xlsx format) ...
- ScDocument& rDoc2 = xDocSh->GetDocument();
- aConfig = rDoc2.GetCalcConfig();
- aConfig.meStringRefAddressSyntax = formula::FormulaGrammar::CONV_A1_XL_A1;
- rDoc2.SetCalcConfig( aConfig );
-
- ScDocShellRef xNewDocSh = saveAndReload( &(*xDocSh), XLSX);
- CPPUNIT_ASSERT_MESSAGE("Failed to reload 2nd doc", xNewDocSh.Is());
-
- // ... and make sure it got saved
- ScDocument& rDoc3 = xNewDocSh->GetDocument();
- aConfig = rDoc3.GetCalcConfig();
- CPPUNIT_ASSERT_EQUAL_MESSAGE("String ref syntax doesn't match", formula::FormulaGrammar::CONV_A1_XL_A1,
- aConfig.meStringRefAddressSyntax);
-
- xDocSh->DoClose();
- xNewDocSh->DoClose();
}
void ScFiltersTest::testBnc762542()