From 90b0fd28697216e7c7a3f411936c1b7c6b36bb56 Mon Sep 17 00:00:00 2001 From: Marco Bubke Date: Thu, 13 Jul 2023 09:06:16 +0200 Subject: [PATCH] UnitTests: Fix warning Change-Id: I834095e1e8f40cb063b6014e98bf79ae8d8e439b Reviewed-by: Tim Jenssen Reviewed-by: Qt CI Patch Build Bot --- tests/unit/tests/printers/gtest-creator-printing.cpp | 9 +++++---- tests/unit/tests/unittests/model/modelutils-test.cpp | 10 +++++----- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/tests/unit/tests/printers/gtest-creator-printing.cpp b/tests/unit/tests/printers/gtest-creator-printing.cpp index a8c4e17445b..25bb4d18d90 100644 --- a/tests/unit/tests/printers/gtest-creator-printing.cpp +++ b/tests/unit/tests/printers/gtest-creator-printing.cpp @@ -221,6 +221,7 @@ std::ostream &operator<<(std::ostream &out, const ValueView &value) } namespace { +[[maybe_unused]] Utils::SmallStringView operationText(int operation) { switch (operation) { @@ -235,9 +236,9 @@ Utils::SmallStringView operationText(int operation) return {}; } -std::ostream &operator<<(std::ostream &out, sqlite3_changeset_iter *iter) -{ #if 0 +std::ostream &operator<<(std::ostream &out, [[maybe_unused]] sqlite3_changeset_iter *iter) +{ out << "("; const char *tableName = nullptr; @@ -280,9 +281,9 @@ std::ostream &operator<<(std::ostream &out, sqlite3_changeset_iter *iter) } out << "})"; -#endif return out; } +#endif const char *toText(Operation operation) { @@ -315,7 +316,7 @@ const char *toText(LockingMode lockingMode) } } // namespace -std::ostream &operator<<(std::ostream &out, const SessionChangeSet &changeset) +std::ostream &operator<<(std::ostream &out, [[maybe_unused]] const SessionChangeSet &changeset) { #if 0 sqlite3_changeset_iter *iter = nullptr; diff --git a/tests/unit/tests/unittests/model/modelutils-test.cpp b/tests/unit/tests/unittests/model/modelutils-test.cpp index 7423649296a..4418d36ac83 100644 --- a/tests/unit/tests/unittests/model/modelutils-test.cpp +++ b/tests/unit/tests/unittests/model/modelutils-test.cpp @@ -83,11 +83,11 @@ TEST_F(ModelUtils, component_file_path_for_invalid_node_is_empty) TEST_F(ModelUtils, component_file_path_for_node_without_metainfo_is_empty) { - auto typeId = projectStorageMock.createType(moduleId, - "Foo", - QmlDesigner::Storage::TypeTraits::IsFileComponent, - {}, - sourceId); + projectStorageMock.createType(moduleId, + "Foo", + QmlDesigner::Storage::TypeTraits::IsFileComponent, + {}, + sourceId); auto node = model.createModelNode("Foo"); auto path = QmlDesigner::ModelUtils::componentFilePath(node);