[Libreoffice-commits] core.git: basegfx/test

Tomaž Vajngerl (via logerrit) logerrit at kemper.freedesktop.org
Thu Dec 26 20:48:17 UTC 2019


 basegfx/test/B2DRangeTest.cxx |   27 ++++++++++++++++-----------
 1 file changed, 16 insertions(+), 11 deletions(-)

New commits:
commit 39521e237387ece2ee0fea220f4f60407a891c56
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Thu Dec 26 11:00:12 2019 +0100
Commit:     Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Thu Dec 26 21:47:40 2019 +0100

    Test for B2DRange
    
    Change-Id: I8a616e4bbea8ec597f94c1b179b4e2221d10fcdb
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/85836
    Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>
    Tested-by: Tomaž Vajngerl <quikee at gmail.com>

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: */


More information about the Libreoffice-commits mailing list