LCOV - code coverage report
Current view: top level - test/source/sheet - xcellrangedata.cxx (source / functions) Hit Total Coverage
Test: commit e02a6cb2c3e2b23b203b422e4e0680877f232636 Lines: 0 29 0.0 %
Date: 2014-04-14 Functions: 0 5 0.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2             : /*
       3             :  * This file is part of the LibreOffice project.
       4             :  *
       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             :  */
       9             : 
      10             : #include <test/sheet/xcellrangedata.hxx>
      11             : #include <com/sun/star/sheet/XCellRangeData.hpp>
      12             : 
      13             : #include "cppunit/extensions/HelperMacros.h"
      14             : 
      15             : using namespace css;
      16             : using namespace css::uno;
      17             : 
      18             : namespace apitest {
      19             : 
      20             : namespace {
      21             : 
      22           0 : void setValues(uno::Sequence< uno::Sequence < Any > >& rColRow, double nOffset)
      23             : {
      24           0 :     for (sal_Int32 i = 0; i < 4; ++i)
      25             :     {
      26           0 :         rColRow[i].realloc(4);
      27           0 :         for (sal_Int32 j = 0; j < 4; ++j)
      28             :         {
      29           0 :             Any& aAny = rColRow[i][j];
      30           0 :             double nValue = i + j + nOffset;
      31           0 :             aAny <<= nValue;
      32             :         }
      33             :     }
      34           0 : }
      35             : 
      36             : }
      37             : 
      38           0 : void XCellRangeData::testSetDataArray()
      39             : {
      40           0 :     uno::Reference< sheet::XCellRangeData > xCellRangeData( getXCellRangeData(), UNO_QUERY_THROW);
      41             : 
      42           0 :     uno::Sequence< uno::Sequence < Any > > aColRow;
      43           0 :     aColRow.realloc(4);
      44           0 :     setValues(aColRow, 1);
      45           0 :     xCellRangeData->setDataArray(aColRow);
      46             :     // need to check here for correct values
      47             : 
      48             :     // set old values
      49           0 :     setValues(aColRow, 0);
      50           0 :     xCellRangeData->setDataArray(aColRow);
      51           0 : }
      52             : 
      53           0 : void XCellRangeData::testGetDataArray()
      54             : {
      55           0 :     uno::Reference< sheet::XCellRangeData > xCellRangeData( getXCellRangeData(), UNO_QUERY_THROW);
      56           0 :     uno::Sequence< uno::Sequence < Any > > aColRow = xCellRangeData->getDataArray();
      57           0 :     for ( sal_Int32 i = 0; i < aColRow.getLength(); ++i)
      58             :     {
      59           0 :         for ( sal_Int32 j = 0; j < aColRow[i].getLength(); ++j)
      60             :         {
      61           0 :             Any& aAny = aColRow[i][j];
      62           0 :             double nValue = 0.0;
      63           0 :             CPPUNIT_ASSERT( aAny >>= nValue);
      64           0 :             CPPUNIT_ASSERT_DOUBLES_EQUAL(static_cast<double>(i+j), nValue, 0.000001);
      65             :         }
      66           0 :     }
      67           0 : }
      68             : 
      69           0 : }
      70             : 
      71             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10