From 49e5d3f0e39ffaa4a76ebf4e15da92840578288b Mon Sep 17 00:00:00 2001 From: Korrawit Pruegsanusak Date: Tue, 21 Feb 2012 15:24:10 +0000 Subject: Add unit test for B2DRange's fround --- basegfx/test/basegfx2d.cxx | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'basegfx') diff --git a/basegfx/test/basegfx2d.cxx b/basegfx/test/basegfx2d.cxx index d6e26a8470d0..325d0bd28947 100644 --- a/basegfx/test/basegfx2d.cxx +++ b/basegfx/test/basegfx2d.cxx @@ -49,6 +49,7 @@ #include #include #include +#include #include #include #include @@ -286,6 +287,33 @@ public: SAL_CPPUNIT_TEST_SUITE_END(); }; // class b2dsvgdimpex +class b2drange : public CppUnit::TestFixture +{ +private: +public: + void setUp() + { + } + + void tearDown() + { + } + + void check() + { + CPPUNIT_ASSERT_MESSAGE("simple range rounding from double to integer", + fround(B2DRange(1.2, 2.3, 3.5, 4.8)) == B2IRange(1, 2, 4, 5)); + } + + // 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. + + SAL_CPPUNIT_TEST_SUITE(b2drange); + CPPUNIT_TEST(check); + SAL_CPPUNIT_TEST_SUITE_END(); +}; + class b2dpolyrange : public CppUnit::TestFixture { private: @@ -1361,6 +1389,7 @@ public: // ----------------------------------------------------------------------------- CPPUNIT_TEST_SUITE_REGISTRATION(basegfx2d::b2dsvgdimpex); +CPPUNIT_TEST_SUITE_REGISTRATION(basegfx2d::b2drange); CPPUNIT_TEST_SUITE_REGISTRATION(basegfx2d::b2dpolyrange); CPPUNIT_TEST_SUITE_REGISTRATION(basegfx2d::b2dhommatrix); CPPUNIT_TEST_SUITE_REGISTRATION(basegfx2d::b2dpoint); -- cgit