1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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/.
10 #include <cppunit/TestAssert.h>
11 #include <cppunit/TestFixture.h>
12 #include <cppunit/extensions/HelperMacros.h>
13 #include <tools/gen.hxx>
18 class Test
: public CppUnit::TestFixture
21 void test_rectangle();
23 CPPUNIT_TEST_SUITE(Test
);
24 CPPUNIT_TEST(test_rectangle
);
25 CPPUNIT_TEST_SUITE_END();
28 void Test::test_rectangle()
31 tools::Rectangle
aRect(1,1,1,1);
33 CPPUNIT_ASSERT_EQUAL(long(1), aRect
.GetWidth());
34 CPPUNIT_ASSERT_EQUAL(long(1), aRect
.GetHeight());
36 CPPUNIT_ASSERT_EQUAL(long(0), aRect
.getWidth());
37 CPPUNIT_ASSERT_EQUAL(long(0), aRect
.getHeight());
41 tools::Rectangle
aRect(Point(), Size(1,1));
43 CPPUNIT_ASSERT_EQUAL(long(0), aRect
.Left());
44 CPPUNIT_ASSERT_EQUAL(long(0), aRect
.Top());
45 CPPUNIT_ASSERT_EQUAL(long(0), aRect
.Right());
46 CPPUNIT_ASSERT_EQUAL(long(0), aRect
.Bottom());
48 CPPUNIT_ASSERT_EQUAL(long(1), aRect
.GetWidth());
49 CPPUNIT_ASSERT_EQUAL(long(1), aRect
.GetHeight());
52 CPPUNIT_ASSERT_EQUAL(long(1), aRect
.GetHeight());
54 CPPUNIT_ASSERT_EQUAL(long(1), aRect
.GetWidth());
59 CPPUNIT_TEST_SUITE_REGISTRATION(Test
);
63 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */