Version 5.2.6.1, tag libreoffice-5.2.6.1
[LibreOffice.git] / tools / qa / cppunit / test_rectangle.cxx
blob4f3fff8afa34611b477915e244927e2d33083f4e
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 <sal/types.h>
11 #include "cppunit/TestAssert.h"
12 #include "cppunit/TestFixture.h"
13 #include "cppunit/extensions/HelperMacros.h"
14 #include "cppunit/plugin/TestPlugIn.h"
15 #include <tools/gen.hxx>
17 namespace
20 class Test: public CppUnit::TestFixture
22 public:
23 void test_rectangle();
25 CPPUNIT_TEST_SUITE(Test);
26 CPPUNIT_TEST(test_rectangle);
27 CPPUNIT_TEST_SUITE_END();
30 void Test::test_rectangle()
33 Rectangle aRect(1,1,1,1);
35 CPPUNIT_ASSERT_EQUAL(long(1), aRect.GetWidth());
36 CPPUNIT_ASSERT_EQUAL(long(1), aRect.GetHeight());
38 CPPUNIT_ASSERT_EQUAL(long(0), aRect.getWidth());
39 CPPUNIT_ASSERT_EQUAL(long(0), aRect.getHeight());
43 Rectangle aRect(Point(), Size(1,1));
45 CPPUNIT_ASSERT_EQUAL(long(0), aRect.Left());
46 CPPUNIT_ASSERT_EQUAL(long(0), aRect.Top());
47 CPPUNIT_ASSERT_EQUAL(long(0), aRect.Right());
48 CPPUNIT_ASSERT_EQUAL(long(0), aRect.Bottom());
50 CPPUNIT_ASSERT_EQUAL(long(1), aRect.GetWidth());
51 CPPUNIT_ASSERT_EQUAL(long(1), aRect.GetHeight());
53 aRect.setX(12);
54 CPPUNIT_ASSERT_EQUAL(long(1), aRect.GetHeight());
55 aRect.setY(12);
56 CPPUNIT_ASSERT_EQUAL(long(1), aRect.GetWidth());
61 CPPUNIT_TEST_SUITE_REGISTRATION(Test);
65 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */