1*70f497fbSAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*70f497fbSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*70f497fbSAndrew Rist * or more contributor license agreements. See the NOTICE file 5*70f497fbSAndrew Rist * distributed with this work for additional information 6*70f497fbSAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*70f497fbSAndrew Rist * to you under the Apache License, Version 2.0 (the 8*70f497fbSAndrew Rist * "License"); you may not use this file except in compliance 9*70f497fbSAndrew Rist * with the License. You may obtain a copy of the License at 10cdf0e10cSrcweir * 11*70f497fbSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12cdf0e10cSrcweir * 13*70f497fbSAndrew Rist * Unless required by applicable law or agreed to in writing, 14*70f497fbSAndrew Rist * software distributed under the License is distributed on an 15*70f497fbSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*70f497fbSAndrew Rist * KIND, either express or implied. See the License for the 17*70f497fbSAndrew Rist * specific language governing permissions and limitations 18*70f497fbSAndrew Rist * under the License. 19cdf0e10cSrcweir * 20*70f497fbSAndrew Rist *************************************************************/ 21*70f497fbSAndrew Rist 22*70f497fbSAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #include <testshl/simpleheader.hxx> 25cdf0e10cSrcweir #include <cppuhelper/compbase1.hxx> 26cdf0e10cSrcweir #include <comphelper/broadcasthelper.hxx> 27cdf0e10cSrcweir 28cdf0e10cSrcweir #include <basegfx/matrix/b2dhommatrix.hxx> 29cdf0e10cSrcweir #include <basegfx/range/b2drectangle.hxx> 30cdf0e10cSrcweir #include <cppcanvas/spritecanvas.hxx> 31cdf0e10cSrcweir 32cdf0e10cSrcweir #include "view.hxx" 33cdf0e10cSrcweir #include "unoview.hxx" 34cdf0e10cSrcweir #include "unoviewcontainer.hxx" 35cdf0e10cSrcweir #include "shape.hxx" 36cdf0e10cSrcweir #include "tests.hxx" 37cdf0e10cSrcweir #include "com/sun/star/presentation/XSlideShowView.hpp" 38cdf0e10cSrcweir 39cdf0e10cSrcweir namespace target = slideshow::internal; 40cdf0e10cSrcweir using namespace ::com::sun::star; 41cdf0e10cSrcweir 42cdf0e10cSrcweir namespace 43cdf0e10cSrcweir { 44cdf0e10cSrcweir 45cdf0e10cSrcweir class UnoViewContainerTest : public CppUnit::TestFixture 46cdf0e10cSrcweir { 47cdf0e10cSrcweir public: testContainer()48cdf0e10cSrcweir void testContainer() 49cdf0e10cSrcweir { 50cdf0e10cSrcweir target::UnoViewContainer aContainer; 51cdf0e10cSrcweir 52cdf0e10cSrcweir TestViewSharedPtr pView = createTestView(); 53cdf0e10cSrcweir aContainer.addView( pView ); 54cdf0e10cSrcweir 55cdf0e10cSrcweir CPPUNIT_ASSERT_MESSAGE( "Testing container size", 56cdf0e10cSrcweir 1 == std::distance( aContainer.begin(), 57cdf0e10cSrcweir aContainer.end() )); 58cdf0e10cSrcweir CPPUNIT_ASSERT_MESSAGE( "Testing disposedness", 59cdf0e10cSrcweir pView->paintScreen() ); 60cdf0e10cSrcweir aContainer.dispose(); 61cdf0e10cSrcweir CPPUNIT_ASSERT_MESSAGE( "Testing dispose: container must be empty", 62cdf0e10cSrcweir 0 == std::distance( aContainer.begin(), 63cdf0e10cSrcweir aContainer.end() )); 64cdf0e10cSrcweir CPPUNIT_ASSERT_MESSAGE( "Testing dispose: all elements must receive dispose", 65cdf0e10cSrcweir !pView->paintScreen() ); 66cdf0e10cSrcweir } 67cdf0e10cSrcweir 68cdf0e10cSrcweir // hook up the test 69cdf0e10cSrcweir CPPUNIT_TEST_SUITE(UnoViewContainerTest); 70cdf0e10cSrcweir CPPUNIT_TEST(testContainer); 71cdf0e10cSrcweir //CPPUNIT_TEST(testLayerManager); 72cdf0e10cSrcweir CPPUNIT_TEST_SUITE_END(); 73cdf0e10cSrcweir 74cdf0e10cSrcweir }; // class UnoViewContainerTest 75cdf0e10cSrcweir 76cdf0e10cSrcweir // ----------------------------------------------------------------------------- 77cdf0e10cSrcweir CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(UnoViewContainerTest, "UnoViewContainerTest"); 78cdf0e10cSrcweir } // namespace 79cdf0e10cSrcweir 80cdf0e10cSrcweir 81cdf0e10cSrcweir // ----------------------------------------------------------------------------- 82cdf0e10cSrcweir 83cdf0e10cSrcweir // this macro creates an empty function, which will called by the RegisterAllFunctions() 84cdf0e10cSrcweir // to let the user the possibility to also register some functions by hand. 85cdf0e10cSrcweir NOADDITIONAL; 86cdf0e10cSrcweir 87