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

Katarina Behrens Katarina.Behrens at cib.de
Mon Aug 17 05:29:33 PDT 2015


 sc/qa/unit/subsequent_export-test.cxx  |   57 +++++++++++++++++++++++++++++++++
 sc/qa/unit/subsequent_filters-test.cxx |   50 +---------------------------
 2 files changed, 59 insertions(+), 48 deletions(-)

New commits:
commit 1d1d5f9013399065e606d95f8bebaebe464c7e96
Author: Katarina Behrens <Katarina.Behrens at cib.de>
Date:   Mon Aug 17 14:16:14 2015 +0200

    Move export tests where they really belong
    
    Change-Id: Ia231bd3e355c398d4ea3ef3d8adcd64b7074847c

diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx
index fe1e859..c8036c7 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 3eb33b0..51b83d0 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()


More information about the Libreoffice-commits mailing list