From 368c1edf2a6182dcde7a91e6facbf3dbdd6c7456 Mon Sep 17 00:00:00 2001 From: Thomas Lively Date: Fri, 15 Nov 2024 16:18:29 -0500 Subject: Mark Result and MaybeResult [[nodiscard]] (#7083) Since these types may be carrying errors that need to be handled or propagated, it is always an error not to use them in some way. Adding the [[nodiscard]] attribute caused the compiler to find a few instances where we were incorrectly ignoring results. Fix these places. --- test/gtest/local-graph.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'test/gtest') diff --git a/test/gtest/local-graph.cpp b/test/gtest/local-graph.cpp index 5360813ce..d9ec57beb 100644 --- a/test/gtest/local-graph.cpp +++ b/test/gtest/local-graph.cpp @@ -25,7 +25,7 @@ TEST_F(LocalGraphTest, ObstacleBasics) { )wasm"; Module wasm; - WATParser::parseModule(wasm, moduleText); + ASSERT_FALSE(WATParser::parseModule(wasm, moduleText).getErr()); // Get access to the contents of the wasm. auto* func = wasm.functions[0].get(); @@ -79,7 +79,7 @@ TEST_F(LocalGraphTest, ObstacleMultiblock) { ) )wasm"; Module wasm; - WATParser::parseModule(wasm, moduleText); + ASSERT_FALSE(WATParser::parseModule(wasm, moduleText).getErr()); auto* func = wasm.functions[0].get(); auto* block = func->body->cast(); auto* set = block->list[0]->cast(); @@ -113,7 +113,7 @@ TEST_F(LocalGraphTest, ObstacleUnreachable) { ) )wasm"; Module wasm; - WATParser::parseModule(wasm, moduleText); + ASSERT_FALSE(WATParser::parseModule(wasm, moduleText).getErr()); auto* func = wasm.functions[0].get(); auto* block = func->body->cast(); auto* set = block->list[0]->cast(); @@ -149,7 +149,7 @@ TEST_F(LocalGraphTest, ObstacleMultiGet) { ) )wasm"; Module wasm; - WATParser::parseModule(wasm, moduleText); + ASSERT_FALSE(WATParser::parseModule(wasm, moduleText).getErr()); auto* func = wasm.functions[0].get(); auto* block = func->body->cast(); auto* set = block->list[0]->cast(); @@ -185,7 +185,7 @@ TEST_F(LocalGraphTest, ObstacleMultiSet) { ) )wasm"; Module wasm; - WATParser::parseModule(wasm, moduleText); + ASSERT_FALSE(WATParser::parseModule(wasm, moduleText).getErr()); auto* func = wasm.functions[0].get(); auto* block = func->body->cast(); auto* setA = block->list[0]->cast(); @@ -227,7 +227,7 @@ TEST_F(LocalGraphTest, ObstacleMultiSetIndexes) { ) )wasm"; Module wasm; - WATParser::parseModule(wasm, moduleText); + ASSERT_FALSE(WATParser::parseModule(wasm, moduleText).getErr()); auto* func = wasm.functions[0].get(); auto* block = func->body->cast(); auto* setA = block->list[0]->cast(); @@ -276,7 +276,7 @@ TEST_F(LocalGraphTest, ObstacleMultiSetIf) { ) )wasm"; Module wasm; - WATParser::parseModule(wasm, moduleText); + ASSERT_FALSE(WATParser::parseModule(wasm, moduleText).getErr()); auto* func = wasm.functions[0].get(); auto* block = func->body->cast(); auto* iff = block->list[0]->cast(); @@ -332,7 +332,7 @@ TEST_F(LocalGraphTest, ObstacleStructSet) { ) )wasm"; Module wasm; - WATParser::parseModule(wasm, moduleText); + ASSERT_FALSE(WATParser::parseModule(wasm, moduleText).getErr()); auto* func = wasm.functions[0].get(); auto* outerBlock = func->body->cast(); auto* block = outerBlock->list[0]->cast(); -- cgit v1.2.3