diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2019-12-26 11:00:12 +0100 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2019-12-26 21:47:40 +0100 |
commit | 39521e237387ece2ee0fea220f4f60407a891c56 (patch) | |
tree | 8182df3a5a3093b43054fca74ddc4646c9129014 /basegfx/test | |
parent | df773dc769f6a0d676673ac9b5fc0e8132e435e6 (diff) |
Test for B2DRange
Change-Id: I8a616e4bbea8ec597f94c1b179b4e2221d10fcdb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/85836
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Tested-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'basegfx/test')
-rw-r--r-- | basegfx/test/B2DRangeTest.cxx | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/basegfx/test/B2DRangeTest.cxx b/basegfx/test/B2DRangeTest.cxx index 5f918c3d2fbf..fb23398ef55f 100644 --- a/basegfx/test/B2DRangeTest.cxx +++ b/basegfx/test/B2DRangeTest.cxx @@ -25,29 +25,34 @@ #include <basegfx/range/b2drange.hxx> #include <basegfx/range/b2irange.hxx> -namespace basegfx +class B2DRangeTest : public CppUnit::TestFixture { -class b2drange : public CppUnit::TestFixture -{ -private: -public: - void check() + void testRange() { + basegfx::B2DRange aRange(1.2, 2.3, 3.5, 4.8); + CPPUNIT_ASSERT_EQUAL(1.2, aRange.getMinX()); + CPPUNIT_ASSERT_EQUAL(3.5, aRange.getMaxX()); + CPPUNIT_ASSERT_EQUAL(2.3, aRange.getMinY()); + CPPUNIT_ASSERT_EQUAL(4.8, aRange.getMaxY()); + + CPPUNIT_ASSERT_EQUAL(2.3, aRange.getWidth()); + CPPUNIT_ASSERT_EQUAL(2.5, aRange.getHeight()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("simple range rounding from double to integer", - B2IRange(1, 2, 4, 5), fround(B2DRange(1.2, 2.3, 3.5, 4.8))); + basegfx::B2IRange(1, 2, 4, 5), fround(aRange)); } // Change the following lines only, if you add, remove or rename // member functions of the current class, // because these macros are need by auto register mechanism. - CPPUNIT_TEST_SUITE(b2drange); - CPPUNIT_TEST(check); + CPPUNIT_TEST_SUITE(B2DRangeTest); + CPPUNIT_TEST(testRange); CPPUNIT_TEST_SUITE_END(); }; -} -CPPUNIT_TEST_SUITE_REGISTRATION(basegfx::b2drange); +CPPUNIT_TEST_SUITE_REGISTRATION(B2DRangeTest); + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |