[Libreoffice-commits] .: Branch 'feature/gsoc-calc-perf' - 3 commits - sc/qa

Daniel Bankston dbank at kemper.freedesktop.org
Thu Jun 14 13:48:22 PDT 2012


 sc/qa/unit/data/ods/formats.ods        |binary
 sc/qa/unit/subsequent_filters-test.cxx |   23 ++++++++++++++++++++++-
 2 files changed, 22 insertions(+), 1 deletion(-)

New commits:
commit c2601d8c5f1736d72966f57090a9729988390d29
Author: Daniel Bankston <daniel.e.bankston at gmail.com>
Date:   Wed Jun 13 17:51:58 2012 -0500

    Add test case for cell text with line breaks
    
    Change-Id: Ibecefc21048817a566357ac3a65ee9a74a5af9fc

diff --git a/sc/qa/unit/data/ods/formats.ods b/sc/qa/unit/data/ods/formats.ods
index c4c9ba8..5ce8d0f 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 c68b42d..d98f7ed 100644
--- a/sc/qa/unit/subsequent_filters-test.cxx
+++ b/sc/qa/unit/subsequent_filters-test.cxx
@@ -419,6 +419,13 @@ void testFormats_Impl(ScFiltersTest* pFiltersTest, ScDocument* pDoc, sal_Int32 n
         rtl::OString aKnownGoodOStr(rtl::OUStringToOString(aKnownGoodOUStr, RTL_TEXTENCODING_UTF8));
         rtl::OString aMsg2("Expected: \"" + aKnownGoodOStr + "\"; Actual: \"" + aTestOStr + "\"");
         CPPUNIT_ASSERT_MESSAGE( aMsg2.pData->buffer, aKnownGoodOUStr.equals(aTestOUStr) );
+        //test case for cell text with line breaks.
+        pDoc->GetString(3,5,1, aTestOUStr);
+        aKnownGoodOUStr = "Hello,\nCalc!";
+        aTestOStr = rtl::OUStringToOString(aTestOUStr, RTL_TEXTENCODING_UTF8);
+        aKnownGoodOStr = rtl::OUStringToOString(aKnownGoodOUStr, RTL_TEXTENCODING_UTF8);
+        rtl::OString aMsg3("Expected: \"" + aKnownGoodOStr + "\"; Actual: \"" + aTestOStr + "\"");
+        CPPUNIT_ASSERT_MESSAGE( aMsg3.pData->buffer, aKnownGoodOUStr.equals(aTestOUStr) );
     }
     pPattern = pDoc->GetPattern(1,4,1);
     Color aColor = static_cast<const SvxBrushItem&>(pPattern->GetItem(ATTR_BACKGROUND)).GetColor();
commit fc83fd6b3b87e2e57054647a790aed51abc79097
Author: Daniel Bankston <daniel.e.bankston at gmail.com>
Date:   Tue Jun 12 04:46:29 2012 -0500

    Add test case for row height to formats unit test
    
    -Added test case for proper import height of first row with styles and text
    (related to i53253).
    
    Change-Id: I18eae540bbd388b3b703b4b113dad5745db53b0f

diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx
index a9374bf..c68b42d 100644
--- a/sc/qa/unit/subsequent_filters-test.cxx
+++ b/sc/qa/unit/subsequent_filters-test.cxx
@@ -405,14 +405,20 @@ void testFormats_Impl(ScFiltersTest* pFiltersTest, ScDocument* pDoc, sal_Int32 n
         pPattern = pDoc->GetPattern(1,3,1);
         pPattern->GetFont(aFont, SC_AUTOCOL_RAW);
         CPPUNIT_ASSERT_MESSAGE("font should be underlined with a dotted line", aFont.GetUnderline() == UNDERLINE_DOTTED);
+        //test case for proper import height of first row with styles and text (related to i53253)
+        sal_uInt16 nRowHeight = pDoc->GetRowHeight(0,1);
+        rtl::OString sRowHeight = rtl::OString::valueOf( static_cast<sal_Int32>(nRowHeight) );
+        rtl::OString aMsg1("Expected: 253; Actual: ");
+        aMsg1 += sRowHeight;
+        CPPUNIT_ASSERT_MESSAGE( aMsg1.pData->buffer, nRowHeight == 253 );
         //test case for i53253 where a cell has text with different styles and space between the text.
         rtl::OUString aTestOUStr;
         pDoc->GetString(3,0,1, aTestOUStr);
         rtl::OUString aKnownGoodOUStr("text14 space");
         rtl::OString aTestOStr(rtl::OUStringToOString(aTestOUStr, RTL_TEXTENCODING_UTF8));
         rtl::OString aKnownGoodOStr(rtl::OUStringToOString(aKnownGoodOUStr, RTL_TEXTENCODING_UTF8));
-        rtl::OString aMsg("Expected: \"" + aKnownGoodOStr + "\"; Actual: \"" + aTestOStr + "\"");
-        CPPUNIT_ASSERT_MESSAGE( aMsg.pData->buffer, aKnownGoodOUStr.equals(aTestOUStr) );
+        rtl::OString aMsg2("Expected: \"" + aKnownGoodOStr + "\"; Actual: \"" + aTestOStr + "\"");
+        CPPUNIT_ASSERT_MESSAGE( aMsg2.pData->buffer, aKnownGoodOUStr.equals(aTestOUStr) );
     }
     pPattern = pDoc->GetPattern(1,4,1);
     Color aColor = static_cast<const SvxBrushItem&>(pPattern->GetItem(ATTR_BACKGROUND)).GetColor();
commit 08db2eb944f3134c5b61da4abd5b41fcd4ed6bdd
Author: Daniel Bankston <daniel.e.bankston at gmail.com>
Date:   Tue Jun 12 03:20:42 2012 -0500

    Add test case for i53253 to formats unit test
    
    -Added test case for i53253 where a cell has text with different styles and
    space between the text.
    
    Change-Id: I69afa689dcb28d15b22ebed2d97e4b60178d6101

diff --git a/sc/qa/unit/data/ods/formats.ods b/sc/qa/unit/data/ods/formats.ods
index 2fa9c13..c4c9ba8 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 63d12a3..a9374bf 100644
--- a/sc/qa/unit/subsequent_filters-test.cxx
+++ b/sc/qa/unit/subsequent_filters-test.cxx
@@ -396,7 +396,7 @@ void testFormats_Impl(ScFiltersTest* pFiltersTest, ScDocument* pDoc, sal_Int32 n
     pPattern = pDoc->GetPattern(1,1,1);
     pPattern->GetFont(aFont, SC_AUTOCOL_RAW);
     CPPUNIT_ASSERT_MESSAGE("font should be striked out with a single line", aFont.GetStrikeout() == STRIKEOUT_SINGLE );
-    //test double strikeout only for ods
+    //some tests on sheet2 only for ods
     if (nFormat == ODS)
     {
         pPattern = pDoc->GetPattern(1,2,1);
@@ -405,6 +405,14 @@ void testFormats_Impl(ScFiltersTest* pFiltersTest, ScDocument* pDoc, sal_Int32 n
         pPattern = pDoc->GetPattern(1,3,1);
         pPattern->GetFont(aFont, SC_AUTOCOL_RAW);
         CPPUNIT_ASSERT_MESSAGE("font should be underlined with a dotted line", aFont.GetUnderline() == UNDERLINE_DOTTED);
+        //test case for i53253 where a cell has text with different styles and space between the text.
+        rtl::OUString aTestOUStr;
+        pDoc->GetString(3,0,1, aTestOUStr);
+        rtl::OUString aKnownGoodOUStr("text14 space");
+        rtl::OString aTestOStr(rtl::OUStringToOString(aTestOUStr, RTL_TEXTENCODING_UTF8));
+        rtl::OString aKnownGoodOStr(rtl::OUStringToOString(aKnownGoodOUStr, RTL_TEXTENCODING_UTF8));
+        rtl::OString aMsg("Expected: \"" + aKnownGoodOStr + "\"; Actual: \"" + aTestOStr + "\"");
+        CPPUNIT_ASSERT_MESSAGE( aMsg.pData->buffer, aKnownGoodOUStr.equals(aTestOUStr) );
     }
     pPattern = pDoc->GetPattern(1,4,1);
     Color aColor = static_cast<const SvxBrushItem&>(pPattern->GetItem(ATTR_BACKGROUND)).GetColor();


More information about the Libreoffice-commits mailing list