diff options
author | Korrawit Pruegsanusak <detective.conan.1412@gmail.com> | 2012-02-21 15:24:10 +0000 |
---|---|---|
committer | Michael Meeks <michael.meeks@suse.com> | 2012-02-21 15:26:27 +0000 |
commit | 49e5d3f0e39ffaa4a76ebf4e15da92840578288b (patch) | |
tree | 057121cb554ef1ed03afd56eb708a645f2657011 /basegfx/test | |
parent | 57d95b35be6b6a5741d4769525ae15a1240c9d9d (diff) |
Add unit test for B2DRange's fround
Diffstat (limited to 'basegfx/test')
-rw-r--r-- | basegfx/test/basegfx2d.cxx | 29 |
1 files changed, 29 insertions, 0 deletions
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 <basegfx/range/b1drange.hxx> #include <basegfx/range/b1irange.hxx> #include <basegfx/range/b1ibox.hxx> +#include <basegfx/range/b2drange.hxx> #include <basegfx/range/b2dpolyrange.hxx> #include <basegfx/numeric/ftools.hxx> #include <basegfx/color/bcolor.hxx> @@ -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); |