aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2021-08-29 12:37:44 +0200
committerRobert Tari <robert@tari.in>2021-08-30 01:08:58 +0200
commit612849029e623b6d935b9b231e8e659a913f0e2e (patch)
tree1cabb7700dc5736bf060ce31f4fa14d98096b7f7
parent83105872a411caf63b68724a905196f132b552c3 (diff)
downloadayatana-indicator-display-612849029e623b6d935b9b231e8e659a913f0e2e.tar.gz
ayatana-indicator-display-612849029e623b6d935b9b231e8e659a913f0e2e.tar.bz2
ayatana-indicator-display-612849029e623b6d935b9b231e8e659a913f0e2e.zip
tests/integration/usb-manager-test.cpp: Fix cppcheck test in Ubuntu 20.04. Mark unused adbd_server and usb_manager as such.
-rw-r--r--tests/integration/usb-manager-test.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/integration/usb-manager-test.cpp b/tests/integration/usb-manager-test.cpp
index 805ba6e..c17e587 100644
--- a/tests/integration/usb-manager-test.cpp
+++ b/tests/integration/usb-manager-test.cpp
@@ -104,10 +104,13 @@ TEST_F(UsbManagerFixture, Allow)
// start a mock AdbdServer ready to submit a request
const std::string public_key {"qAAAALUHllFjEZjl5jbS9ivjpQpaTNpibl28Re71D/S8sV3usNJTkbpvZYoVPfxtmHSNdCgLkWN6qcDZsHZqE/4myzmx/8Y/RqBy1oirudugi3YUUcJh7aWkY8lKQe9shCLTcrT7cFLZIJIidTvfmWTm0UcU+xmdPALze11I3lGo1Ty5KpCe9oP+qYM8suHbxhm78LKLlo0QJ2QqM8T5isr1pvoPHDgRb+mSESElG+xDIfPWA2BTu77/xk4EnXmOYfcuCr5akF3N4fRo/ACnYgXWDZFX2XdklBXyDj78lVlinF37xdMk7BMQh166X7UNkpH1uG2y5F6lUzyLg8SsFtRnJkw7eVe/gnJj3feQaFQbF5oVDhWhLMtWLtejhX6umvroVBVA4rynG4xEgs00K4u4ly8DUIIJYDO22Ml4myFR5CUm3lOlyitNdzYGh0utLXPq9oc8EbMVxM3i+O7PRxQw5Ul04X6K8GLiGUDV98DB+xYUqfEveq1BRnXi/ZrdPDhQ8Lfkg5xnLccPTFamAqutPtZXV6s7dXJInBTZf0NtBaWL0RdR2cOJBrpeBYkrc9yIyeqFLFdxr66rjaehjaa4pS4S+CD6PkGiIpPWSQtwNC4RlT10qTQ0/K9lRux2p0D8Z8ubUTFuh4kBScGUkN1OV3Z+7d7B+ghmBtZrrgleXsbehjRuKgEAAQA= foo@bar"};
const std::string fingerprint {"12:23:5f:2d:8c:40:ae:1d:05:7b:ae:bd:88:8a:f0:80"};
+
auto adbd_server = std::make_shared<GAdbdServer>(*socket_path, std::vector<std::string>{"PK"+public_key});
// set up a UsbManager to process the request
auto usb_manager = std::make_shared<UsbManager>(*socket_path, *public_keys_path, m_usb_monitor, m_greeter);
+ // cppcheck in Ubuntu 20.04 requires the unused attribute to be set here...
+ Q_UNUSED(usb_manager);
// wait for the notification to show up, confirm it looks right
wait_for_signals(notificationsSpy, 1);
@@ -171,6 +174,8 @@ TEST_F(UsbManagerFixture, USBDisconnectedDuringPrompt)
// set up a UsbManager to process the request
auto usb_manager = std::make_shared<UsbManager>(*socket_path, *public_keys_path, m_usb_monitor, m_greeter);
+ // cppcheck in Ubuntu 20.04 requires the unused attribute to be set here...
+ Q_UNUSED(usb_manager);
for (std::remove_const<decltype(N_TESTS)>::type i=0; i<N_TESTS; ++i)
{
@@ -210,10 +215,14 @@ TEST_F(UsbManagerFixture, Greeter)
// start a mock AdbdServer ready to submit a request
const std::string public_key {"public_key"};
auto adbd_server = std::make_shared<GAdbdServer>(*socket_path, std::vector<std::string>{"PK"+public_key});
+ // cppcheck in Ubuntu 20.04 requires the unused attribute to be set here...
+ Q_UNUSED(adbd_server);
// set up a UsbManager to process the request
m_greeter->m_state.set(Greeter::State::ACTIVE);
auto usb_manager = std::make_shared<UsbManager>(*socket_path, *public_keys_path, m_usb_monitor, m_greeter);
+ // cppcheck in Ubuntu 20.04 requires the unused attribute to be set here...
+ Q_UNUSED(usb_manager);
// add a signal spy to listen to the notification daemon
QSignalSpy notificationsSpy(