mirror of
https://github.com/Gnucash/gnucash.git
synced 2026-11-02 20:30:45 -06:00
[test-gnc-guid.cpp] use EXPECT_THROW
instead of try..catch
This commit is contained in:
1 parent
cdb9dfa0ee
commit
1cfda5a71a
1 file changed
+1
-11
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user