summaryrefslogtreecommitdiff
path: root/tools/qa/cppunit
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2021-07-25 21:12:15 +0900
committerTomaž Vajngerl <quikee@gmail.com>2021-07-30 08:20:21 +0200
commiteb31491b2a419ba7e67cc0a59a9b295fe49526e5 (patch)
tree6f69a4022be636c2420bf9f03d89ba1928c9a289 /tools/qa/cppunit
parent151237558c3da083a45b29a98523366a8d438aeb (diff)
tools: use upper case GetWidth/GetHeight for Rect for repr. string
When a rectangle is written to a string stream (usually used for representation string in CPP unit tests) we used getWidth and getHeight. It turns out that this methods don't return the correct value for width / height (off by one) in many cases so instead we need to use the upper-case variants GetWidth/GetHeight. Change-Id: Id655236155f94e092d9e9c24f9bd6857e9b0a558 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119489 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'tools/qa/cppunit')
-rw-r--r--tools/qa/cppunit/test_rectangle.cxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/qa/cppunit/test_rectangle.cxx b/tools/qa/cppunit/test_rectangle.cxx
index 00970e47c792..4e12b1d5933a 100644
--- a/tools/qa/cppunit/test_rectangle.cxx
+++ b/tools/qa/cppunit/test_rectangle.cxx
@@ -47,6 +47,11 @@ void Test::test_rectangle()
CPPUNIT_ASSERT_EQUAL(tools::Long(1), aRect.GetWidth());
CPPUNIT_ASSERT_EQUAL(tools::Long(1), aRect.GetHeight());
+ // Annoyingly getWidth and getHeight returns the wrong size
+ // that was explicitly inputed.
+ CPPUNIT_ASSERT_EQUAL(tools::Long(0), aRect.getWidth());
+ CPPUNIT_ASSERT_EQUAL(tools::Long(0), aRect.getHeight());
+
aRect.setX(12);
CPPUNIT_ASSERT_EQUAL(tools::Long(1), aRect.GetHeight());
aRect.setY(12);