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/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include <cppunit/TestAssert.h>
21 #include <cppunit/TestFixture.h>
22 #include <cppunit/extensions/HelperMacros.h>
23 #include <cppunit/plugin/TestPlugIn.h>
25 #include <basegfx/range/b2drange.hxx>
26 #include <basegfx/range/b2irange.hxx>
28 class B2DRangeTest
: public CppUnit::TestFixture
32 basegfx::B2DRange
aRange(1.2, 2.3, 3.5, 4.8);
33 CPPUNIT_ASSERT_EQUAL(1.2, aRange
.getMinX());
34 CPPUNIT_ASSERT_EQUAL(3.5, aRange
.getMaxX());
35 CPPUNIT_ASSERT_EQUAL(2.3, aRange
.getMinY());
36 CPPUNIT_ASSERT_EQUAL(4.8, aRange
.getMaxY());
38 CPPUNIT_ASSERT_EQUAL(2.3, aRange
.getWidth());
39 CPPUNIT_ASSERT_EQUAL(2.5, aRange
.getHeight());
41 CPPUNIT_ASSERT_EQUAL_MESSAGE("simple range rounding from double to integer",
42 basegfx::B2IRange(1, 2, 4, 5), fround(aRange
));
45 // Change the following lines only, if you add, remove or rename
46 // member functions of the current class,
47 // because these macros are need by auto register mechanism.
49 CPPUNIT_TEST_SUITE(B2DRangeTest
);
50 CPPUNIT_TEST(testRange
);
51 CPPUNIT_TEST_SUITE_END();
54 CPPUNIT_TEST_SUITE_REGISTRATION(B2DRangeTest
);
56 CPPUNIT_PLUGIN_IMPLEMENT();
58 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */