diff options
author | Jonathan White <support@dmapps.us> | 2021-06-09 05:55:53 +0300 |
---|---|---|
committer | Jonathan White <support@dmapps.us> | 2021-06-12 05:49:39 +0300 |
commit | 6a8b070b0a9903ba9684cd9d104d26a55b2a9932 (patch) | |
tree | a0e07fff6a1a694b92a83a5b0c2eb7268b7c1012 /tests/gui | |
parent | a0912b057e25cfc50db2bb8e9ca957daa27f7a5d (diff) |
Resolve compiler warnings for unused return values
* Fixes #1932 - See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66425#c29
Adding a negation before the function call allows the (void) syntax to work properly.
Diffstat (limited to 'tests/gui')
-rw-r--r-- | tests/gui/TestGui.cpp | 13 | ||||
-rw-r--r-- | tests/gui/TestGui.h | 2 |
2 files changed, 4 insertions, 11 deletions
diff --git a/tests/gui/TestGui.cpp b/tests/gui/TestGui.cpp index 65f9e3b8d..e9d7fcd19 100644 --- a/tests/gui/TestGui.cpp +++ b/tests/gui/TestGui.cpp @@ -851,7 +851,7 @@ void TestGui::testTotp() void TestGui::testSearch() { // Add canned entries for consistent testing - Q_UNUSED(addCannedEntries()); + addCannedEntries(); auto* toolBar = m_mainWindow->findChild<QToolBar*>("toolBar"); @@ -1005,7 +1005,7 @@ void TestGui::testSearch() void TestGui::testDeleteEntry() { // Add canned entries for consistent testing - Q_UNUSED(addCannedEntries()); + addCannedEntries(); auto* groupView = m_dbWidget->findChild<GroupView*>("groupView"); auto* entryView = m_dbWidget->findChild<EntryView*>("entryView"); @@ -1685,10 +1685,8 @@ void TestGui::testAutoType() entryView->selectionModel()->clearSelection(); } -int TestGui::addCannedEntries() +void TestGui::addCannedEntries() { - int entries_added = 0; - // Find buttons auto* toolBar = m_mainWindow->findChild<QToolBar*>("toolBar"); QWidget* entryNewWidget = toolBar->widgetForAction(m_mainWindow->findChild<QAction*>("actionEntryNew")); @@ -1701,22 +1699,17 @@ int TestGui::addCannedEntries() QTest::keyClicks(titleEdit, "test"); auto* editEntryWidgetButtonBox = editEntryWidget->findChild<QDialogButtonBox*>("buttonBox"); QTest::mouseClick(editEntryWidgetButtonBox->button(QDialogButtonBox::Ok), Qt::LeftButton); - ++entries_added; // Add entry "something 2" QTest::mouseClick(entryNewWidget, Qt::LeftButton); QTest::keyClicks(titleEdit, "something 2"); QTest::keyClicks(passwordEdit, "something 2"); QTest::mouseClick(editEntryWidgetButtonBox->button(QDialogButtonBox::Ok), Qt::LeftButton); - ++entries_added; // Add entry "something 3" QTest::mouseClick(entryNewWidget, Qt::LeftButton); QTest::keyClicks(titleEdit, "something 3"); QTest::mouseClick(editEntryWidgetButtonBox->button(QDialogButtonBox::Ok), Qt::LeftButton); - ++entries_added; - - return entries_added; } void TestGui::checkDatabase(QString dbFileName) diff --git a/tests/gui/TestGui.h b/tests/gui/TestGui.h index 5bfc04265..b41e22227 100644 --- a/tests/gui/TestGui.h +++ b/tests/gui/TestGui.h @@ -72,7 +72,7 @@ private slots: void testTrayRestoreHide(); private: - int addCannedEntries(); + void addCannedEntries(); void checkDatabase(QString dbFileName = ""); void triggerAction(const QString& name); void dragAndDropGroup(const QModelIndex& sourceIndex, |