nss: upgrade to release 3.73
[LibreOffice.git] / tools / qa / cppunit / test_rectangle.cxx
blob00970e47c7927586e98cf8b2560c85e440fb2cb6
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 <cppunit/TestAssert.h>
11 #include <cppunit/TestFixture.h>
12 #include <cppunit/extensions/HelperMacros.h>
13 #include <tools/gen.hxx>
15 namespace
17 class Test : public CppUnit::TestFixture
19 public:
20 void test_rectangle();
22 CPPUNIT_TEST_SUITE(Test);
23 CPPUNIT_TEST(test_rectangle);
24 CPPUNIT_TEST_SUITE_END();
27 void Test::test_rectangle()
30 tools::Rectangle aRect(1, 1, 1, 1);
32 CPPUNIT_ASSERT_EQUAL(tools::Long(1), aRect.GetWidth());
33 CPPUNIT_ASSERT_EQUAL(tools::Long(1), aRect.GetHeight());
35 CPPUNIT_ASSERT_EQUAL(tools::Long(0), aRect.getWidth());
36 CPPUNIT_ASSERT_EQUAL(tools::Long(0), aRect.getHeight());
40 tools::Rectangle aRect(Point(), Size(1, 1));
42 CPPUNIT_ASSERT_EQUAL(tools::Long(0), aRect.Left());
43 CPPUNIT_ASSERT_EQUAL(tools::Long(0), aRect.Top());
44 CPPUNIT_ASSERT_EQUAL(tools::Long(0), aRect.Right());
45 CPPUNIT_ASSERT_EQUAL(tools::Long(0), aRect.Bottom());
47 CPPUNIT_ASSERT_EQUAL(tools::Long(1), aRect.GetWidth());
48 CPPUNIT_ASSERT_EQUAL(tools::Long(1), aRect.GetHeight());
50 aRect.setX(12);
51 CPPUNIT_ASSERT_EQUAL(tools::Long(1), aRect.GetHeight());
52 aRect.setY(12);
53 CPPUNIT_ASSERT_EQUAL(tools::Long(1), aRect.GetWidth());
57 CPPUNIT_TEST_SUITE_REGISTRATION(Test);
60 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */