summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2016-12-22 09:11:47 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-12-22 14:37:22 +0000
commit35a067f1966b41125d298bd54f577f1a560aff08 (patch)
tree01e45ceb423de0ca680e2982c1fabaefe8688780 /vcl
parent9c969c864f1ef2d4598faffbd7b98eaa0cf7d1a7 (diff)
vcl: fix remaining loplugin:cppunitassertequals warnings
Change-Id: Ic499ebbaeb25a08b01cd1317ab3055a374444a4f Reviewed-on: https://gerrit.libreoffice.org/32329 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/qa/cppunit/font.cxx20
-rw-r--r--vcl/qa/cppunit/fontcharmap.cxx6
-rw-r--r--vcl/qa/cppunit/fontmetric.cxx12
-rw-r--r--vcl/qa/cppunit/lifecycle.cxx6
-rw-r--r--vcl/qa/cppunit/mapmode.cxx18
-rw-r--r--vcl/qa/cppunit/outdev.cxx2
6 files changed, 32 insertions, 32 deletions
diff --git a/vcl/qa/cppunit/font.cxx b/vcl/qa/cppunit/font.cxx
index f31a6f4bfb62..049e2118fd60 100644
--- a/vcl/qa/cppunit/font.cxx
+++ b/vcl/qa/cppunit/font.cxx
@@ -130,32 +130,32 @@ void VclFontTest::testSymbolFlagAndCharSet()
vcl::Font aFont;
CPPUNIT_ASSERT_MESSAGE( "Should not be seen as a symbol font after default constructor called", !aFont.IsSymbolFont() );
- CPPUNIT_ASSERT_MESSAGE( "Character set should be RTL_TEXTENCODING_DONTKNOW after default constructor called",
- aFont.GetCharSet() == RTL_TEXTENCODING_DONTKNOW );
+ CPPUNIT_ASSERT_EQUAL_MESSAGE( "Character set should be RTL_TEXTENCODING_DONTKNOW after default constructor called",
+ RTL_TEXTENCODING_DONTKNOW, aFont.GetCharSet() );
aFont.SetSymbolFlag(true);
CPPUNIT_ASSERT_MESSAGE( "Test 1: Symbol font flag should be on", aFont.IsSymbolFont() );
- CPPUNIT_ASSERT_MESSAGE( "Test 1: Character set should be RTL_TEXTENCODING_SYMBOL",
- aFont.GetCharSet() == RTL_TEXTENCODING_SYMBOL );
+ CPPUNIT_ASSERT_EQUAL_MESSAGE( "Test 1: Character set should be RTL_TEXTENCODING_SYMBOL",
+ RTL_TEXTENCODING_SYMBOL, aFont.GetCharSet() );
aFont.SetSymbolFlag(false);
CPPUNIT_ASSERT_MESSAGE( "Test 2: Symbol font flag should be off", !aFont.IsSymbolFont() );
- CPPUNIT_ASSERT_MESSAGE( "Test 2: Character set should be RTL_TEXTENCODING_DONTKNOW",
- aFont.GetCharSet() == RTL_TEXTENCODING_DONTKNOW );
+ CPPUNIT_ASSERT_EQUAL_MESSAGE( "Test 2: Character set should be RTL_TEXTENCODING_DONTKNOW",
+ RTL_TEXTENCODING_DONTKNOW, aFont.GetCharSet() );
aFont.SetCharSet( RTL_TEXTENCODING_SYMBOL );
CPPUNIT_ASSERT_MESSAGE( "Test 3: Symbol font flag should be on", aFont.IsSymbolFont() );
- CPPUNIT_ASSERT_MESSAGE( "Test 3: Character set should be RTL_TEXTENCODING_SYMBOL",
- aFont.GetCharSet() == RTL_TEXTENCODING_SYMBOL );
+ CPPUNIT_ASSERT_EQUAL_MESSAGE( "Test 3: Character set should be RTL_TEXTENCODING_SYMBOL",
+ RTL_TEXTENCODING_SYMBOL, aFont.GetCharSet() );
aFont.SetCharSet( RTL_TEXTENCODING_UNICODE );
CPPUNIT_ASSERT_MESSAGE( "Test 4: Symbol font flag should be off", !aFont.IsSymbolFont() );
- CPPUNIT_ASSERT_MESSAGE( "Test 4: Character set should be RTL_TEXTENCODING_UNICODE",
- aFont.GetCharSet() == RTL_TEXTENCODING_UNICODE );
+ CPPUNIT_ASSERT_EQUAL_MESSAGE( "Test 4: Character set should be RTL_TEXTENCODING_UNICODE",
+ RTL_TEXTENCODING_UNICODE, aFont.GetCharSet() );
}
CPPUNIT_TEST_SUITE_REGISTRATION(VclFontTest);
diff --git a/vcl/qa/cppunit/fontcharmap.cxx b/vcl/qa/cppunit/fontcharmap.cxx
index fce8bc47b41b..f57b2e170763 100644
--- a/vcl/qa/cppunit/fontcharmap.cxx
+++ b/vcl/qa/cppunit/fontcharmap.cxx
@@ -36,9 +36,9 @@ void VclFontCharMapTest::testDefaultFontCharMap()
sal_uInt32 nStartSupBMPPlane = xfcmap->GetNextChar(0xD800);
sal_uInt32 nEndBMPPlane = xfcmap->GetLastChar();
- CPPUNIT_ASSERT( nStartBMPPlane == 0x0020 );
- CPPUNIT_ASSERT( nStartSupBMPPlane == 0xE000 );
- CPPUNIT_ASSERT( nEndBMPPlane == 0xFFF0-1 );
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt32>(0x0020), nStartBMPPlane);
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt32>(0xE000), nStartSupBMPPlane);
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt32>(0xFFF0-1), nEndBMPPlane);
}
CPPUNIT_TEST_SUITE_REGISTRATION(VclFontCharMapTest);
diff --git a/vcl/qa/cppunit/fontmetric.cxx b/vcl/qa/cppunit/fontmetric.cxx
index f28aa0d5bff7..b8c1f4282afc 100644
--- a/vcl/qa/cppunit/fontmetric.cxx
+++ b/vcl/qa/cppunit/fontmetric.cxx
@@ -107,32 +107,32 @@ void VclFontMetricTest::testEqualityOperator()
aLhs.SetFullstopCenteredFlag(true);
aRhs.SetFullstopCenteredFlag(true);
- CPPUNIT_ASSERT_MESSAGE( "Fullstop centered flag set same, aLhs == aRhs failed", aLhs == aRhs );
+ CPPUNIT_ASSERT_EQUAL_MESSAGE( "Fullstop centered flag set same, aLhs == aRhs failed", aRhs, aLhs );
CPPUNIT_ASSERT_MESSAGE( "Fullstop centered 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_EQUAL_MESSAGE( "External leading set same, aLHS == aRhs failed", aRhs, aLhs );
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_EQUAL_MESSAGE( "Internal leading set same, aLHS == aRhs failed", aRhs, aLhs );
CPPUNIT_ASSERT_MESSAGE( "Internal leading set same, aLHS != aRhs succeeded", !(aLhs != aRhs) );
aLhs.SetAscent( 100 );
aRhs.SetAscent( 100 );
- CPPUNIT_ASSERT_MESSAGE( "Ascent set same, aLHS == aRhs failed", aLhs == aRhs );
+ CPPUNIT_ASSERT_EQUAL_MESSAGE( "Ascent set same, aLHS == aRhs failed", aRhs, aLhs );
CPPUNIT_ASSERT_MESSAGE( "Ascent set same, aLHS != aRhs succeeded", !(aLhs != aRhs) );
aLhs.SetDescent( 100 );
aRhs.SetDescent( 100 );
- CPPUNIT_ASSERT_MESSAGE( "Descent set same, aLHS == aRhs failed", aLhs == aRhs );
+ CPPUNIT_ASSERT_EQUAL_MESSAGE( "Descent set same, aLHS == aRhs failed", aRhs, aLhs);
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_EQUAL_MESSAGE( "Slant set same, aLHS == aRhs failed", aRhs, aLhs);
CPPUNIT_ASSERT_MESSAGE( "Slant set same, aLHS != aRhs succeeded", !(aLhs != aRhs) );
}
diff --git a/vcl/qa/cppunit/lifecycle.cxx b/vcl/qa/cppunit/lifecycle.cxx
index 8177cc805d00..0ec8b4cd17d8 100644
--- a/vcl/qa/cppunit/lifecycle.cxx
+++ b/vcl/qa/cppunit/lifecycle.cxx
@@ -85,9 +85,9 @@ void LifecycleTest::testMultiDispose()
xWin->disposeOnce();
xWin->disposeOnce();
xWin->disposeOnce();
- CPPUNIT_ASSERT(xWin->GetWindow(GetWindowType::Parent) == nullptr);
- CPPUNIT_ASSERT(xWin->GetChild(0) == nullptr);
- CPPUNIT_ASSERT(xWin->GetChildCount() == 0);
+ CPPUNIT_ASSERT(!xWin->GetWindow(GetWindowType::Parent));
+ CPPUNIT_ASSERT(!xWin->GetChild(0));
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt16>(0), xWin->GetChildCount());
}
void LifecycleTest::testWidgets(vcl::Window *pParent)
diff --git a/vcl/qa/cppunit/mapmode.cxx b/vcl/qa/cppunit/mapmode.cxx
index 94e6d4be321c..afa259a6e799 100644
--- a/vcl/qa/cppunit/mapmode.cxx
+++ b/vcl/qa/cppunit/mapmode.cxx
@@ -31,27 +31,27 @@ public:
void VclMapModeTest::testMultiplier()
{
MapMode aMapMode;
- CPPUNIT_ASSERT_MESSAGE( "Default map mode is MapUnit::MapPixel, multiplier should be 1", aMapMode.GetUnitMultiplier() == 1 );
+ CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE( "Default map mode is MapUnit::MapPixel, multiplier should be 1", 1.0, aMapMode.GetUnitMultiplier(), 1E-12);
aMapMode.SetMapUnit( MapUnit::MapSysFont );
- CPPUNIT_ASSERT_MESSAGE( "Map mode is MapUnit::MapSysFont, multiplier should be 1", aMapMode.GetUnitMultiplier() == 1 );
+ CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE( "Map mode is MapUnit::MapSysFont, multiplier should be 1", 1.0, aMapMode.GetUnitMultiplier(), 1E-12);
aMapMode.SetMapUnit( MapUnit::MapAppFont );
- CPPUNIT_ASSERT_MESSAGE( "Map mode is MapUnit::MapAppFont, multiplier should be 1", aMapMode.GetUnitMultiplier() == 1 );
+ CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE( "Map mode is MapUnit::MapAppFont, multiplier should be 1", 1.0, aMapMode.GetUnitMultiplier(), 1E-12);
aMapMode.SetMapUnit( MapUnit::Map100thMM );
- CPPUNIT_ASSERT_MESSAGE( "Map mode is MapUnit::Map100thMM, multiplier should be 1", aMapMode.GetUnitMultiplier() == 1 );
+ CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE( "Map mode is MapUnit::Map100thMM, multiplier should be 1", 1.0, aMapMode.GetUnitMultiplier(), 1E-12);
aMapMode.SetMapUnit( MapUnit::Map10thMM );
- CPPUNIT_ASSERT_MESSAGE( "Map mode is MapUnit::Map10thMM, multiplier should be 10", aMapMode.GetUnitMultiplier() == 10 );
+ CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE( "Map mode is MapUnit::Map10thMM, multiplier should be 10", 10.0, aMapMode.GetUnitMultiplier(), 1E-12);
aMapMode.SetMapUnit( MapUnit::MapMM );
- CPPUNIT_ASSERT_MESSAGE( "Map mode is MapUnit::MapMM, multiplier should be 100", aMapMode.GetUnitMultiplier() == 100 );
+ CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE( "Map mode is MapUnit::MapMM, multiplier should be 100", 100.0, aMapMode.GetUnitMultiplier(), 1E-12);
aMapMode.SetMapUnit( MapUnit::MapCM );
- CPPUNIT_ASSERT_MESSAGE( "Map mode is MapUnit::MapCM, multiplier should be 1000", aMapMode.GetUnitMultiplier() == 1000 );
+ CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE( "Map mode is MapUnit::MapCM, multiplier should be 1000", 1000.0, aMapMode.GetUnitMultiplier(), 1E-12);
aMapMode.SetMapUnit( MapUnit::Map1000thInch );
CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE( "Map mode is MapUnit::Map1000thInch, multiplier should be 2.54", 2.54, aMapMode.GetUnitMultiplier(), 1E-12 );
aMapMode.SetMapUnit( MapUnit::Map100thInch );
CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE( "Map mode is MapUnit::Map100thInch, multiplier should be 2.54", 25.4, aMapMode.GetUnitMultiplier(), 1E-12 );
aMapMode.SetMapUnit( MapUnit::Map10thInch );
- CPPUNIT_ASSERT_MESSAGE( "Map mode is MapUnit::Map10thInch, multiplier should be 254", aMapMode.GetUnitMultiplier() == 254 );
+ CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE( "Map mode is MapUnit::Map10thInch, multiplier should be 254", 254.0, aMapMode.GetUnitMultiplier(), 1E-12 );
aMapMode.SetMapUnit( MapUnit::MapInch );
- CPPUNIT_ASSERT_MESSAGE( "Map mode is MapUnit::MapInch, multiplier should be 2540", aMapMode.GetUnitMultiplier() == 2540 );
+ CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE( "Map mode is MapUnit::MapInch, multiplier should be 2540", 2540.0, aMapMode.GetUnitMultiplier(), 1E-12 );
aMapMode.SetMapUnit( MapUnit::MapTwip );
CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE( "Map mode is MapUnit::MapTwip, multiplier should be 1.76388889", 1.76388889, aMapMode.GetUnitMultiplier(), 1E-12 );
aMapMode.SetMapUnit( MapUnit::MapPoint );
diff --git a/vcl/qa/cppunit/outdev.cxx b/vcl/qa/cppunit/outdev.cxx
index 4a447701b0b3..f566f810027f 100644
--- a/vcl/qa/cppunit/outdev.cxx
+++ b/vcl/qa/cppunit/outdev.cxx
@@ -40,7 +40,7 @@ void VclOutdevTest::testVirtualDevice()
pVDev->DrawPixel(Point(31,30),COL_RED);
Size aSize = pVDev->GetOutputSizePixel();
- CPPUNIT_ASSERT(aSize == Size(32,32));
+ CPPUNIT_ASSERT_EQUAL(Size(32,32), aSize);
Bitmap aBmp = pVDev->GetBitmap(Point(),aSize);