Skip to content

Commit 5b50848

Browse files
committed
odb: use EXPECT_THROW
Signed-off-by: Peter Gadfort <[email protected]>
1 parent 02a1909 commit 5b50848

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

src/odb/test/cpp/Test3DBloxParser.cpp

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -305,12 +305,7 @@ TEST_F(SimpleDbFixture, test_bump_map_reader_multiple_bterms)
305305

306306
ThreeDBlox parser(&logger_, db_.get());
307307
std::string path = getFilePath(prefix + "data/example3.bmap");
308-
try {
309-
parser.readBMap(path);
310-
FAIL() << "Expected exception for multiple BTerms connected to same net.";
311-
} catch (const std::runtime_error& e) {
312-
EXPECT_STREQ(e.what(), "ODB-0542");
313-
}
308+
EXPECT_THROW(parser.readBMap(path), std::runtime_error);
314309
}
315310

316311
TEST_F(SimpleDbFixture, test_bump_map_reader_no_bterms)
@@ -347,12 +342,7 @@ TEST_F(SimpleDbFixture, test_bump_map_reader_no_bterms)
347342

348343
ThreeDBlox parser(&logger_, db_.get());
349344
std::string path = getFilePath(prefix + "data/example3.bmap");
350-
try {
351-
parser.readBMap(path);
352-
FAIL() << "Expected exception for no BTerms connected to net.";
353-
} catch (const std::runtime_error& e) {
354-
EXPECT_STREQ(e.what(), "ODB-0544");
355-
}
345+
EXPECT_THROW(parser.readBMap(path), std::runtime_error);
356346
}
357347

358348
} // namespace

0 commit comments

Comments
 (0)