diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-10-29 08:58:11 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-10-29 15:12:26 +0100 |
commit | 41eeaace84b45c803fff3ebd5ab981f0ad09393b (patch) | |
tree | 0a0290bcc852507efa8241bd0853ebdd84ec9cbf /tools | |
parent | a2f7678171618d958e3c387718cd389bea63eaeb (diff) |
loplugin:oncevar
Change-Id: Iba892694acb378887a1d15ab59104c55f591f0bd
Reviewed-on: https://gerrit.libreoffice.org/62498
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/qa/cppunit/test_color.cxx | 3 | ||||
-rw-r--r-- | tools/qa/cppunit/test_config.cxx | 9 | ||||
-rw-r--r-- | tools/qa/cppunit/test_date.cxx | 54 |
3 files changed, 22 insertions, 44 deletions
diff --git a/tools/qa/cppunit/test_color.cxx b/tools/qa/cppunit/test_color.cxx index 15d90e388e60..10da454b9497 100644 --- a/tools/qa/cppunit/test_color.cxx +++ b/tools/qa/cppunit/test_color.cxx @@ -62,10 +62,9 @@ void Test::test_asRGBColor() void Test::test_readAndWriteStream() { SvMemoryStream aStream; - Color aWriteColor(0x12, 0x34, 0x56); Color aReadColor; - WriteColor(aStream, aWriteColor); + WriteColor(aStream, Color(0x12, 0x34, 0x56)); aStream.Seek(STREAM_SEEK_TO_BEGIN); diff --git a/tools/qa/cppunit/test_config.cxx b/tools/qa/cppunit/test_config.cxx index aaf599b8fa5e..4f392a3c7b50 100644 --- a/tools/qa/cppunit/test_config.cxx +++ b/tools/qa/cppunit/test_config.cxx @@ -76,9 +76,8 @@ public: CPPUNIT_ASSERT(!aConfig.HasGroup("TestGroup")); CPPUNIT_ASSERT_EQUAL(OString("TestGroup2"), aConfig.GetGroupName(0)); - sal_uInt16 nExpected = 1; sal_uInt16 nActual = aConfig.GetGroupCount(); - CPPUNIT_ASSERT_EQUAL(nExpected, nActual); + CPPUNIT_ASSERT_EQUAL(sal_uInt16(1), nActual); } osl::File::copy(maOriginalConfigFile, maConfigFile); @@ -90,9 +89,8 @@ public: aConfig.DeleteGroup(OString("NonExistentTestGroup")); CPPUNIT_ASSERT_EQUAL(OString("TestGroup"), aConfig.GetGroupName(0)); - sal_uInt16 nExpected = 2; sal_uInt16 nActual = aConfig.GetGroupCount(); - CPPUNIT_ASSERT_EQUAL(nExpected, nActual); + CPPUNIT_ASSERT_EQUAL(sal_uInt16(2), nActual); } osl::File::copy(maOriginalConfigFile, maConfigFile); @@ -101,9 +99,8 @@ public: void testGetGroupCount() { Config aConfig(maConfigFile); - sal_uInt16 nExpected = 2; sal_uInt16 nActual = aConfig.GetGroupCount(); - CPPUNIT_ASSERT_EQUAL(nExpected, nActual); + CPPUNIT_ASSERT_EQUAL(sal_uInt16(2), nActual); } void testReadKey() diff --git a/tools/qa/cppunit/test_date.cxx b/tools/qa/cppunit/test_date.cxx index 7e1119e93b68..ca6c39d84109 100644 --- a/tools/qa/cppunit/test_date.cxx +++ b/tools/qa/cppunit/test_date.cxx @@ -192,32 +192,27 @@ void DateTest::testGetDaysInYear() { { Date aDate(1, 1, 2000); - sal_uInt16 nExpectedDays = 366; - CPPUNIT_ASSERT_EQUAL(nExpectedDays, aDate.GetDaysInYear()); + CPPUNIT_ASSERT_EQUAL(sal_uInt16(366), aDate.GetDaysInYear()); } { Date aDate(1, 1, 1900); - sal_uInt16 nExpectedDays = 365; - CPPUNIT_ASSERT_EQUAL(nExpectedDays, aDate.GetDaysInYear()); + CPPUNIT_ASSERT_EQUAL(sal_uInt16(365), aDate.GetDaysInYear()); } { Date aDate(1, 1, 1999); - sal_uInt16 nExpectedDays = 365; - CPPUNIT_ASSERT_EQUAL(nExpectedDays, aDate.GetDaysInYear()); + CPPUNIT_ASSERT_EQUAL(sal_uInt16(365), aDate.GetDaysInYear()); } { Date aDate(1, 1, 2004); - sal_uInt16 nExpectedDays = 366; - CPPUNIT_ASSERT_EQUAL(nExpectedDays, aDate.GetDaysInYear()); + CPPUNIT_ASSERT_EQUAL(sal_uInt16(366), aDate.GetDaysInYear()); } { Date aDate(1, 1, 400); - sal_uInt16 nExpectedDays = 366; - CPPUNIT_ASSERT_EQUAL(nExpectedDays, aDate.GetDaysInYear()); + CPPUNIT_ASSERT_EQUAL(sal_uInt16(366), aDate.GetDaysInYear()); } } @@ -469,80 +464,67 @@ void DateTest::testGetDaysInMonth() { { Date aDate(1, 1, 2000); - sal_uInt16 nExpectedDays = 31; - CPPUNIT_ASSERT_EQUAL(nExpectedDays, aDate.GetDaysInMonth()); + CPPUNIT_ASSERT_EQUAL(sal_uInt16(31), aDate.GetDaysInMonth()); } { Date aDate(1, 2, 2000); - sal_uInt16 nExpectedDays = 29; - CPPUNIT_ASSERT_EQUAL(nExpectedDays, aDate.GetDaysInMonth()); + CPPUNIT_ASSERT_EQUAL(sal_uInt16(29), aDate.GetDaysInMonth()); } { Date aDate(1, 2, 1999); - sal_uInt16 nExpectedDays = 28; - CPPUNIT_ASSERT_EQUAL(nExpectedDays, aDate.GetDaysInMonth()); + CPPUNIT_ASSERT_EQUAL(sal_uInt16(28), aDate.GetDaysInMonth()); } { Date aDate(1, 3, 2000); - sal_uInt16 nExpectedDays = 31; - CPPUNIT_ASSERT_EQUAL(nExpectedDays, aDate.GetDaysInMonth()); + CPPUNIT_ASSERT_EQUAL(sal_uInt16(31), aDate.GetDaysInMonth()); } { Date aDate(1, 4, 2000); - sal_uInt16 nExpectedDays = 30; - CPPUNIT_ASSERT_EQUAL(nExpectedDays, aDate.GetDaysInMonth()); + CPPUNIT_ASSERT_EQUAL(sal_uInt16(30), aDate.GetDaysInMonth()); } { Date aDate(1, 5, 2000); - sal_uInt16 nExpectedDays = 31; - CPPUNIT_ASSERT_EQUAL(nExpectedDays, aDate.GetDaysInMonth()); + CPPUNIT_ASSERT_EQUAL(sal_uInt16(31), aDate.GetDaysInMonth()); } { Date aDate(1, 6, 2000); - sal_uInt16 nExpectedDays = 30; - CPPUNIT_ASSERT_EQUAL(nExpectedDays, aDate.GetDaysInMonth()); + CPPUNIT_ASSERT_EQUAL(sal_uInt16(30), aDate.GetDaysInMonth()); } { Date aDate(1, 7, 2000); - sal_uInt16 nExpectedDays = 31; - CPPUNIT_ASSERT_EQUAL(nExpectedDays, aDate.GetDaysInMonth()); + CPPUNIT_ASSERT_EQUAL(sal_uInt16(31), aDate.GetDaysInMonth()); } { Date aDate(1, 8, 2000); - sal_uInt16 nExpectedDays = 31; - CPPUNIT_ASSERT_EQUAL(nExpectedDays, aDate.GetDaysInMonth()); + CPPUNIT_ASSERT_EQUAL(sal_uInt16(31), aDate.GetDaysInMonth()); } { Date aDate(1, 9, 2000); - sal_uInt16 nExpectedDays = 30; - CPPUNIT_ASSERT_EQUAL(nExpectedDays, aDate.GetDaysInMonth()); + CPPUNIT_ASSERT_EQUAL(sal_uInt16(30), aDate.GetDaysInMonth()); } { Date aDate(1, 10, 2000); - sal_uInt16 nExpectedDays = 31; - CPPUNIT_ASSERT_EQUAL(nExpectedDays, aDate.GetDaysInMonth()); + CPPUNIT_ASSERT_EQUAL(sal_uInt16(31), aDate.GetDaysInMonth()); } { Date aDate(1, 11, 2000); - sal_uInt16 nExpectedDays = 30; - CPPUNIT_ASSERT_EQUAL(nExpectedDays, aDate.GetDaysInMonth()); + CPPUNIT_ASSERT_EQUAL(sal_uInt16(30), aDate.GetDaysInMonth()); } { Date aDate(1, 12, 2000); - sal_uInt16 nExpectedDays = 31; - CPPUNIT_ASSERT_EQUAL(nExpectedDays, aDate.GetDaysInMonth()); + CPPUNIT_ASSERT_EQUAL(sal_uInt16(31), aDate.GetDaysInMonth()); } } |