diff options
author | Chris Sherlock <chris.sherlock79@gmail.com> | 2016-01-13 18:33:13 +1100 |
---|---|---|
committer | Chris Sherlock <chris.sherlock79@gmail.com> | 2016-01-13 19:50:18 +0000 |
commit | 08bbdaa2f9e3a2b7cfee6838ea6d9f0096495812 (patch) | |
tree | 01b38be11e15249e76ff2b5c54cdfdce6c7224d0 /vcl/qa | |
parent | fb45376fea3e3d0ff0fc2af56d67efad1e7751cf (diff) |
vcl: Create accessor and mutator for int and ext leading in FontMetric
Accessor and mutator created for external and internal leading space 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 set external and leading space
- check equality operator on FontMetric after setting both external
and internal leading space
- enhanced tests to also check the inequality operator
Change-Id: I973970dd0b0631c5eca3e89039dce57ac3a3eb63
Reviewed-on: https://gerrit.libreoffice.org/21454
Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
Tested-by: Chris Sherlock <chris.sherlock79@gmail.com>
Diffstat (limited to 'vcl/qa')
-rw-r--r-- | vcl/qa/cppunit/fontmetric.cxx | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/vcl/qa/cppunit/fontmetric.cxx b/vcl/qa/cppunit/fontmetric.cxx index f434ae04487c..316e03d3a8a4 100644 --- a/vcl/qa/cppunit/fontmetric.cxx +++ b/vcl/qa/cppunit/fontmetric.cxx @@ -78,17 +78,32 @@ void VclFontMetricTest::testEqualityOperator() aLhs.SetScalableFlag(true); aRhs.SetScalableFlag(true); - CPPUNIT_ASSERT_MESSAGE( "Scalable flag set same", aLhs == aRhs ); + CPPUNIT_ASSERT_MESSAGE( "Scalable flag set same, aLhs == aRhs failed", aLhs == aRhs ); + CPPUNIT_ASSERT_MESSAGE( "Scalable flag set same, aLhs != aRhs succeeded", !(aLhs != aRhs) ); aLhs.SetFullstopCenteredFlag(true); aRhs.SetFullstopCenteredFlag(true); - CPPUNIT_ASSERT_MESSAGE( "Scalable font flag set same", aLhs == aRhs ); + CPPUNIT_ASSERT_MESSAGE( "Fullstop centered flag set same, aLhs == aRhs failed", aLhs == aRhs ); + CPPUNIT_ASSERT_MESSAGE( "Fullstop centered flag set same, aLhs != aRhs succeeded", !(aLhs != aRhs) ); aLhs.SetBuiltInFontFlag(true); aRhs.SetBuiltInFontFlag(true); - CPPUNIT_ASSERT_MESSAGE( "Scalable font flag set same", aLhs == aRhs ); + CPPUNIT_ASSERT_MESSAGE( "Builtin font flag set same, aLHS == aRhs failed", aLhs == aRhs ); + CPPUNIT_ASSERT_MESSAGE( "Builtin font flag set same, aLHS != aRhs succeeded", !(aLhs != aRhs) ); + + aLhs.SetExternalLeading(10); + aRhs.SetExternalLeading(10); + + CPPUNIT_ASSERT_MESSAGE( "External leading set same, aLHS == aRhs failed", aLhs == aRhs ); + CPPUNIT_ASSERT_MESSAGE( "External leading set same, aLHS != aRhs succeeded", !(aLhs != aRhs) ); + + aLhs.SetInternalLeading(10); + aRhs.SetInternalLeading(10); + + CPPUNIT_ASSERT_MESSAGE( "Internal leading set same, aLHS == aRhs failed", aLhs == aRhs ); + CPPUNIT_ASSERT_MESSAGE( "Internal leading set same, aLHS != aRhs succeeded", !(aLhs != aRhs) ); } |