LCOV - code coverage report
Current view: top level - test/source/sheet - cellproperties.cxx (source / functions) Hit Total Coverage
Test: commit 10e77ab3ff6f4314137acd6e2702a6e5c1ce1fae Lines: 31 31 100.0 %
Date: 2014-11-03 Functions: 4 4 100.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/cellproperties.hxx>
      11             : 
      12             : #include <com/sun/star/beans/XPropertySet.hpp>
      13             : #include <com/sun/star/table/CellVertJustify.hpp>
      14             : 
      15             : #include "cppunit/extensions/HelperMacros.h"
      16             : #include <iostream>
      17             : 
      18             : using namespace css;
      19             : using namespace css::uno;
      20             : 
      21             : namespace apitest {
      22             : 
      23           2 : void CellProperties::testVertJustify()
      24             : {
      25           2 :     uno::Reference< beans::XPropertySet > xCellRangeBase(init(),UNO_QUERY_THROW);
      26           4 :     OUString aVertJustify("VertJustify");
      27           4 :     uno::Any aOldVertJustify = xCellRangeBase->getPropertyValue(aVertJustify);
      28           2 :     sal_Int32 aValue = 0;
      29           2 :     CPPUNIT_ASSERT(aOldVertJustify >>= aValue);
      30           2 :     std::cout << "Old VertJustify value: " << aValue << std::endl;
      31             : 
      32           4 :     uno::Any aNewVertJustify;
      33           2 :     aNewVertJustify <<= static_cast<sal_Int32>(3);
      34           2 :     xCellRangeBase->setPropertyValue(aVertJustify, aNewVertJustify);
      35           4 :     uno::Any aVertJustifyControllValue = xCellRangeBase->getPropertyValue(aVertJustify);
      36           2 :     CPPUNIT_ASSERT(aVertJustifyControllValue >>= aValue);
      37           2 :     std::cout << "New VertJustify value: " << aValue << std::endl;
      38           4 :     CPPUNIT_ASSERT_MESSAGE("value has not been changed", aValue == 3);
      39           2 : }
      40             : 
      41           2 : void CellProperties::testRotateReference()
      42             : {
      43           2 :     uno::Reference< beans::XPropertySet > xCellRangeBase(init(),UNO_QUERY_THROW);
      44           4 :     OUString aRotateReference("RotateReference");
      45           4 :     uno::Any aOldRotateReference = xCellRangeBase->getPropertyValue(aRotateReference);
      46           2 :     sal_Int32 aValue = 0;
      47           2 :     CPPUNIT_ASSERT(aOldRotateReference >>= aValue);
      48           2 :     std::cout << "Old RotateReference Value: " << aValue << std::endl;
      49             : 
      50           4 :     uno::Any aNewRotateReference;
      51           2 :     aNewRotateReference <<= static_cast<sal_Int32>(3);
      52           2 :     xCellRangeBase->setPropertyValue(aRotateReference, aNewRotateReference);
      53           4 :     uno::Any aRotateReferenceControllValue = xCellRangeBase->getPropertyValue(aRotateReference);
      54           2 :     CPPUNIT_ASSERT(aRotateReferenceControllValue >>= aValue);
      55           2 :     std::cout << "New RotateReference value: " << aValue << std::endl;
      56           4 :     CPPUNIT_ASSERT_MESSAGE("value has not been changed", aValue == 3);
      57           2 : }
      58             : 
      59         144 : }
      60             : 
      61             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10