diff options
author | Chris Sherlock <chris.sherlock79@gmail.com> | 2016-01-14 08:51:33 +1100 |
---|---|---|
committer | Chris Sherlock <chris.sherlock79@gmail.com> | 2016-01-14 08:51:33 +1100 |
commit | 71d5ffba4434538e7897b288ddfa2e0a6df03dd2 (patch) | |
tree | 9039975fb6b839a365e487cc869110ab32aad6c3 /vcl/qa | |
parent | d9c20d142539b53b052937274efd2e576d0712ec (diff) |
vcl: Create mutator for slant attribute in FontMetric
Mutator created for slant attribute in FontMetric.
See commit description in 8bfccd3a71d911b6d ("vcl: Create accessor
and mutator for font scaling in FontMetric") for reasoning behind
patch.
Unit tests
- check to ensure that can get and set slant attribute
- check equality operator on FontMetric after setting slant attribute
Change-Id: I5490a40dba4c86386d59a42f2d04303b3fc4d536
Diffstat (limited to 'vcl/qa')
-rw-r--r-- | vcl/qa/cppunit/fontmetric.cxx | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/vcl/qa/cppunit/fontmetric.cxx b/vcl/qa/cppunit/fontmetric.cxx index 3093783d3c8b..28657437abe8 100644 --- a/vcl/qa/cppunit/fontmetric.cxx +++ b/vcl/qa/cppunit/fontmetric.cxx @@ -27,6 +27,7 @@ public: void testFullstopCenteredFlag(); void testBuiltInFontFlag(); void testSpacings(); + void testSlant(); void testEqualityOperator(); CPPUNIT_TEST_SUITE(VclFontMetricTest); @@ -34,6 +35,7 @@ public: CPPUNIT_TEST(testFullstopCenteredFlag); CPPUNIT_TEST(testBuiltInFontFlag); CPPUNIT_TEST(testSpacings); + CPPUNIT_TEST(testSlant); CPPUNIT_TEST(testEqualityOperator); CPPUNIT_TEST_SUITE_END(); }; @@ -103,6 +105,18 @@ void VclFontMetricTest::testSpacings() } +void VclFontMetricTest::testSlant() +{ + // default constructor should set scalable flag to false + FontMetric aFontMetric; + + CPPUNIT_ASSERT_EQUAL( (long) aFontMetric.GetSlant(), 0L ); + + aFontMetric.SetSlant( 45 ); + CPPUNIT_ASSERT_EQUAL( (long) aFontMetric.GetSlant(), 45L ); +} + + void VclFontMetricTest::testEqualityOperator() { // default constructor should set scalable flag to false @@ -142,6 +156,11 @@ void VclFontMetricTest::testEqualityOperator() aRhs.SetDescent( 100 ); CPPUNIT_ASSERT_MESSAGE( "Descent set same, aLHS == aRhs failed", aLhs == aRhs ); CPPUNIT_ASSERT_MESSAGE( "Descent set same, aLHS != aRhs succeeded", !(aLhs != aRhs) ); + + aLhs.SetSlant( 100 ); + aRhs.SetSlant( 100 ); + CPPUNIT_ASSERT_MESSAGE( "Slant set same, aLHS == aRhs failed", aLhs == aRhs ); + CPPUNIT_ASSERT_MESSAGE( "Slant set same, aLHS != aRhs succeeded", !(aLhs != aRhs) ); } |