[test-gnc-guid.cpp] use EXPECT_THROW

instead of try..catch
This commit is contained in:
Christopher Lam committed 2025-11-30 20:51:33 +08:00
1 parent cdb9dfa0ee
commit 1cfda5a71a
1 file changed
+1 -11
+1 -11
View File
@@ -73,17 +73,7 @@ TEST (GncGUID, from_string)
guid = gnc::GUID::create_random ();
std::string bogus {"Have a great big roast beef sandwich, if you please!"};
bool fail = false;
try
{
gnc::GUID::from_string (bogus);
}
catch (gnc::guid_syntax_exception const &)
{
fail = true;
}
EXPECT_TRUE (fail) << "Parsing the bogus string should throw";
EXPECT_THROW (gnc::GUID::from_string (bogus), gnc::guid_syntax_exception);
}
TEST (GncGUID, round_trip)