fix baseline build (old cairo) - 'cairo_rectangle_int_t' does not name a type
[LibreOffice.git] / test / source / sheet / xcellrangedata.cxx
blobf297af53119671282444ab6ed5b12131bc01f369
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 */
10 #include <test/sheet/xcellrangedata.hxx>
11 #include <com/sun/star/sheet/XCellRangeData.hpp>
13 #include "cppunit/extensions/HelperMacros.h"
15 using namespace css;
16 using namespace css::uno;
18 namespace apitest {
20 namespace {
22 void setValues(uno::Sequence< uno::Sequence < Any > >& rColRow, double nOffset)
24 for (sal_Int32 i = 0; i < 4; ++i)
26 rColRow[i].realloc(4);
27 for (sal_Int32 j = 0; j < 4; ++j)
29 Any& aAny = rColRow[i][j];
30 double nValue = i + j + nOffset;
31 aAny <<= nValue;
38 void XCellRangeData::testSetDataArray()
40 uno::Reference< sheet::XCellRangeData > xCellRangeData( getXCellRangeData(), UNO_QUERY_THROW);
42 uno::Sequence< uno::Sequence < Any > > aColRow;
43 aColRow.realloc(4);
44 setValues(aColRow, 1);
45 xCellRangeData->setDataArray(aColRow);
46 // need to check here for correct values
48 // set old values
49 setValues(aColRow, 0);
50 xCellRangeData->setDataArray(aColRow);
53 void XCellRangeData::testGetDataArray()
55 uno::Reference< sheet::XCellRangeData > xCellRangeData( getXCellRangeData(), UNO_QUERY_THROW);
56 uno::Sequence< uno::Sequence < Any > > aColRow = xCellRangeData->getDataArray();
57 for ( sal_Int32 i = 0; i < aColRow.getLength(); ++i)
59 for ( sal_Int32 j = 0; j < aColRow[i].getLength(); ++j)
61 Any& aAny = aColRow[i][j];
62 double nValue = 0.0;
63 CPPUNIT_ASSERT( aAny >>= nValue);
64 CPPUNIT_ASSERT_DOUBLES_EQUAL(static_cast<double>(i+j), nValue, 0.000001);
71 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */