Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Quelle  ucalc_datatransformation.cxx

  Sprache: C
 

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
 * This file is part of the LibreOffice project.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */


#include <rtl/ustring.hxx>

#include "helper/qahelper.hxx"
#include <document.hxx>
#include <datatransformation.hxx>
#include <svl/numformat.hxx>
#include <tools/time.hxx>

class ScDataTransformationTest : public ScUcalcTestBase
{
public:
    virtual void setUp() override;
};

CPPUNIT_TEST_FIXTURE(ScDataTransformationTest, testColumnRemove)
{
    for (SCROW nRow = 0; nRow < 10; ++nRow)
    {
        for (SCCOL nCol = 0; nCol < 10; ++nCol)
        {
            m_pDoc->SetValue(nCol, nRow, 0, nRow*nCol);
        }
    }

    sc::ColumnRemoveTransformation aTransformation({5});
    aTransformation.Transform(*m_pDoc);

    for (SCROW nRow = 0; nRow < 10; ++nRow)
    {
        for (SCCOL nCol = 0; nCol < 9; ++nCol)
        {
            double nVal = m_pDoc->GetValue(nCol, nRow, 0);
            if (nCol < 5)
            {
                ASSERT_DOUBLES_EQUAL(static_cast<double>(nCol)*nRow, nVal);
            }
            else
            {
                ASSERT_DOUBLES_EQUAL(static_cast<double>(nCol+1)*nRow, nVal);
            }
        }
    }
}

CPPUNIT_TEST_FIXTURE(ScDataTransformationTest, testColumnSplit)
{
    m_pDoc->SetString(200, u"Test1,Test2"_ustr);
    m_pDoc->SetString(210, u"Test1,"_ustr);
    m_pDoc->SetString(220, u",Test1"_ustr);
    m_pDoc->SetString(230, u"Test1,Test2,Test3"_ustr);
    m_pDoc->SetString(300, u"AnotherString"_ustr);

    sc::SplitColumnTransformation aTransform(2',');
    aTransform.Transform(*m_pDoc);

    CPPUNIT_ASSERT_EQUAL(u"AnotherString"_ustr, m_pDoc->GetString(400));

    CPPUNIT_ASSERT_EQUAL(u"Test1"_ustr, m_pDoc->GetString(200));
    CPPUNIT_ASSERT_EQUAL(u"Test1"_ustr, m_pDoc->GetString(210));
    CPPUNIT_ASSERT_EQUAL(u""_ustr, m_pDoc->GetString(220));
    CPPUNIT_ASSERT_EQUAL(u"Test1"_ustr, m_pDoc->GetString(230));

    CPPUNIT_ASSERT_EQUAL(u"Test2"_ustr, m_pDoc->GetString(300));
    CPPUNIT_ASSERT_EQUAL(u""_ustr, m_pDoc->GetString(310));
    CPPUNIT_ASSERT_EQUAL(u"Test1"_ustr, m_pDoc->GetString(320));
    CPPUNIT_ASSERT_EQUAL(u"Test2,Test3"_ustr, m_pDoc->GetString(330));
}

CPPUNIT_TEST_FIXTURE(ScDataTransformationTest, testColumnMerge)
{
    m_pDoc->SetString(200, u"Berlin"_ustr);
    m_pDoc->SetString(210, u"Brussels"_ustr);
    m_pDoc->SetString(220, u"Paris"_ustr);
    m_pDoc->SetString(230, u"Peking"_ustr);

    m_pDoc->SetString(400, u"Germany"_ustr);
    m_pDoc->SetString(410, u"Belgium"_ustr);
    m_pDoc->SetString(420, u"France"_ustr);
    m_pDoc->SetString(430, u"China"_ustr);

    sc::MergeColumnTransformation aTransform({24}, u", "_ustr);
    aTransform.Transform(*m_pDoc);

    CPPUNIT_ASSERT_EQUAL(u"Berlin, Germany"_ustr, m_pDoc->GetString(200));
    CPPUNIT_ASSERT_EQUAL(u"Brussels, Belgium"_ustr, m_pDoc->GetString(210));
    CPPUNIT_ASSERT_EQUAL(u"Paris, France"_ustr, m_pDoc->GetString(220));
    CPPUNIT_ASSERT_EQUAL(u"Peking, China"_ustr, m_pDoc->GetString(230));

    for (SCROW nRow = 0; nRow <= 3; ++nRow)
    {
        CPPUNIT_ASSERT(m_pDoc->GetString(4, nRow, 0).isEmpty());
    }
}

CPPUNIT_TEST_FIXTURE(ScDataTransformationTest, testTextToLower)
{
    m_pDoc->SetString(200, u"Berlin"_ustr);
    m_pDoc->SetString(210, u"Brussels"_ustr);
    m_pDoc->SetString(220, u"Paris"_ustr);
    m_pDoc->SetString(230, u"Peking"_ustr);

    sc::TextTransformation aTransform({2}, sc::TEXT_TRANSFORM_TYPE::TO_LOWER);
    aTransform.Transform(*m_pDoc);

    CPPUNIT_ASSERT_EQUAL(u"berlin"_ustr, m_pDoc->GetString(200));
    CPPUNIT_ASSERT_EQUAL(u"brussels"_ustr, m_pDoc->GetString(210));
    CPPUNIT_ASSERT_EQUAL(u"paris"_ustr, m_pDoc->GetString(220));
    CPPUNIT_ASSERT_EQUAL(u"peking"_ustr, m_pDoc->GetString(230));
}

CPPUNIT_TEST_FIXTURE(ScDataTransformationTest, testTextToUpper)
{
    m_pDoc->SetString(200, u"Berlin"_ustr);
    m_pDoc->SetString(210, u"Brussels"_ustr);
    m_pDoc->SetString(220, u"Paris"_ustr);
    m_pDoc->SetString(230, u"Peking"_ustr);

    sc::TextTransformation aTransform({2}, sc::TEXT_TRANSFORM_TYPE::TO_UPPER);
    aTransform.Transform(*m_pDoc);

    CPPUNIT_ASSERT_EQUAL(u"BERLIN"_ustr, m_pDoc->GetString(200));
    CPPUNIT_ASSERT_EQUAL(u"BRUSSELS"_ustr, m_pDoc->GetString(210));
    CPPUNIT_ASSERT_EQUAL(u"PARIS"_ustr, m_pDoc->GetString(220));
    CPPUNIT_ASSERT_EQUAL(u"PEKING"_ustr, m_pDoc->GetString(230));
}

CPPUNIT_TEST_FIXTURE(ScDataTransformationTest, testTextCapitalize)
{
    m_pDoc->SetString(200, u"hello woRlD"_ustr);
    m_pDoc->SetString(210, u"qUe vA"_ustr);
    m_pDoc->SetString(220, u"si tu la ves"_ustr);
    m_pDoc->SetString(230, u"cUaNdO mE EnAmOro"_ustr);

    sc::TextTransformation aTransform({2}, sc::TEXT_TRANSFORM_TYPE::CAPITALIZE);
    aTransform.Transform(*m_pDoc);

    CPPUNIT_ASSERT_EQUAL(u"Hello World"_ustr, m_pDoc->GetString(200));
    CPPUNIT_ASSERT_EQUAL(u"Que Va"_ustr, m_pDoc->GetString(210));
    CPPUNIT_ASSERT_EQUAL(u"Si Tu La Ves"_ustr, m_pDoc->GetString(220));
    CPPUNIT_ASSERT_EQUAL(u"Cuando Me Enamoro"_ustr, m_pDoc->GetString(230));
}

CPPUNIT_TEST_FIXTURE(ScDataTransformationTest, testTextTrim)
{
    m_pDoc->SetString(200, u" Berlin"_ustr);
    m_pDoc->SetString(210, u"Brussels "_ustr);
    m_pDoc->SetString(220, u" Paris "_ustr);

    sc::TextTransformation aTransform({2}, sc::TEXT_TRANSFORM_TYPE::TRIM);
    aTransform.Transform(*m_pDoc);

    CPPUNIT_ASSERT_EQUAL(u"Berlin"_ustr, m_pDoc->GetString(200));
    CPPUNIT_ASSERT_EQUAL(u"Brussels"_ustr, m_pDoc->GetString(210));
    CPPUNIT_ASSERT_EQUAL(u"Paris"_ustr, m_pDoc->GetString(220));
}

CPPUNIT_TEST_FIXTURE(ScDataTransformationTest, testAggregateSum)
{
    m_pDoc->SetValue(2002034);
    m_pDoc->SetValue(2102342);
    m_pDoc->SetValue(22057452);

    m_pDoc->SetValue(4004829.98);
    m_pDoc->SetValue(41053781.3);
    m_pDoc->SetValue(4209876.4);
    m_pDoc->SetValue(4300);

    sc::AggregateFunction aTransform({24}, sc::AGGREGATE_FUNCTION::SUM);
    aTransform.Transform(*m_pDoc);

    CPPUNIT_ASSERT_DOUBLES_EQUAL(61828, m_pDoc->GetValue(240), 1e-10);
    CPPUNIT_ASSERT_DOUBLES_EQUAL(68487.68, m_pDoc->GetValue(440), 1e-10);
}

CPPUNIT_TEST_FIXTURE(ScDataTransformationTest, testAggregateAverage)
{
    m_pDoc->SetValue(2002034);
    m_pDoc->SetValue(2102342);
    m_pDoc->SetValue(22057453);

    m_pDoc->SetValue(3004);
    m_pDoc->SetValue(3104);
    m_pDoc->SetValue(3204);

    sc::AggregateFunction aTransform({23}, sc::AGGREGATE_FUNCTION::AVERAGE);
    aTransform.Transform(*m_pDoc);

    CPPUNIT_ASSERT_DOUBLES_EQUAL(20609.6666666667, m_pDoc->GetValue(230), 1e-10);
    CPPUNIT_ASSERT_DOUBLES_EQUAL(4, m_pDoc->GetValue(330), 1e-10);
}

CPPUNIT_TEST_FIXTURE(ScDataTransformationTest, testAggregateMin)
{
    m_pDoc->SetValue(2002034);
    m_pDoc->SetValue(2102342);
    m_pDoc->SetValue(22057453);

    m_pDoc->SetValue(3002034);
    m_pDoc->SetValue(310, -2342);
    m_pDoc->SetValue(32057453);

    sc::AggregateFunction aTransform({23}, sc::AGGREGATE_FUNCTION::MIN);
    aTransform.Transform(*m_pDoc);

    CPPUNIT_ASSERT_DOUBLES_EQUAL(2034, m_pDoc->GetValue(230), 1e-10);
    CPPUNIT_ASSERT_DOUBLES_EQUAL(-2342, m_pDoc->GetValue(330), 1e-10);
}

CPPUNIT_TEST_FIXTURE(ScDataTransformationTest, testAggregateMax)
{
    m_pDoc->SetValue(2002034);
    m_pDoc->SetValue(2102342);
    m_pDoc->SetValue(22057453);
    m_pDoc->SetValue(230, -453);

    m_pDoc->SetValue(3002034);
    m_pDoc->SetValue(310, -2342);
    m_pDoc->SetValue(320, -57453);
    m_pDoc->SetValue(330, -453);

    sc::AggregateFunction aTransform({23}, sc::AGGREGATE_FUNCTION::MAX);
    aTransform.Transform(*m_pDoc);

    CPPUNIT_ASSERT_DOUBLES_EQUAL(57453, m_pDoc->GetValue(240), 1e-10);
    CPPUNIT_ASSERT_DOUBLES_EQUAL(2034, m_pDoc->GetValue(340), 1e-10);
}

CPPUNIT_TEST_FIXTURE(ScDataTransformationTest, testNumberRound)
{
    m_pDoc->SetValue(2002034.342453456);
    m_pDoc->SetValue(2102342.252678567542);
    m_pDoc->SetValue(22057453.651345687654345676);
    m_pDoc->SetValue(230, -453.22234567543);

    sc::NumberTransformation aTransform({2}, sc::NUMBER_TRANSFORM_TYPE::ROUND, 4);
    aTransform.Transform(*m_pDoc);

    CPPUNIT_ASSERT_EQUAL(2034.3425, m_pDoc->GetValue(200));
    CPPUNIT_ASSERT_EQUAL(2342.2527, m_pDoc->GetValue(210));
    CPPUNIT_ASSERT_EQUAL(57453.6513, m_pDoc->GetValue(220));
    CPPUNIT_ASSERT_EQUAL(-453.2223, m_pDoc->GetValue(230));
}

CPPUNIT_TEST_FIXTURE(ScDataTransformationTest, testNumberRoundUp)
{
    m_pDoc->SetValue(2002034.34);
    m_pDoc->SetValue(2102342.22);
    m_pDoc->SetValue(22057453.65);
    m_pDoc->SetValue(230, -453.22);

    sc::NumberTransformation aTransform({2}, sc::NUMBER_TRANSFORM_TYPE::ROUND_UP);
    aTransform.Transform(*m_pDoc);

    CPPUNIT_ASSERT_EQUAL(2035.0, m_pDoc->GetValue(200));
    CPPUNIT_ASSERT_EQUAL(2343.0, m_pDoc->GetValue(210));
    CPPUNIT_ASSERT_EQUAL(57454.0, m_pDoc->GetValue(220));
    CPPUNIT_ASSERT_EQUAL(-453.0, m_pDoc->GetValue(230));
}

CPPUNIT_TEST_FIXTURE(ScDataTransformationTest, testNumberRoundDown)
{
    m_pDoc->SetValue(2002034.34);
    m_pDoc->SetValue(2102342.22);
    m_pDoc->SetValue(22057453.65);
    m_pDoc->SetValue(230, -453.22);

    sc::NumberTransformation aTransform({2}, sc::NUMBER_TRANSFORM_TYPE::ROUND_DOWN);
    aTransform.Transform(*m_pDoc);

    CPPUNIT_ASSERT_EQUAL(2034.0, m_pDoc->GetValue(200));
    CPPUNIT_ASSERT_EQUAL(2342.0, m_pDoc->GetValue(210));
    CPPUNIT_ASSERT_EQUAL(57453.0, m_pDoc->GetValue(220));
    CPPUNIT_ASSERT_EQUAL(-454.0, m_pDoc->GetValue(230));
}

CPPUNIT_TEST_FIXTURE(ScDataTransformationTest, testNumberAbsolute)
{
    m_pDoc->SetValue(2002034.34);
    m_pDoc->SetValue(210, -2342.22);
    m_pDoc->SetValue(22057453.65);
    m_pDoc->SetValue(230, -453.22);

    sc::NumberTransformation aTransform({2}, sc::NUMBER_TRANSFORM_TYPE::ABSOLUTE);
    aTransform.Transform(*m_pDoc);

    CPPUNIT_ASSERT_EQUAL(2034.34, m_pDoc->GetValue(200));
    CPPUNIT_ASSERT_EQUAL(2342.22, m_pDoc->GetValue(210));
    CPPUNIT_ASSERT_EQUAL(57453.65, m_pDoc->GetValue(220));
    CPPUNIT_ASSERT_EQUAL(453.22, m_pDoc->GetValue(230));
}

CPPUNIT_TEST_FIXTURE(ScDataTransformationTest, testNumberLogE)
{
    m_pDoc->SetValue(2001);
    m_pDoc->SetValue(2105);
    m_pDoc->SetValue(220, -9);
    m_pDoc->SetValue(230500);

    sc::NumberTransformation aTransform({2}, sc::NUMBER_TRANSFORM_TYPE::LOG_E);
    aTransform.Transform(*m_pDoc);

    CPPUNIT_ASSERT_DOUBLES_EQUAL(0, m_pDoc->GetValue(200), 1e-10);
    CPPUNIT_ASSERT_DOUBLES_EQUAL(1.60943791243, m_pDoc->GetValue(210), 1e-10);
    CPPUNIT_ASSERT_EQUAL(u""_ustr, m_pDoc->GetString(220));
    CPPUNIT_ASSERT_DOUBLES_EQUAL(6.21460809842, m_pDoc->GetValue(230), 1e-10);
}

CPPUNIT_TEST_FIXTURE(ScDataTransformationTest, testNumberLog10)
{
    m_pDoc->SetValue(2001);
    m_pDoc->SetValue(21010);
    m_pDoc->SetValue(220, -9);
    m_pDoc->SetValue(230500);

    sc::NumberTransformation aTransform({2}, sc::NUMBER_TRANSFORM_TYPE::LOG_10);
    aTransform.Transform(*m_pDoc);

    CPPUNIT_ASSERT_DOUBLES_EQUAL(0, m_pDoc->GetValue(200), 1e-10);
    CPPUNIT_ASSERT_DOUBLES_EQUAL(1.0, m_pDoc->GetValue(210), 1e-10);
    CPPUNIT_ASSERT_EQUAL(OUString(), m_pDoc->GetString(220));
    CPPUNIT_ASSERT_DOUBLES_EQUAL(2.69897000434, m_pDoc->GetValue(230), 1e-10);
}

CPPUNIT_TEST_FIXTURE(ScDataTransformationTest, testNumberCube)
{
    m_pDoc->SetValue(2002);
    m_pDoc->SetValue(210, -2);
    m_pDoc->SetValue(2208);
    m_pDoc->SetValue(230, -8);

    sc::NumberTransformation aTransform({2}, sc::NUMBER_TRANSFORM_TYPE::CUBE);
    aTransform.Transform(*m_pDoc);

    CPPUNIT_ASSERT_EQUAL(8.0, m_pDoc->GetValue(200));
    CPPUNIT_ASSERT_EQUAL(-8.0, m_pDoc->GetValue(210));
    CPPUNIT_ASSERT_EQUAL(512.0, m_pDoc->GetValue(220));
    CPPUNIT_ASSERT_EQUAL(-512.0, m_pDoc->GetValue(230));
}

CPPUNIT_TEST_FIXTURE(ScDataTransformationTest, testNumberSquare)
{
    m_pDoc->SetValue(2002);
    m_pDoc->SetValue(210, -2);
    m_pDoc->SetValue(2208);
    m_pDoc->SetValue(230, -8);

    sc::NumberTransformation aTransform({2}, sc::NUMBER_TRANSFORM_TYPE::SQUARE);
    aTransform.Transform(*m_pDoc);

    CPPUNIT_ASSERT_EQUAL(4.0, m_pDoc->GetValue(200));
    CPPUNIT_ASSERT_EQUAL(4.0, m_pDoc->GetValue(210));
    CPPUNIT_ASSERT_EQUAL(64.0, m_pDoc->GetValue(220));
    CPPUNIT_ASSERT_EQUAL(64.0, m_pDoc->GetValue(230));
}

CPPUNIT_TEST_FIXTURE(ScDataTransformationTest, testNumberSquareRoot)
{
    m_pDoc->SetValue(2008);
    m_pDoc->SetValue(2104);
    m_pDoc->SetValue(2209);

    sc::NumberTransformation aTransform({2}, sc::NUMBER_TRANSFORM_TYPE::SQUARE_ROOT);
    aTransform.Transform(*m_pDoc);

    CPPUNIT_ASSERT_DOUBLES_EQUAL(2.82842712475, m_pDoc->GetValue(200), 1e-10);
    CPPUNIT_ASSERT_DOUBLES_EQUAL(2.0, m_pDoc->GetValue(210), 1e-10);
    CPPUNIT_ASSERT_DOUBLES_EQUAL(3.0, m_pDoc->GetValue(220), 1e-10);
}

CPPUNIT_TEST_FIXTURE(ScDataTransformationTest, testNumberEven)
{
    m_pDoc->SetValue(2002034);
    m_pDoc->SetValue(2102343);
    m_pDoc->SetValue(22057453.65);
    m_pDoc->SetValue(230, -453);

    sc::NumberTransformation aTransform({2}, sc::NUMBER_TRANSFORM_TYPE::IS_EVEN);
    aTransform.Transform(*m_pDoc);

    CPPUNIT_ASSERT_EQUAL(1.0, m_pDoc->GetValue(200));
    CPPUNIT_ASSERT_EQUAL(0.0, m_pDoc->GetValue(210));
    CPPUNIT_ASSERT_EQUAL(0.0, m_pDoc->GetValue(220));
    CPPUNIT_ASSERT_EQUAL(0.0, m_pDoc->GetValue(230));
}

CPPUNIT_TEST_FIXTURE(ScDataTransformationTest, testNumberOdd)
{
    m_pDoc->SetValue(2002034);
    m_pDoc->SetValue(2102343);
    m_pDoc->SetValue(22057453.65);
    m_pDoc->SetValue(230, -453);

    sc::NumberTransformation aTransform({2}, sc::NUMBER_TRANSFORM_TYPE::IS_ODD);
    aTransform.Transform(*m_pDoc);

    CPPUNIT_ASSERT_EQUAL(0.0, m_pDoc->GetValue(200));
    CPPUNIT_ASSERT_EQUAL(1.0, m_pDoc->GetValue(210));
    CPPUNIT_ASSERT_EQUAL(0.0, m_pDoc->GetValue(220));
    CPPUNIT_ASSERT_EQUAL(1.0, m_pDoc->GetValue(230));
}

CPPUNIT_TEST_FIXTURE(ScDataTransformationTest, testNumberSign)
{
    m_pDoc->SetValue(2002034.34);
    m_pDoc->SetValue(210, -2342.22);
    m_pDoc->SetValue(2200);
    m_pDoc->SetValue(230, -453.22);

    sc::NumberTransformation aTransform({2}, sc::NUMBER_TRANSFORM_TYPE::SIGN);
    aTransform.Transform(*m_pDoc);

    CPPUNIT_ASSERT_EQUAL(1.0, m_pDoc->GetValue(200));
    CPPUNIT_ASSERT_EQUAL(-1.0, m_pDoc->GetValue(210));
    CPPUNIT_ASSERT_EQUAL(0.0, m_pDoc->GetValue(220));
    CPPUNIT_ASSERT_EQUAL(-1.0, m_pDoc->GetValue(230));
}

CPPUNIT_TEST_FIXTURE(ScDataTransformationTest, testReplaceNull)
{
    m_pDoc->SetString(200, u"Berlin"_ustr);
    m_pDoc->SetString(210, u""_ustr);
    m_pDoc->SetString(220, u""_ustr);
    m_pDoc->SetString(230, u"Peking"_ustr);

    sc::ReplaceNullTransformation aTransform({2}, u"Empty"_ustr);
    aTransform.Transform(*m_pDoc);

    CPPUNIT_ASSERT_EQUAL(u"Berlin"_ustr, m_pDoc->GetString(200));
    CPPUNIT_ASSERT_EQUAL(u"Empty"_ustr, m_pDoc->GetString(210));
    CPPUNIT_ASSERT_EQUAL(u"Empty"_ustr, m_pDoc->GetString(220));
    CPPUNIT_ASSERT_EQUAL(u"Peking"_ustr, m_pDoc->GetString(230));

}

CPPUNIT_TEST_FIXTURE(ScDataTransformationTest, testGetDateString)
{
    SvNumberFormatter* pFormatter = m_pDoc->GetFormatTable();
    css::util::Date aDate1(25,1,2011);
    css::util::Date aDate2(12,10,1994);
    css::util::Date aDate3(23,9,1996);
    css::util::Date aDate4(15,8,1947);

    double nDate1 = static_cast<double>(Date(aDate1) - pFormatter->GetNullDate());
    double nDate2 = static_cast<double>(Date(aDate2) - pFormatter->GetNullDate());
    double nDate3 = static_cast<double>(Date(aDate3) - pFormatter->GetNullDate());
    double nDate4 = static_cast<double>(Date(aDate4) - pFormatter->GetNullDate());

    m_pDoc->SetValue(200, nDate1);
    m_pDoc->SetValue(210, nDate2);
    m_pDoc->SetValue(220, nDate3);
    m_pDoc->SetValue(230, nDate4);

    sc:: DateTimeTransformation aTransform({2}, sc::DATETIME_TRANSFORMATION_TYPE::DATE_STRING   );
    aTransform.Transform(*m_pDoc);

    CPPUNIT_ASSERT_EQUAL(u"01/25/11"_ustr, m_pDoc->GetString(200));
    CPPUNIT_ASSERT_EQUAL(u"10/12/94"_ustr, m_pDoc->GetString(210));
    CPPUNIT_ASSERT_EQUAL(u"09/23/96"_ustr, m_pDoc->GetString(220));
    CPPUNIT_ASSERT_EQUAL(u"08/15/47"_ustr, m_pDoc->GetString(230));
}

CPPUNIT_TEST_FIXTURE(ScDataTransformationTest, testGetYear)
{
    SvNumberFormatter* pFormatter = m_pDoc->GetFormatTable();
    css::util::Date aDate1(25,1,2011);
    css::util::Date aDate2(12,10,1994);
    css::util::Date aDate3(23,9,1996);
    css::util::Date aDate4(15,8,1947);

    double nDate1 = static_cast<double>(Date(aDate1) - pFormatter->GetNullDate());
    double nDate2 = static_cast<double>(Date(aDate2) - pFormatter->GetNullDate());
    double nDate3 = static_cast<double>(Date(aDate3) - pFormatter->GetNullDate());
    double nDate4 = static_cast<double>(Date(aDate4) - pFormatter->GetNullDate());

    m_pDoc->SetValue(200, nDate1);
    m_pDoc->SetValue(210, nDate2);
    m_pDoc->SetValue(220, nDate3);
    m_pDoc->SetValue(230, nDate4);

    sc:: DateTimeTransformation aTransform({2}, sc::DATETIME_TRANSFORMATION_TYPE::YEAR   );
    aTransform.Transform(*m_pDoc);

    CPPUNIT_ASSERT_DOUBLES_EQUAL(2011, m_pDoc->GetValue(200), 0);
    CPPUNIT_ASSERT_DOUBLES_EQUAL(1994, m_pDoc->GetValue(210), 0);
    CPPUNIT_ASSERT_DOUBLES_EQUAL(1996, m_pDoc->GetValue(220), 0);
    CPPUNIT_ASSERT_DOUBLES_EQUAL(1947, m_pDoc->GetValue(230), 0);
}

CPPUNIT_TEST_FIXTURE(ScDataTransformationTest, testGetStartOfYear)
{
    SvNumberFormatter* pFormatter = m_pDoc->GetFormatTable();
    css::util::Date aDate1(25,1,2011);
    css::util::Date aDate2(12,10,1994);
    css::util::Date aDate3(23,9,1996);
    css::util::Date aDate4(15,8,1947);

    double nDate1 = static_cast<double>(Date(aDate1) - pFormatter->GetNullDate());
    double nDate2 = static_cast<double>(Date(aDate2) - pFormatter->GetNullDate());
    double nDate3 = static_cast<double>(Date(aDate3) - pFormatter->GetNullDate());
    double nDate4 = static_cast<double>(Date(aDate4) - pFormatter->GetNullDate());

    m_pDoc->SetValue(200, nDate1);
    m_pDoc->SetValue(210, nDate2);
    m_pDoc->SetValue(220, nDate3);
    m_pDoc->SetValue(230, nDate4);

    sc:: DateTimeTransformation aTransform({2}, sc::DATETIME_TRANSFORMATION_TYPE::START_OF_YEAR   );
    aTransform.Transform(*m_pDoc);

    CPPUNIT_ASSERT_EQUAL(u"01/01/11"_ustr, m_pDoc->GetString(200));
    CPPUNIT_ASSERT_EQUAL(u"01/01/94"_ustr, m_pDoc->GetString(210));
    CPPUNIT_ASSERT_EQUAL(u"01/01/96"_ustr, m_pDoc->GetString(220));
    CPPUNIT_ASSERT_EQUAL(u"01/01/47"_ustr, m_pDoc->GetString(230));
}

CPPUNIT_TEST_FIXTURE(ScDataTransformationTest, testGetEndOfYear)
{
    SvNumberFormatter* pFormatter = m_pDoc->GetFormatTable();
    css::util::Date aDate1(25,1,2011);
    css::util::Date aDate2(12,10,1994);
    css::util::Date aDate3(23,9,1996);
    css::util::Date aDate4(15,8,1947);

    double nDate1 = static_cast<double>(Date(aDate1) - pFormatter->GetNullDate());
    double nDate2 = static_cast<double>(Date(aDate2) - pFormatter->GetNullDate());
    double nDate3 = static_cast<double>(Date(aDate3) - pFormatter->GetNullDate());
    double nDate4 = static_cast<double>(Date(aDate4) - pFormatter->GetNullDate());

    m_pDoc->SetValue(200, nDate1);
    m_pDoc->SetValue(210, nDate2);
    m_pDoc->SetValue(220, nDate3);
    m_pDoc->SetValue(230, nDate4);

    sc:: DateTimeTransformation aTransform({2}, sc::DATETIME_TRANSFORMATION_TYPE::END_OF_YEAR   );
    aTransform.Transform(*m_pDoc);

    CPPUNIT_ASSERT_EQUAL(u"12/31/11"_ustr, m_pDoc->GetString(200));
    CPPUNIT_ASSERT_EQUAL(u"12/31/94"_ustr, m_pDoc->GetString(210));
    CPPUNIT_ASSERT_EQUAL(u"12/31/96"_ustr, m_pDoc->GetString(220));
    CPPUNIT_ASSERT_EQUAL(u"12/31/47"_ustr, m_pDoc->GetString(230));
}

CPPUNIT_TEST_FIXTURE(ScDataTransformationTest, testGetMonth)
{
    SvNumberFormatter* pFormatter = m_pDoc->GetFormatTable();
    css::util::Date aDate1(25,1,2011);
    css::util::Date aDate2(12,10,1994);
    css::util::Date aDate3(23,9,1996);
    css::util::Date aDate4(15,8,1947);

    double nDate1 = static_cast<double>(Date(aDate1) - pFormatter->GetNullDate());
    double nDate2 = static_cast<double>(Date(aDate2) - pFormatter->GetNullDate());
    double nDate3 = static_cast<double>(Date(aDate3) - pFormatter->GetNullDate());
    double nDate4 = static_cast<double>(Date(aDate4) - pFormatter->GetNullDate());

    m_pDoc->SetValue(200, nDate1);
    m_pDoc->SetValue(210, nDate2);
    m_pDoc->SetValue(220, nDate3);
    m_pDoc->SetValue(230, nDate4);

    sc:: DateTimeTransformation aTransform({2}, sc::DATETIME_TRANSFORMATION_TYPE::MONTH   );
    aTransform.Transform(*m_pDoc);

    CPPUNIT_ASSERT_DOUBLES_EQUAL(1, m_pDoc->GetValue(200), 0);
    CPPUNIT_ASSERT_DOUBLES_EQUAL(10, m_pDoc->GetValue(210), 0);
    CPPUNIT_ASSERT_DOUBLES_EQUAL(9, m_pDoc->GetValue(220), 0);
    CPPUNIT_ASSERT_DOUBLES_EQUAL(8, m_pDoc->GetValue(230), 0);
}

CPPUNIT_TEST_FIXTURE(ScDataTransformationTest, testGetMonthName)
{
    SvNumberFormatter* pFormatter = m_pDoc->GetFormatTable();
    css::util::Date aDate1(25,1,2011);
    css::util::Date aDate2(12,10,1994);
    css::util::Date aDate3(23,9,1996);
    css::util::Date aDate4(15,8,1947);

    double nDate1 = static_cast<double>(Date(aDate1) - pFormatter->GetNullDate());
    double nDate2 = static_cast<double>(Date(aDate2) - pFormatter->GetNullDate());
    double nDate3 = static_cast<double>(Date(aDate3) - pFormatter->GetNullDate());
    double nDate4 = static_cast<double>(Date(aDate4) - pFormatter->GetNullDate());

    m_pDoc->SetValue(200, nDate1);
    m_pDoc->SetValue(210, nDate2);
    m_pDoc->SetValue(220, nDate3);
    m_pDoc->SetValue(230, nDate4);

    sc:: DateTimeTransformation aTransform({2}, sc::DATETIME_TRANSFORMATION_TYPE::MONTH_NAME);
    aTransform.Transform(*m_pDoc);

    CPPUNIT_ASSERT_EQUAL(u"January"_ustr, m_pDoc->GetString(200));
    CPPUNIT_ASSERT_EQUAL(u"October"_ustr, m_pDoc->GetString(210));
    CPPUNIT_ASSERT_EQUAL(u"September"_ustr, m_pDoc->GetString(220));
    CPPUNIT_ASSERT_EQUAL(u"August"_ustr, m_pDoc->GetString(230));
}

CPPUNIT_TEST_FIXTURE(ScDataTransformationTest, testGetStartOfMonth)
{
    SvNumberFormatter* pFormatter = m_pDoc->GetFormatTable();
    css::util::Date aDate1(25,1,2011);
    css::util::Date aDate2(12,10,1994);
    css::util::Date aDate3(23,9,1996);
    css::util::Date aDate4(15,8,1947);

    double nDate1 = static_cast<double>(Date(aDate1) - pFormatter->GetNullDate());
    double nDate2 = static_cast<double>(Date(aDate2) - pFormatter->GetNullDate());
    double nDate3 = static_cast<double>(Date(aDate3) - pFormatter->GetNullDate());
    double nDate4 = static_cast<double>(Date(aDate4) - pFormatter->GetNullDate());

    m_pDoc->SetValue(200, nDate1);
    m_pDoc->SetValue(210, nDate2);
    m_pDoc->SetValue(220, nDate3);
    m_pDoc->SetValue(230, nDate4);

    sc:: DateTimeTransformation aTransform({2}, sc::DATETIME_TRANSFORMATION_TYPE::START_OF_MONTH   );
    aTransform.Transform(*m_pDoc);

    CPPUNIT_ASSERT_EQUAL(u"01/01/11"_ustr, m_pDoc->GetString(200));
    CPPUNIT_ASSERT_EQUAL(u"10/01/94"_ustr, m_pDoc->GetString(210));
    CPPUNIT_ASSERT_EQUAL(u"09/01/96"_ustr, m_pDoc->GetString(220));
    CPPUNIT_ASSERT_EQUAL(u"08/01/47"_ustr, m_pDoc->GetString(230));
}

CPPUNIT_TEST_FIXTURE(ScDataTransformationTest, testGetEndOfMonth)
{
    SvNumberFormatter* pFormatter = m_pDoc->GetFormatTable();
    css::util::Date aDate1(25,1,2011);
    css::util::Date aDate2(12,10,1994);
    css::util::Date aDate3(23,9,1996);
    css::util::Date aDate4(15,8,1947);

    double nDate1 = static_cast<double>(Date(aDate1) - pFormatter->GetNullDate());
    double nDate2 = static_cast<double>(Date(aDate2) - pFormatter->GetNullDate());
    double nDate3 = static_cast<double>(Date(aDate3) - pFormatter->GetNullDate());
    double nDate4 = static_cast<double>(Date(aDate4) - pFormatter->GetNullDate());

    m_pDoc->SetValue(200, nDate1);
    m_pDoc->SetValue(210, nDate2);
    m_pDoc->SetValue(220, nDate3);
    m_pDoc->SetValue(230, nDate4);

    sc:: DateTimeTransformation aTransform({2}, sc::DATETIME_TRANSFORMATION_TYPE::END_OF_MONTH   );
    aTransform.Transform(*m_pDoc);

    CPPUNIT_ASSERT_EQUAL(u"01/31/11"_ustr, m_pDoc->GetString(200));
    CPPUNIT_ASSERT_EQUAL(u"10/31/94"_ustr, m_pDoc->GetString(210));
    CPPUNIT_ASSERT_EQUAL(u"09/30/96"_ustr, m_pDoc->GetString(220));
    CPPUNIT_ASSERT_EQUAL(u"08/31/47"_ustr, m_pDoc->GetString(230));
}

CPPUNIT_TEST_FIXTURE(ScDataTransformationTest, testGetDay)
{
    SvNumberFormatter* pFormatter = m_pDoc->GetFormatTable();
    css::util::Date aDate1(25,1,2011);
    css::util::Date aDate2(12,10,1994);
    css::util::Date aDate3(23,9,1996);
    css::util::Date aDate4(15,8,1947);

    double nDate1 = static_cast<double>(Date(aDate1) - pFormatter->GetNullDate());
    double nDate2 = static_cast<double>(Date(aDate2) - pFormatter->GetNullDate());
    double nDate3 = static_cast<double>(Date(aDate3) - pFormatter->GetNullDate());
    double nDate4 = static_cast<double>(Date(aDate4) - pFormatter->GetNullDate());

    m_pDoc->SetValue(200, nDate1);
    m_pDoc->SetValue(210, nDate2);
    m_pDoc->SetValue(220, nDate3);
    m_pDoc->SetValue(230, nDate4);

    sc:: DateTimeTransformation aTransform({2}, sc::DATETIME_TRANSFORMATION_TYPE::DAY   );
    aTransform.Transform(*m_pDoc);

    CPPUNIT_ASSERT_DOUBLES_EQUAL(25, m_pDoc->GetValue(200), 0);
    CPPUNIT_ASSERT_DOUBLES_EQUAL(12, m_pDoc->GetValue(210), 0);
    CPPUNIT_ASSERT_DOUBLES_EQUAL(23, m_pDoc->GetValue(220), 0);
    CPPUNIT_ASSERT_DOUBLES_EQUAL(15, m_pDoc->GetValue(230), 0);
}

CPPUNIT_TEST_FIXTURE(ScDataTransformationTest, testGetDayOfWeek)
{
    SvNumberFormatter* pFormatter = m_pDoc->GetFormatTable();
    css::util::Date aDate1(25,1,2011);
    css::util::Date aDate2(12,10,1994);
    css::util::Date aDate3(23,9,1996);
    css::util::Date aDate4(15,8,1947);

    double nDate1 = static_cast<double>(Date(aDate1) - pFormatter->GetNullDate());
    double nDate2 = static_cast<double>(Date(aDate2) - pFormatter->GetNullDate());
    double nDate3 = static_cast<double>(Date(aDate3) - pFormatter->GetNullDate());
    double nDate4 = static_cast<double>(Date(aDate4) - pFormatter->GetNullDate());

    m_pDoc->SetValue(200, nDate1);
    m_pDoc->SetValue(210, nDate2);
    m_pDoc->SetValue(220, nDate3);
    m_pDoc->SetValue(230, nDate4);

    sc:: DateTimeTransformation aTransform({2}, sc::DATETIME_TRANSFORMATION_TYPE::DAY_OF_WEEK  );
    aTransform.Transform(*m_pDoc);

    CPPUNIT_ASSERT_DOUBLES_EQUAL(1, m_pDoc->GetValue(200), 0);
    CPPUNIT_ASSERT_DOUBLES_EQUAL(2, m_pDoc->GetValue(210), 0);
    CPPUNIT_ASSERT_DOUBLES_EQUAL(0, m_pDoc->GetValue(220), 0);
    CPPUNIT_ASSERT_DOUBLES_EQUAL(4, m_pDoc->GetValue(230), 0);
}

CPPUNIT_TEST_FIXTURE(ScDataTransformationTest, testGetDayOfYear)
{
    SvNumberFormatter* pFormatter = m_pDoc->GetFormatTable();
    css::util::Date aDate1(25,1,2011);
    css::util::Date aDate2(12,10,1994);
    css::util::Date aDate3(23,9,1996);
    css::util::Date aDate4(15,8,1947);

    double nDate1 = static_cast<double>(Date(aDate1) - pFormatter->GetNullDate());
    double nDate2 = static_cast<double>(Date(aDate2) - pFormatter->GetNullDate());
    double nDate3 = static_cast<double>(Date(aDate3) - pFormatter->GetNullDate());
    double nDate4 = static_cast<double>(Date(aDate4) - pFormatter->GetNullDate());

    m_pDoc->SetValue(200, nDate1);
    m_pDoc->SetValue(210, nDate2);
    m_pDoc->SetValue(220, nDate3);
    m_pDoc->SetValue(230, nDate4);

    sc:: DateTimeTransformation aTransform({2}, sc::DATETIME_TRANSFORMATION_TYPE::DAY_OF_YEAR  );
    aTransform.Transform(*m_pDoc);

    CPPUNIT_ASSERT_DOUBLES_EQUAL(25, m_pDoc->GetValue(200), 0);
    CPPUNIT_ASSERT_DOUBLES_EQUAL(285, m_pDoc->GetValue(210), 0);
    CPPUNIT_ASSERT_DOUBLES_EQUAL(267, m_pDoc->GetValue(220), 0);
    CPPUNIT_ASSERT_DOUBLES_EQUAL(227, m_pDoc->GetValue(230), 0);
}

CPPUNIT_TEST_FIXTURE(ScDataTransformationTest, testGetQuarter)
{
    SvNumberFormatter* pFormatter = m_pDoc->GetFormatTable();
    css::util::Date aDate1(25,1,2011);
    css::util::Date aDate2(12,10,1994);
    css::util::Date aDate3(23,9,1996);
    css::util::Date aDate4(15,8,1947);

    double nDate1 = static_cast<double>(Date(aDate1) - pFormatter->GetNullDate());
    double nDate2 = static_cast<double>(Date(aDate2) - pFormatter->GetNullDate());
    double nDate3 = static_cast<double>(Date(aDate3) - pFormatter->GetNullDate());
    double nDate4 = static_cast<double>(Date(aDate4) - pFormatter->GetNullDate());

    m_pDoc->SetValue(200, nDate1);
    m_pDoc->SetValue(210, nDate2);
    m_pDoc->SetValue(220, nDate3);
    m_pDoc->SetValue(230, nDate4);

    sc:: DateTimeTransformation aTransform({2}, sc::DATETIME_TRANSFORMATION_TYPE::QUARTER   );
    aTransform.Transform(*m_pDoc);

    CPPUNIT_ASSERT_DOUBLES_EQUAL(1, m_pDoc->GetValue(200), 0);
    CPPUNIT_ASSERT_DOUBLES_EQUAL(4, m_pDoc->GetValue(210), 0);
    CPPUNIT_ASSERT_DOUBLES_EQUAL(3, m_pDoc->GetValue(220), 0);
    CPPUNIT_ASSERT_DOUBLES_EQUAL(3, m_pDoc->GetValue(230), 0);
}

CPPUNIT_TEST_FIXTURE(ScDataTransformationTest, testGetStartOfQuarter)
{
    SvNumberFormatter* pFormatter = m_pDoc->GetFormatTable();
    css::util::Date aDate1(25,1,2011);
    css::util::Date aDate2(12,10,1994);
    css::util::Date aDate3(23,9,1996);
    css::util::Date aDate4(15,8,1947);

    double nDate1 = static_cast<double>(Date(aDate1) - pFormatter->GetNullDate());
    double nDate2 = static_cast<double>(Date(aDate2) - pFormatter->GetNullDate());
    double nDate3 = static_cast<double>(Date(aDate3) - pFormatter->GetNullDate());
    double nDate4 = static_cast<double>(Date(aDate4) - pFormatter->GetNullDate());

    m_pDoc->SetValue(200, nDate1);
    m_pDoc->SetValue(210, nDate2);
    m_pDoc->SetValue(220, nDate3);
    m_pDoc->SetValue(230, nDate4);

    sc:: DateTimeTransformation aTransform({2}, sc::DATETIME_TRANSFORMATION_TYPE::START_OF_QUARTER   );
    aTransform.Transform(*m_pDoc);

    CPPUNIT_ASSERT_EQUAL(u"01/01/11"_ustr, m_pDoc->GetString(200));
    CPPUNIT_ASSERT_EQUAL(u"10/01/94"_ustr, m_pDoc->GetString(210));
    CPPUNIT_ASSERT_EQUAL(u"07/01/96"_ustr, m_pDoc->GetString(220));
    CPPUNIT_ASSERT_EQUAL(u"07/01/47"_ustr, m_pDoc->GetString(230));
}

CPPUNIT_TEST_FIXTURE(ScDataTransformationTest, testGetEndOfQuarter)
{
    SvNumberFormatter* pFormatter = m_pDoc->GetFormatTable();
    css::util::Date aDate1(25,1,2011);
    css::util::Date aDate2(12,10,1994);
    css::util::Date aDate3(23,9,1996);
    css::util::Date aDate4(15,8,1947);

    double nDate1 = static_cast<double>(Date(aDate1) - pFormatter->GetNullDate());
    double nDate2 = static_cast<double>(Date(aDate2) - pFormatter->GetNullDate());
    double nDate3 = static_cast<double>(Date(aDate3) - pFormatter->GetNullDate());
    double nDate4 = static_cast<double>(Date(aDate4) - pFormatter->GetNullDate());

    m_pDoc->SetValue(200, nDate1);
    m_pDoc->SetValue(210, nDate2);
    m_pDoc->SetValue(220, nDate3);
    m_pDoc->SetValue(230, nDate4);

    sc:: DateTimeTransformation aTransform({2}, sc::DATETIME_TRANSFORMATION_TYPE::END_OF_QUARTER   );
    aTransform.Transform(*m_pDoc);

    CPPUNIT_ASSERT_EQUAL(u"03/31/11"_ustr, m_pDoc->GetString(200));
    CPPUNIT_ASSERT_EQUAL(u"12/31/94"_ustr, m_pDoc->GetString(210));
    CPPUNIT_ASSERT_EQUAL(u"09/30/96"_ustr, m_pDoc->GetString(220));
    CPPUNIT_ASSERT_EQUAL(u"09/30/47"_ustr, m_pDoc->GetString(230));
}

CPPUNIT_TEST_FIXTURE(ScDataTransformationTest, testGetTime)
{
    tools::Time aTime1(5,30,12);
    tools::Time aTime2(7,23,9);
    tools::Time aTime3(9,34,40);
    tools::Time aTime4(22,9,49);

    m_pDoc->SetValue(200, aTime1.GetTimeInDays());
    m_pDoc->SetValue(210, aTime2.GetTimeInDays());
    m_pDoc->SetValue(220, aTime3.GetTimeInDays());
    m_pDoc->SetValue(230, aTime4.GetTimeInDays());

    sc:: DateTimeTransformation aTransform({2}, sc::DATETIME_TRANSFORMATION_TYPE::TIME  );
    aTransform.Transform(*m_pDoc);

    CPPUNIT_ASSERT_EQUAL(u"05:30:12 AM"_ustr, m_pDoc->GetString(200));
    CPPUNIT_ASSERT_EQUAL(u"07:23:09 AM"_ustr, m_pDoc->GetString(210));
    CPPUNIT_ASSERT_EQUAL(u"09:34:40 AM"_ustr, m_pDoc->GetString(220));
    CPPUNIT_ASSERT_EQUAL(u"10:09:49 PM"_ustr, m_pDoc->GetString(230));
}

CPPUNIT_TEST_FIXTURE(ScDataTransformationTest, testGetHour)
{
    tools::Time aTime1(5,30,12);
    tools::Time aTime2(7,23,9);
    tools::Time aTime3(9,34,40);
    tools::Time aTime4(22,9,49);

    m_pDoc->SetValue(200, aTime1.GetTimeInDays());
    m_pDoc->SetValue(210, aTime2.GetTimeInDays());
    m_pDoc->SetValue(220, aTime3.GetTimeInDays());
    m_pDoc->SetValue(230, aTime4.GetTimeInDays());

    sc:: DateTimeTransformation aTransform({2}, sc::DATETIME_TRANSFORMATION_TYPE::HOUR  );
    aTransform.Transform(*m_pDoc);

    CPPUNIT_ASSERT_DOUBLES_EQUAL(5, m_pDoc->GetValue(200), 0);
    CPPUNIT_ASSERT_DOUBLES_EQUAL(7, m_pDoc->GetValue(210), 0);
    CPPUNIT_ASSERT_DOUBLES_EQUAL(9, m_pDoc->GetValue(220), 0);
    CPPUNIT_ASSERT_DOUBLES_EQUAL(22, m_pDoc->GetValue(230), 0);
}

CPPUNIT_TEST_FIXTURE(ScDataTransformationTest, testGetMinute)
{
    tools::Time aTime1(5,30,12);
    tools::Time aTime2(7,23,9);
    tools::Time aTime3(9,34,40);
    tools::Time aTime4(22,9,49);

    m_pDoc->SetValue(200, aTime1.GetTimeInDays());
    m_pDoc->SetValue(210, aTime2.GetTimeInDays());
    m_pDoc->SetValue(220, aTime3.GetTimeInDays());
    m_pDoc->SetValue(230, aTime4.GetTimeInDays());

    sc:: DateTimeTransformation aTransform({2}, sc::DATETIME_TRANSFORMATION_TYPE::MINUTE  );
    aTransform.Transform(*m_pDoc);

    CPPUNIT_ASSERT_DOUBLES_EQUAL(30, m_pDoc->GetValue(200), 0);
    CPPUNIT_ASSERT_DOUBLES_EQUAL(23, m_pDoc->GetValue(210), 0);
    CPPUNIT_ASSERT_DOUBLES_EQUAL(34, m_pDoc->GetValue(220), 0);
    CPPUNIT_ASSERT_DOUBLES_EQUAL(9, m_pDoc->GetValue(230), 0);
}

CPPUNIT_TEST_FIXTURE(ScDataTransformationTest, testGetSecond)
{
    tools::Time aTime1(5,30,53);
    tools::Time aTime2(7,23,10);
    tools::Time aTime3(9,34,40);
    tools::Time aTime4(22,9,49);

    m_pDoc->SetValue(200, aTime1.GetTimeInDays());
    m_pDoc->SetValue(210, aTime2.GetTimeInDays());
    m_pDoc->SetValue(220, aTime3.GetTimeInDays());
    m_pDoc->SetValue(230, aTime4.GetTimeInDays());

    sc:: DateTimeTransformation aTransform({2}, sc::DATETIME_TRANSFORMATION_TYPE::SECOND   );
    aTransform.Transform(*m_pDoc);

    CPPUNIT_ASSERT_DOUBLES_EQUAL(53, m_pDoc->GetValue(200), 0);
    CPPUNIT_ASSERT_DOUBLES_EQUAL(10, m_pDoc->GetValue(210), 0);
    CPPUNIT_ASSERT_DOUBLES_EQUAL(40, m_pDoc->GetValue(220), 0);
    CPPUNIT_ASSERT_DOUBLES_EQUAL(49, m_pDoc->GetValue(230), 0);
}

void ScDataTransformationTest::setUp()
{
    ScUcalcTestBase::setUp();
    m_pDoc->InsertTab(0, u"Tab"_ustr);
}

CPPUNIT_PLUGIN_IMPLEMENT();

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Messung V0.5 in Prozent
C=100 H=95 G=97

¤ Dauer der Verarbeitung: 0.17 Sekunden  (vorverarbeitet am  2026-06-11) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

letze Version des Elbe Quellennavigators


Jenseits des Üblichen ....

Besucher

Besucher

Statistik
#Sources=277311
#Domains=752002