Tests: Fix warnings: unknown pragma ignored [-Wunknown-pragmas]

This commit is contained in:
wmayer
2024-07-12 20:04:07 +02:00
committed by wwmayer
parent 9868533d8d
commit b0676d0578

View File

@@ -233,14 +233,14 @@ void testFindSubShapesForSourceWithTypeAndIndex(const std::string& shapeTypeStr,
MappedName mappedName {elementStdMap[indexedName]};
const char shapeTypePrefix {indexedName.toString()[0]};
#pragma warning(push)
#pragma warning(disable : 4834) // Discarding a [[nodiscard]], which we are about to do...
EXPECT_NO_THROW(elementStdMap.at(indexedName)); // We check that the IndexedName
// is one of the keys...
EXPECT_NE(mappedName.find(shapeName.c_str()),
-1); // ... that the element name is in the MappedName...
QT_WARNING_PUSH
QT_WARNING_DISABLE_MSVC(4834) // Discarding a [[nodiscard]], which we are about to do...
// We check that the IndexedName is one of the keys...
EXPECT_NO_THROW(elementStdMap.at(indexedName));
// ... that the element name is in the MappedName...
EXPECT_NE(mappedName.find(shapeName.c_str()), -1);
EXPECT_EQ(mappedName.toString().back(), shapeTypePrefix);
#pragma warning(pop)
QT_WARNING_POP
}
void testFindSubShapesForSourceWithType(const TopoShape& source,