bump product version to 7.6.3.2-android
[LibreOffice.git] / test / source / drawing / xshape.cxx
bloba63b89265798961ca577b49e6cde820cecb9a5e8
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
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/drawing/xshape.hxx>
11 #include <test/cppunitasserthelper.hxx>
13 #include <com/sun/star/awt/Point.hpp>
14 #include <com/sun/star/awt/Size.hpp>
15 #include <com/sun/star/drawing/XShape.hpp>
17 #include <com/sun/star/uno/Reference.hxx>
19 #include <cppunit/TestAssert.h>
21 using namespace css;
23 namespace apitest
25 void XShape::testGetSetPosition()
27 uno::Reference<drawing::XShape> xShape(init(), uno::UNO_QUERY_THROW);
28 if (m_bObjSupportsPosition)
30 awt::Point aOldPoint = xShape->getPosition();
31 CPPUNIT_ASSERT_NO_THROW(
32 xShape->setPosition(awt::Point(aOldPoint.X + 100, aOldPoint.Y + 100)));
34 awt::Point aNewPoint = xShape->getPosition();
35 CPPUNIT_ASSERT_EQUAL(awt::Point(aOldPoint.X + 100, aOldPoint.Y + 100), aNewPoint);
37 CPPUNIT_ASSERT(true);
40 void XShape::testGetSetSize()
42 uno::Reference<drawing::XShape> xShape(init(), uno::UNO_QUERY_THROW);
44 awt::Size aOldSize = xShape->getSize();
46 CPPUNIT_ASSERT_NO_THROW(xShape->setSize(awt::Size(aOldSize.Width + 10, aOldSize.Height + 10)));
48 awt::Size aNewSize = xShape->getSize();
49 const sal_Int16 aAcceptableLimit = 2;
50 CPPUNIT_ASSERT(aOldSize.Height - aNewSize.Height <= aAcceptableLimit);
51 CPPUNIT_ASSERT(aOldSize.Height - aNewSize.Height <= aAcceptableLimit);
54 } // namespace apitest
56 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */