summaryrefslogtreecommitdiff
path: root/vcl/qa
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-06-27 14:06:38 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-06-28 08:55:28 +0200
commitd2d85921605415908c553e84db654628f9f0c0b1 (patch)
tree161816623c32febde1c62d524fa1ef0a20a1aeda /vcl/qa
parent26c82e22bf4f077022ae88d0a7f8ad0fa6d2a5ba (diff)
loplugin:oncevar in vcl
Change-Id: I37a6dacda12e1c2910737d74aa344c7e2e195aeb Reviewed-on: https://gerrit.libreoffice.org/39328 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/qa')
-rw-r--r--vcl/qa/cppunit/app/test_IconThemeInfo.cxx21
-rw-r--r--vcl/qa/cppunit/app/test_IconThemeScanner.cxx6
2 files changed, 12 insertions, 15 deletions
diff --git a/vcl/qa/cppunit/app/test_IconThemeInfo.cxx b/vcl/qa/cppunit/app/test_IconThemeInfo.cxx
index 812bfe5229f5..3ab740e5bc15 100644
--- a/vcl/qa/cppunit/app/test_IconThemeInfo.cxx
+++ b/vcl/qa/cppunit/app/test_IconThemeInfo.cxx
@@ -65,7 +65,7 @@ class IconThemeInfoTest : public CppUnit::TestFixture
void
IconThemeInfoTest::UpperCaseDisplayNameIsReturnedForNonDefaultId()
{
- OUString id("katze");
+ OUString const id("katze");
OUString displayName = vcl::IconThemeInfo::ThemeIdToDisplayName(id);
CPPUNIT_ASSERT_EQUAL_MESSAGE("theme id is properly uppercased", OUString("Katze"), displayName);
}
@@ -73,15 +73,14 @@ IconThemeInfoTest::UpperCaseDisplayNameIsReturnedForNonDefaultId()
void
IconThemeInfoTest::ImagesZipIsNotValid()
{
- OUString id("file://images.zip");
- bool valid = vcl::IconThemeInfo::UrlCanBeParsed(id);
+ bool valid = vcl::IconThemeInfo::UrlCanBeParsed("file://images.zip");
CPPUNIT_ASSERT_EQUAL_MESSAGE("images.zip is not a valid theme name", false, valid);
}
void
IconThemeInfoTest::ImagesOxygenZipIsValid()
{
- OUString id("file://images_oxygen.zip");
+ OUString const id("file://images_oxygen.zip");
bool valid = vcl::IconThemeInfo::UrlCanBeParsed(id);
CPPUNIT_ASSERT_EQUAL_MESSAGE("images_oxygen.zip is a valid theme name", true, valid);
}
@@ -89,7 +88,7 @@ IconThemeInfoTest::ImagesOxygenZipIsValid()
void
IconThemeInfoTest::ThemeIdIsDetectedFromFileNameWithUnderscore()
{
- OUString fname("images_oxygen.zip");
+ OUString const fname("images_oxygen.zip");
OUString sname = vcl::IconThemeInfo::FileNameToThemeId(fname);
CPPUNIT_ASSERT_EQUAL_MESSAGE("'oxygen' theme id is returned for 'images_oxygen.zip'", OUString("oxygen"), sname);
}
@@ -98,7 +97,7 @@ void
IconThemeInfoTest::ExceptionIsThrownWhenIdCannotBeDetermined1()
{
bool thrown = false;
- OUString fname("images_oxygen");
+ OUString const fname("images_oxygen");
try {
vcl::IconThemeInfo::FileNameToThemeId(fname);
}
@@ -112,7 +111,7 @@ void
IconThemeInfoTest::ExceptionIsThrownWhenIdCannotBeDetermined2()
{
bool thrown = false;
- OUString fname("image_oxygen.zip");
+ OUString const fname("image_oxygen.zip");
try {
vcl::IconThemeInfo::FileNameToThemeId(fname);
}
@@ -125,8 +124,8 @@ IconThemeInfoTest::ExceptionIsThrownWhenIdCannotBeDetermined2()
void
IconThemeInfoTest::DisplayNameForHicontrastIsHighContrast()
{
- OUString id("hicontrast");
- OUString expected("High Contrast");
+ OUString const id("hicontrast");
+ OUString const expected("High Contrast");
OUString displayName = vcl::IconThemeInfo::ThemeIdToDisplayName(id);
CPPUNIT_ASSERT_EQUAL(expected, displayName);
}
@@ -134,8 +133,8 @@ IconThemeInfoTest::DisplayNameForHicontrastIsHighContrast()
void
IconThemeInfoTest::DisplayNameForTango_testingIsTangoTesting()
{
- OUString id("tango_testing");
- OUString expected("Tango Testing");
+ OUString const id("tango_testing");
+ OUString const expected("Tango Testing");
OUString displayName = vcl::IconThemeInfo::ThemeIdToDisplayName(id);
CPPUNIT_ASSERT_EQUAL(expected, displayName);
}
diff --git a/vcl/qa/cppunit/app/test_IconThemeScanner.cxx b/vcl/qa/cppunit/app/test_IconThemeScanner.cxx
index 857f65551365..6fc2993c7a8d 100644
--- a/vcl/qa/cppunit/app/test_IconThemeScanner.cxx
+++ b/vcl/qa/cppunit/app/test_IconThemeScanner.cxx
@@ -45,8 +45,7 @@ void
IconThemeScannerTest::AddedThemeIsFoundById()
{
vcl::IconThemeScanner scanner;
- OUString theme("file:://images_katze.zip");
- scanner.AddIconThemeByPath(theme);
+ scanner.AddIconThemeByPath("file:://images_katze.zip");
OUString id = vcl::IconThemeInfo::FileNameToThemeId("images_katze.zip");
bool found = scanner.IconThemeIsInstalled(id);
CPPUNIT_ASSERT_EQUAL_MESSAGE("icon theme could be added by url", true, found);
@@ -67,8 +66,7 @@ void
IconThemeScannerTest::ExceptionIsThrownIfInvalidInfoIsRequested()
{
vcl::IconThemeScanner scanner;
- OUString theme("file:://images_katze.zip");
- scanner.AddIconThemeByPath(theme);
+ scanner.AddIconThemeByPath("file:://images_katze.zip");
bool thrown = false;
try
{