aboutsummaryrefslogtreecommitdiff
path: root/tests/integration
diff options
context:
space:
mode:
authorRobert Tari <robert@tari.in>2021-12-09 12:00:39 +0100
committerRobert Tari <robert@tari.in>2021-12-09 12:03:07 +0100
commitf696e54c767f4971f81237f8e4234289aa3c1b01 (patch)
tree6e48a65257a071273e7f30b4098aa807e04bc13f /tests/integration
parent09dde5270d94be7ec55a4ede3ca4007be097b343 (diff)
downloadayatana-indicator-sound-f696e54c767f4971f81237f8e4234289aa3c1b01.tar.gz
ayatana-indicator-sound-f696e54c767f4971f81237f8e4234289aa3c1b01.tar.bz2
ayatana-indicator-sound-f696e54c767f4971f81237f8e4234289aa3c1b01.zip
Fix cppcheck warnings
Diffstat (limited to 'tests/integration')
-rw-r--r--tests/integration/indicator-sound-test-base.cpp11
-rw-r--r--tests/integration/test-indicator.cpp8
-rw-r--r--tests/integration/utils/dbus-pulse-volume.cpp12
3 files changed, 17 insertions, 14 deletions
diff --git a/tests/integration/indicator-sound-test-base.cpp b/tests/integration/indicator-sound-test-base.cpp
index 1a74621..6c64815 100644
--- a/tests/integration/indicator-sound-test-base.cpp
+++ b/tests/integration/indicator-sound-test-base.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright (C) 2015 Canonical Ltd.
- * Copyright (C) 2021 Robert Tari
+ * Copyright 2015 Canonical Ltd.
+ * Copyright 2021 Robert Tari
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 3, as published
@@ -534,9 +534,10 @@ void IndicatorSoundTestBase::initializeAccountsInterface()
auto userPath = userResp.value().path();
if (userPath != "")
{
- std::unique_ptr<AccountsSoundInterface> soundInterface(new AccountsSoundInterface("org.freedesktop.Accounts",
+ // This silences cppcheck, but let's leave it here in case we actually need it
+ /*std::unique_ptr<AccountsSoundInterface> soundInterface(new AccountsSoundInterface("org.freedesktop.Accounts",
userPath,
- dbusTestRunner.systemConnection(), 0));
+ dbusTestRunner.systemConnection(), 0));*/
accounts_interface_.reset(new DBusPropertiesInterface("org.freedesktop.Accounts",
userPath,
@@ -1008,8 +1009,6 @@ QVariantList IndicatorSoundTestBase::getActionValue(QString const &action)
QStringList IndicatorSoundTestBase::getRootIconValue(bool *isValid)
{
- QString result = 0;
-
QVariantList varList = getActionValue("root");
if (isValid != nullptr)
{
diff --git a/tests/integration/test-indicator.cpp b/tests/integration/test-indicator.cpp
index 5d31508..cbf1c6d 100644
--- a/tests/integration/test-indicator.cpp
+++ b/tests/integration/test-indicator.cpp
@@ -1,5 +1,6 @@
/*
- * Copyright (C) 2015 Canonical Ltd.
+ * Copyright 2015 Canonical Ltd.
+ * Copyright 2021 Robert Tari
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 3, as published
@@ -13,7 +14,9 @@
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*
- * Author: Xavi Garcia <xavi.garcia.mena@canonical.com>
+ * Authors:
+ * Xavi Garcia <xavi.garcia.mena@canonical.com>
+ * Robert Tari <robert@tari.in>
*/
#include <indicator-sound-test-base.h>
@@ -32,6 +35,7 @@ class TestIndicator: public IndicatorSoundTestBase
{
};
+// cppcheck-suppress syntaxError
TEST_F(TestIndicator, DISABLED_PhoneCheckRootIcon)
{
double INITIAL_VOLUME = 0.0;
diff --git a/tests/integration/utils/dbus-pulse-volume.cpp b/tests/integration/utils/dbus-pulse-volume.cpp
index 7d51b23..2bbc5d4 100644
--- a/tests/integration/utils/dbus-pulse-volume.cpp
+++ b/tests/integration/utils/dbus-pulse-volume.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright (C) 2015 Canonical Ltd.
- * Copyright (C) 2021 Robert Tari
+ * Copyright 2015 Canonical Ltd.
+ * Copyright 2021 Robert Tari
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 3, as published
@@ -141,14 +141,14 @@ bool DBusPulseVolume::setVolume(QString const & role, double volume)
if (accounts_interface_)
{
- QDBusVariant dbusVar(QVariant::fromValue(volume));
- QDBusReply<void> set_vol = accounts_interface_->call(QLatin1String("Set"),
+ QDBusVariant pDbusVar(QVariant::fromValue(volume));
+ QDBusReply<void> pSetVol = accounts_interface_->call(QLatin1String("Set"),
QVariant::fromValue(QString("com.lomiri.AccountsService.Sound")),
QVariant::fromValue(QString("Volume")),
- QVariant::fromValue(dbusVar));
+ QVariant::fromValue(pDbusVar));
if (!set_vol.isValid())
{
- qWarning() << "SetVolume::setVolume(): D-Bus error: " << set_vol.error().message();
+ qWarning() << "SetVolume::setVolume(): D-Bus error: " << pSetVol.error().message();
return false;
}
}