From f696e54c767f4971f81237f8e4234289aa3c1b01 Mon Sep 17 00:00:00 2001 From: Robert Tari Date: Thu, 9 Dec 2021 12:00:39 +0100 Subject: Fix cppcheck warnings --- tests/integration/indicator-sound-test-base.cpp | 11 +++++------ tests/integration/test-indicator.cpp | 8 ++++++-- tests/integration/utils/dbus-pulse-volume.cpp | 12 ++++++------ 3 files changed, 17 insertions(+), 14 deletions(-) (limited to 'tests/integration') 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 soundInterface(new AccountsSoundInterface("org.freedesktop.Accounts", + // This silences cppcheck, but let's leave it here in case we actually need it + /*std::unique_ptr 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 . * - * Author: Xavi Garcia + * Authors: + * Xavi Garcia + * Robert Tari */ #include @@ -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 set_vol = accounts_interface_->call(QLatin1String("Set"), + QDBusVariant pDbusVar(QVariant::fromValue(volume)); + QDBusReply 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; } } -- cgit v1.2.3