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

Markus Mohrhard markus.mohrhard at googlemail.com
Mon Oct 28 14:48:32 PDT 2013


 sc/Library_scqahelper.mk                      |    3 
 sc/qa/unit/data/contentCSV/numberFormat.csv   |    1 
 sc/qa/unit/data/contentCSV/text-functions.csv |    2 
 sc/qa/unit/data/ods/formats.ods               |binary
 sc/qa/unit/data/ods/functions.ods             |binary
 sc/qa/unit/helper/qahelper.cxx                |  120 +++++++++++++++++++++++
 sc/qa/unit/helper/qahelper.hxx                |    2 
 sc/qa/unit/subsequent_export-test.cxx         |   17 +++
 sc/qa/unit/subsequent_filters-test.cxx        |  135 +-------------------------
 9 files changed, 153 insertions(+), 127 deletions(-)

New commits:
commit 17d8e1f9eacb10654f2feb31df2fe0638af2b370
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Mon Oct 28 22:44:56 2013 +0100

    add test for fdo#70275
    
    Change-Id: Ibdbb4880878f6bb40344e1c274c586cd587cf924

diff --git a/sc/qa/unit/data/contentCSV/numberFormat.csv b/sc/qa/unit/data/contentCSV/numberFormat.csv
index 001d70f..83cbbab 100644
--- a/sc/qa/unit/data/contentCSV/numberFormat.csv
+++ b/sc/qa/unit/data/contentCSV/numberFormat.csv
@@ -4,3 +4,4 @@
 2.59E+005,-2.35E+03
 25 31/82
 FALSE,TRUE
+/>
diff --git a/sc/qa/unit/data/ods/formats.ods b/sc/qa/unit/data/ods/formats.ods
index cfe3bc8..1837529 100644
Binary files a/sc/qa/unit/data/ods/formats.ods and b/sc/qa/unit/data/ods/formats.ods differ
diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx
index 4d1fd60..853187c 100644
--- a/sc/qa/unit/subsequent_filters-test.cxx
+++ b/sc/qa/unit/subsequent_filters-test.cxx
@@ -26,9 +26,6 @@
 #include "editeng/postitem.hxx"
 #include "editeng/udlnitem.hxx"
 #include "editeng/editobj.hxx"
-#include "editeng/brushitem.hxx"
-#include <editeng/brushitem.hxx>
-#include <editeng/justifyitem.hxx>
 #include <editeng/borderline.hxx>
 #include "editeng/flditem.hxx"
 #include <dbdata.hxx>
commit 487db9ce89d53391cf45578cc42f6e7f3e67536c
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Mon Oct 28 22:36:57 2013 +0100

    add ODS export test for formattings
    
    Change-Id: I62ede554994c4448c6dff8f1a9e2ecb3075fdb46

diff --git a/sc/Library_scqahelper.mk b/sc/Library_scqahelper.mk
index f0be599..4ea1f92 100644
--- a/sc/Library_scqahelper.mk
+++ b/sc/Library_scqahelper.mk
@@ -35,6 +35,7 @@ $(eval $(call gb_Library_use_libraries,scqahelper,\
 	cppuhelper \
 	for \
 	sal \
+	sc \
 	sfx \
 	sot \
 	svl \
@@ -45,9 +46,9 @@ $(eval $(call gb_Library_use_libraries,scqahelper,\
 	tl \
 	unotest \
 	utl \
-	sc \
 	ucbhelper \
 	unotest \
+	vcl \
 	$(gb_UWINAPI) \
 ))
 
diff --git a/sc/qa/unit/helper/qahelper.cxx b/sc/qa/unit/helper/qahelper.cxx
index 0de8b6b..b212846 100644
--- a/sc/qa/unit/helper/qahelper.cxx
+++ b/sc/qa/unit/helper/qahelper.cxx
@@ -11,9 +11,13 @@
 #include "csv_handler.hxx"
 #include "drwlayer.hxx"
 #include "compiler.hxx"
+#include "conditio.hxx"
+#include "stlsheet.hxx"
 #include "formulacell.hxx"
 #include "svx/svdpage.hxx"
 #include "svx/svdoole2.hxx"
+#include <editeng/brushitem.hxx>
+#include <editeng/justifyitem.hxx>
 
 #include <config_orcus.h>
 
@@ -161,6 +165,122 @@ void testCondFile(OUString&, ScDocument*, SCTAB) {}
 
 #endif
 
+void testFormats(ScBootstrapFixture* pTest, ScDocument* pDoc, sal_Int32 nFormat)
+{
+    //test Sheet1 with csv file
+    OUString aCSVFileName;
+    pTest->createCSVPath(OUString("numberFormat."), aCSVFileName);
+    testFile(aCSVFileName, pDoc, 0, PureString);
+    //need to test the color of B3
+    //it's not a font color!
+    //formatting for B5: # ??/100 gets lost during import
+
+    //test Sheet2
+    const ScPatternAttr* pPattern = NULL;
+    pPattern = pDoc->GetPattern(0,0,1);
+    Font aFont;
+    pPattern->GetFont(aFont,SC_AUTOCOL_RAW);
+    CPPUNIT_ASSERT_EQUAL_MESSAGE("font size should be 10", 200l, aFont.GetSize().getHeight());
+    CPPUNIT_ASSERT_EQUAL_MESSAGE("font color should be black", COL_AUTO, aFont.GetColor().GetColor());
+    pPattern = pDoc->GetPattern(0,1,1);
+    pPattern->GetFont(aFont, SC_AUTOCOL_RAW);
+    CPPUNIT_ASSERT_EQUAL_MESSAGE("font size should be 12", 240l, aFont.GetSize().getHeight());
+    pPattern = pDoc->GetPattern(0,2,1);
+    pPattern->GetFont(aFont, SC_AUTOCOL_RAW);
+    CPPUNIT_ASSERT_EQUAL_MESSAGE("font should be italic", ITALIC_NORMAL, aFont.GetItalic());
+    pPattern = pDoc->GetPattern(0,4,1);
+    pPattern->GetFont(aFont, SC_AUTOCOL_RAW);
+    CPPUNIT_ASSERT_EQUAL_MESSAGE("font should be bold", WEIGHT_BOLD, aFont.GetWeight());
+    pPattern = pDoc->GetPattern(1,0,1);
+    pPattern->GetFont(aFont, SC_AUTOCOL_RAW);
+    CPPUNIT_ASSERT_EQUAL_MESSAGE("font should be blue", COL_BLUE, aFont.GetColor().GetColor());
+    pPattern = pDoc->GetPattern(1,1,1);
+    pPattern->GetFont(aFont, SC_AUTOCOL_RAW);
+    CPPUNIT_ASSERT_EQUAL_MESSAGE("font should be striked out with a single line", STRIKEOUT_SINGLE, aFont.GetStrikeout());
+    //some tests on sheet2 only for ods
+    if (nFormat == ODS)
+    {
+        pPattern = pDoc->GetPattern(1,2,1);
+        pPattern->GetFont(aFont, SC_AUTOCOL_RAW);
+        CPPUNIT_ASSERT_EQUAL_MESSAGE("font should be striked out with a double line", STRIKEOUT_DOUBLE, aFont.GetStrikeout());
+        pPattern = pDoc->GetPattern(1,3,1);
+        pPattern->GetFont(aFont, SC_AUTOCOL_RAW);
+        CPPUNIT_ASSERT_EQUAL_MESSAGE("font should be underlined with a dotted line", UNDERLINE_DOTTED, aFont.GetUnderline());
+        //check row height import
+        //disable for now until we figure out cause of win tinderboxes test failures
+        //CPPUNIT_ASSERT_EQUAL( static_cast<sal_uInt16>(256), pDoc->GetRowHeight(0,1) ); //0.178in
+        //CPPUNIT_ASSERT_EQUAL( static_cast<sal_uInt16>(304), pDoc->GetRowHeight(1,1) ); //0.211in
+        //CPPUNIT_ASSERT_EQUAL( static_cast<sal_uInt16>(477), pDoc->GetRowHeight(5,1) ); //0.3311in
+        //check column width import
+        CPPUNIT_ASSERT_EQUAL( static_cast<sal_uInt16>(555), pDoc->GetColWidth(4,1) );  //0.3854in
+        CPPUNIT_ASSERT_EQUAL( static_cast<sal_uInt16>(1280), pDoc->GetColWidth(5,1) ); //0.889in
+        CPPUNIT_ASSERT_EQUAL( static_cast<sal_uInt16>(4153), pDoc->GetColWidth(6,1) ); //2.8839in
+        //test case for i53253 where a cell has text with different styles and space between the text.
+        OUString aTestStr = pDoc->GetString(3,0,1);
+        OUString aKnownGoodStr("text14 space");
+        CPPUNIT_ASSERT_EQUAL( aKnownGoodStr, aTestStr );
+        //test case for cell text with line breaks.
+        aTestStr = pDoc->GetString(3,5,1);
+        aKnownGoodStr = "Hello,\nCalc!";
+        CPPUNIT_ASSERT_EQUAL( aKnownGoodStr, aTestStr );
+    }
+    pPattern = pDoc->GetPattern(1,4,1);
+    Color aColor = static_cast<const SvxBrushItem&>(pPattern->GetItem(ATTR_BACKGROUND)).GetColor();
+    CPPUNIT_ASSERT_MESSAGE("background color should be green", aColor == COL_LIGHTGREEN);
+    pPattern = pDoc->GetPattern(2,0,1);
+    SvxCellHorJustify eHorJustify = static_cast<SvxCellHorJustify>(static_cast<const SvxHorJustifyItem&>(pPattern->GetItem(ATTR_HOR_JUSTIFY)).GetValue());
+    CPPUNIT_ASSERT_EQUAL_MESSAGE("cell content should be aligned centre horizontally", SVX_HOR_JUSTIFY_CENTER, eHorJustify);
+    //test alignment
+    pPattern = pDoc->GetPattern(2,1,1);
+    eHorJustify = static_cast<SvxCellHorJustify>(static_cast<const SvxHorJustifyItem&>(pPattern->GetItem(ATTR_HOR_JUSTIFY)).GetValue());
+    CPPUNIT_ASSERT_EQUAL_MESSAGE("cell content should be aligned right horizontally", SVX_HOR_JUSTIFY_RIGHT, eHorJustify);
+    pPattern = pDoc->GetPattern(2,2,1);
+    eHorJustify = static_cast<SvxCellHorJustify>(static_cast<const SvxHorJustifyItem&>(pPattern->GetItem(ATTR_HOR_JUSTIFY)).GetValue());
+    CPPUNIT_ASSERT_EQUAL_MESSAGE("cell content should be aligned block horizontally", SVX_HOR_JUSTIFY_BLOCK, eHorJustify);
+
+    //test Sheet3 only for ods and xlsx
+    if ( nFormat == ODS || nFormat == XLSX )
+    {
+        pTest->createCSVPath(OUString("conditionalFormatting."), aCSVFileName);
+        testCondFile(aCSVFileName, pDoc, 2);
+        // test parent cell style import ( fdo#55198 )
+        if ( nFormat == XLSX )
+        {
+            pPattern = pDoc->GetPattern(1,1,3);
+            ScStyleSheet* pStyleSheet = (ScStyleSheet*)pPattern->GetStyleSheet();
+            // check parent style name
+            OUString sExpected("Excel Built-in Date");
+            OUString sResult = pStyleSheet->GetName();
+            CPPUNIT_ASSERT_EQUAL_MESSAGE("parent style for Sheet4.B2 is 'Excel Built-in Date'", sExpected, sResult);
+            // check  align of style
+            SfxItemSet& rItemSet = pStyleSheet->GetItemSet();
+            eHorJustify = static_cast<SvxCellHorJustify>(static_cast< const SvxHorJustifyItem& >(rItemSet.Get( ATTR_HOR_JUSTIFY ) ).GetValue() );
+            CPPUNIT_ASSERT_EQUAL_MESSAGE("'Excel Built-in Date' style should be aligned centre horizontally", SVX_HOR_JUSTIFY_CENTER, eHorJustify);
+            // check date format ( should be just month e.g. 29 )
+            sResult =pDoc->GetString( 1,1,3 );
+            sExpected = OUString("29");
+            CPPUNIT_ASSERT_EQUAL_MESSAGE("'Excel Built-in Date' style should just display month", sExpected, sResult );
+
+            // check actual align applied to cell, should be the same as
+            // the style
+            eHorJustify = static_cast<SvxCellHorJustify>(static_cast< const SvxHorJustifyItem& >(pPattern->GetItem( ATTR_HOR_JUSTIFY ) ).GetValue() );
+            CPPUNIT_ASSERT_EQUAL_MESSAGE("cell with 'Excel Built-in Date' style should be aligned centre horizontally", SVX_HOR_JUSTIFY_CENTER, eHorJustify);
+        }
+    }
+
+    ScConditionalFormat* pCondFormat = pDoc->GetCondFormat(0,0,2);
+    const ScRangeList& rRange = pCondFormat->GetRange();
+    CPPUNIT_ASSERT(rRange == ScRange(0,0,2,3,0,2));
+
+    pCondFormat = pDoc->GetCondFormat(0,1,2);
+    const ScRangeList& rRange2 = pCondFormat->GetRange();
+    CPPUNIT_ASSERT(rRange2 == ScRange(0,1,2,0,1,2));
+
+    pCondFormat = pDoc->GetCondFormat(1,1,2);
+    const ScRangeList& rRange3 = pCondFormat->GetRange();
+    CPPUNIT_ASSERT(rRange3 == ScRange(1,1,2,3,1,2));
+}
+
 const SdrOle2Obj* getSingleChartObject(ScDocument& rDoc, sal_uInt16 nPage)
 {
     // Retrieve the chart object instance from the 2nd page (for the 2nd sheet).
diff --git a/sc/qa/unit/helper/qahelper.hxx b/sc/qa/unit/helper/qahelper.hxx
index 8d0f27d..a6d5a02 100644
--- a/sc/qa/unit/helper/qahelper.hxx
+++ b/sc/qa/unit/helper/qahelper.hxx
@@ -204,6 +204,8 @@ public:
 #define ASSERT_EQUAL_TYPE( type, expected, result ) \
     CPPUNIT_ASSERT_EQUAL( static_cast<type>(expected), static_cast<type>(result) );
 
+SCQAHELPER_DLLPUBLIC void testFormats(ScBootstrapFixture* pTest, ScDocument* pDoc, sal_Int32 nFormat);
+
 #endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx
index bd69cc1..0e8ff65 100644
--- a/sc/qa/unit/subsequent_export-test.cxx
+++ b/sc/qa/unit/subsequent_export-test.cxx
@@ -67,6 +67,7 @@ public:
     void testRichTextExportODS();
 
     void testCellValuesExportODS();
+    void testFormatExportODS();
 
     void testInlineArrayXLS();
     void testEmbeddedChartXLS();
@@ -86,6 +87,7 @@ public:
     CPPUNIT_TEST(testNamedRangeBugfdo62729);
     CPPUNIT_TEST(testRichTextExportODS);
     CPPUNIT_TEST(testCellValuesExportODS);
+    CPPUNIT_TEST(testFormatExportODS);
     CPPUNIT_TEST(testInlineArrayXLS);
     CPPUNIT_TEST(testEmbeddedChartXLS);
     CPPUNIT_TEST(testFormulaReferenceXLS);
@@ -264,6 +266,21 @@ void ScExportTest::testDataBarExportODS()
     xDocSh->DoClose();
 }
 
+void ScExportTest::testFormatExportODS()
+{
+    ScDocShellRef xShell = loadDoc("formats.", ODS);
+    CPPUNIT_ASSERT(xShell.Is());
+
+    ScDocShellRef xDocSh = saveAndReload(xShell, ODS);
+    CPPUNIT_ASSERT(xDocSh.Is());
+
+    ScDocument* pDoc = xDocSh->GetDocument();
+
+    testFormats(this, pDoc, ODS);
+
+    xDocSh->DoClose();
+}
+
 void ScExportTest::testDataBarExportXLSX()
 {
     ScDocShellRef xShell = loadDoc("databar.", XLSX);
diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx
index bd789b4..4d1fd60 100644
--- a/sc/qa/unit/subsequent_filters-test.cxx
+++ b/sc/qa/unit/subsequent_filters-test.cxx
@@ -546,126 +546,6 @@ void ScFiltersTest::testDatabaseRangesXLSX()
     xDocSh->DoClose();
 }
 
-namespace {
-
-void testFormats_Impl(ScFiltersTest* pFiltersTest, ScDocument* pDoc, sal_Int32 nFormat)
-{
-    //test Sheet1 with csv file
-    OUString aCSVFileName;
-    pFiltersTest->createCSVPath(OUString("numberFormat."), aCSVFileName);
-    testFile(aCSVFileName, pDoc, 0, PureString);
-    //need to test the color of B3
-    //it's not a font color!
-    //formatting for B5: # ??/100 gets lost during import
-
-    //test Sheet2
-    const ScPatternAttr* pPattern = NULL;
-    pPattern = pDoc->GetPattern(0,0,1);
-    Font aFont;
-    pPattern->GetFont(aFont,SC_AUTOCOL_RAW);
-    CPPUNIT_ASSERT_EQUAL_MESSAGE("font size should be 10", 200l, aFont.GetSize().getHeight());
-    CPPUNIT_ASSERT_EQUAL_MESSAGE("font color should be black", COL_AUTO, aFont.GetColor().GetColor());
-    pPattern = pDoc->GetPattern(0,1,1);
-    pPattern->GetFont(aFont, SC_AUTOCOL_RAW);
-    CPPUNIT_ASSERT_EQUAL_MESSAGE("font size should be 12", 240l, aFont.GetSize().getHeight());
-    pPattern = pDoc->GetPattern(0,2,1);
-    pPattern->GetFont(aFont, SC_AUTOCOL_RAW);
-    CPPUNIT_ASSERT_EQUAL_MESSAGE("font should be italic", ITALIC_NORMAL, aFont.GetItalic());
-    pPattern = pDoc->GetPattern(0,4,1);
-    pPattern->GetFont(aFont, SC_AUTOCOL_RAW);
-    CPPUNIT_ASSERT_EQUAL_MESSAGE("font should be bold", WEIGHT_BOLD, aFont.GetWeight());
-    pPattern = pDoc->GetPattern(1,0,1);
-    pPattern->GetFont(aFont, SC_AUTOCOL_RAW);
-    CPPUNIT_ASSERT_EQUAL_MESSAGE("font should be blue", COL_BLUE, aFont.GetColor().GetColor());
-    pPattern = pDoc->GetPattern(1,1,1);
-    pPattern->GetFont(aFont, SC_AUTOCOL_RAW);
-    CPPUNIT_ASSERT_EQUAL_MESSAGE("font should be striked out with a single line", STRIKEOUT_SINGLE, aFont.GetStrikeout());
-    //some tests on sheet2 only for ods
-    if (nFormat == ODS)
-    {
-        pPattern = pDoc->GetPattern(1,2,1);
-        pPattern->GetFont(aFont, SC_AUTOCOL_RAW);
-        CPPUNIT_ASSERT_EQUAL_MESSAGE("font should be striked out with a double line", STRIKEOUT_DOUBLE, aFont.GetStrikeout());
-        pPattern = pDoc->GetPattern(1,3,1);
-        pPattern->GetFont(aFont, SC_AUTOCOL_RAW);
-        CPPUNIT_ASSERT_EQUAL_MESSAGE("font should be underlined with a dotted line", UNDERLINE_DOTTED, aFont.GetUnderline());
-        //check row height import
-        //disable for now until we figure out cause of win tinderboxes test failures
-        //CPPUNIT_ASSERT_EQUAL( static_cast<sal_uInt16>(256), pDoc->GetRowHeight(0,1) ); //0.178in
-        //CPPUNIT_ASSERT_EQUAL( static_cast<sal_uInt16>(304), pDoc->GetRowHeight(1,1) ); //0.211in
-        //CPPUNIT_ASSERT_EQUAL( static_cast<sal_uInt16>(477), pDoc->GetRowHeight(5,1) ); //0.3311in
-        //check column width import
-        CPPUNIT_ASSERT_EQUAL( static_cast<sal_uInt16>(555), pDoc->GetColWidth(4,1) );  //0.3854in
-        CPPUNIT_ASSERT_EQUAL( static_cast<sal_uInt16>(1280), pDoc->GetColWidth(5,1) ); //0.889in
-        CPPUNIT_ASSERT_EQUAL( static_cast<sal_uInt16>(4153), pDoc->GetColWidth(6,1) ); //2.8839in
-        //test case for i53253 where a cell has text with different styles and space between the text.
-        OUString aTestStr = pDoc->GetString(3,0,1);
-        OUString aKnownGoodStr("text14 space");
-        CPPUNIT_ASSERT_EQUAL( aKnownGoodStr, aTestStr );
-        //test case for cell text with line breaks.
-        aTestStr = pDoc->GetString(3,5,1);
-        aKnownGoodStr = "Hello,\nCalc!";
-        CPPUNIT_ASSERT_EQUAL( aKnownGoodStr, aTestStr );
-    }
-    pPattern = pDoc->GetPattern(1,4,1);
-    Color aColor = static_cast<const SvxBrushItem&>(pPattern->GetItem(ATTR_BACKGROUND)).GetColor();
-    CPPUNIT_ASSERT_MESSAGE("background color should be green", aColor == COL_LIGHTGREEN);
-    pPattern = pDoc->GetPattern(2,0,1);
-    SvxCellHorJustify eHorJustify = static_cast<SvxCellHorJustify>(static_cast<const SvxHorJustifyItem&>(pPattern->GetItem(ATTR_HOR_JUSTIFY)).GetValue());
-    CPPUNIT_ASSERT_EQUAL_MESSAGE("cell content should be aligned centre horizontally", SVX_HOR_JUSTIFY_CENTER, eHorJustify);
-    //test alignment
-    pPattern = pDoc->GetPattern(2,1,1);
-    eHorJustify = static_cast<SvxCellHorJustify>(static_cast<const SvxHorJustifyItem&>(pPattern->GetItem(ATTR_HOR_JUSTIFY)).GetValue());
-    CPPUNIT_ASSERT_EQUAL_MESSAGE("cell content should be aligned right horizontally", SVX_HOR_JUSTIFY_RIGHT, eHorJustify);
-    pPattern = pDoc->GetPattern(2,2,1);
-    eHorJustify = static_cast<SvxCellHorJustify>(static_cast<const SvxHorJustifyItem&>(pPattern->GetItem(ATTR_HOR_JUSTIFY)).GetValue());
-    CPPUNIT_ASSERT_EQUAL_MESSAGE("cell content should be aligned block horizontally", SVX_HOR_JUSTIFY_BLOCK, eHorJustify);
-
-    //test Sheet3 only for ods
-    if ( nFormat == ODS || nFormat == XLSX )
-    {
-        pFiltersTest->createCSVPath(OUString("conditionalFormatting."), aCSVFileName);
-        testCondFile(aCSVFileName, pDoc, 2);
-        // test parent cell style import ( fdo#55198 )
-        if ( nFormat == XLSX )
-        {
-            pPattern = pDoc->GetPattern(1,1,3);
-            ScStyleSheet* pStyleSheet = (ScStyleSheet*)pPattern->GetStyleSheet();
-            // check parent style name
-            OUString sExpected("Excel Built-in Date");
-            OUString sResult = pStyleSheet->GetName();
-            CPPUNIT_ASSERT_EQUAL_MESSAGE("parent style for Sheet4.B2 is 'Excel Built-in Date'", sExpected, sResult);
-            // check  align of style
-            SfxItemSet& rItemSet = pStyleSheet->GetItemSet();
-            eHorJustify = static_cast<SvxCellHorJustify>(static_cast< const SvxHorJustifyItem& >(rItemSet.Get( ATTR_HOR_JUSTIFY ) ).GetValue() );
-            CPPUNIT_ASSERT_EQUAL_MESSAGE("'Excel Built-in Date' style should be aligned centre horizontally", SVX_HOR_JUSTIFY_CENTER, eHorJustify);
-            // check date format ( should be just month e.g. 29 )
-            sResult =pDoc->GetString( 1,1,3 );
-            sExpected = OUString("29");
-            CPPUNIT_ASSERT_EQUAL_MESSAGE("'Excel Built-in Date' style should just display month", sExpected, sResult );
-
-            // check actual align applied to cell, should be the same as
-            // the style
-            eHorJustify = static_cast<SvxCellHorJustify>(static_cast< const SvxHorJustifyItem& >(pPattern->GetItem( ATTR_HOR_JUSTIFY ) ).GetValue() );
-            CPPUNIT_ASSERT_EQUAL_MESSAGE("cell with 'Excel Built-in Date' style should be aligned centre horizontally", SVX_HOR_JUSTIFY_CENTER, eHorJustify);
-        }
-    }
-
-    ScConditionalFormat* pCondFormat = pDoc->GetCondFormat(0,0,2);
-    const ScRangeList& rRange = pCondFormat->GetRange();
-    CPPUNIT_ASSERT(rRange == ScRange(0,0,2,3,0,2));
-
-    pCondFormat = pDoc->GetCondFormat(0,1,2);
-    const ScRangeList& rRange2 = pCondFormat->GetRange();
-    CPPUNIT_ASSERT(rRange2 == ScRange(0,1,2,0,1,2));
-
-    pCondFormat = pDoc->GetCondFormat(1,1,2);
-    const ScRangeList& rRange3 = pCondFormat->GetRange();
-    CPPUNIT_ASSERT(rRange3 == ScRange(1,1,2,3,1,2));
-}
-
-}
-
 void ScFiltersTest::testFormatsODS()
 {
     ScDocShellRef xDocSh = loadDoc("formats.", ODS);
@@ -673,7 +553,7 @@ void ScFiltersTest::testFormatsODS()
 
     ScDocument* pDoc = xDocSh->GetDocument();
 
-    testFormats_Impl(this, pDoc, ODS);
+    testFormats(this, pDoc, ODS);
     xDocSh->DoClose();
 }
 
@@ -684,7 +564,7 @@ void ScFiltersTest::testFormatsXLS()
 
     ScDocument* pDoc = xDocSh->GetDocument();
 
-    testFormats_Impl(this, pDoc, XLS);
+    testFormats(this, pDoc, XLS);
     xDocSh->DoClose();
 }
 
@@ -695,7 +575,7 @@ void ScFiltersTest::testFormatsXLSX()
 
     ScDocument* pDoc = xDocSh->GetDocument();
 
-    testFormats_Impl(this, pDoc, XLSX);
+    testFormats(this, pDoc, XLSX);
     xDocSh->DoClose();
 }
 
commit 6993eb83bdd4e934a6470dc189de4f7d43b98a80
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Mon Oct 28 21:58:05 2013 +0100

    add test for LEFT and MID where string is shorter than requested
    
    Change-Id: I0946e92af47aec6277938f6f91beb7a405005496

diff --git a/sc/qa/unit/data/contentCSV/text-functions.csv b/sc/qa/unit/data/contentCSV/text-functions.csv
new file mode 100644
index 0000000..8002212
--- /dev/null
+++ b/sc/qa/unit/data/contentCSV/text-functions.csv
@@ -0,0 +1,2 @@
+te,est,est
+t,tes,testing
diff --git a/sc/qa/unit/data/ods/functions.ods b/sc/qa/unit/data/ods/functions.ods
index 6dd969c..c3e2a34 100644
Binary files a/sc/qa/unit/data/ods/functions.ods and b/sc/qa/unit/data/ods/functions.ods differ
diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx
index 5743b20..bd789b4 100644
--- a/sc/qa/unit/subsequent_filters-test.cxx
+++ b/sc/qa/unit/subsequent_filters-test.cxx
@@ -359,6 +359,9 @@ void ScFiltersTest::testFunctionsODS()
     //test information functions
     createCSVPath(OUString("information-functions."), aCSVFileName);
     testFile(aCSVFileName, pDoc, 3);
+    // text functions
+    createCSVPath(OUString("text-functions."), aCSVFileName);
+    testFile(aCSVFileName, pDoc, 4);
 
     xDocSh->DoClose();
 }
@@ -384,6 +387,9 @@ void ScFiltersTest::testCachedFormulaResultsODS()
         //test cached formula results of information functions
         createCSVPath(OUString("information-functions."), aCSVFileName);
         testFile(aCSVFileName, pDoc, 3);
+        // text functions
+        createCSVPath(OUString("text-functions."), aCSVFileName);
+        testFile(aCSVFileName, pDoc, 4);
 
         xDocSh->DoClose();
     }


More information about the Libreoffice-commits mailing list