Add get_error_category() test to PostgreSQL tests

Use this function in at least one of the tests to check that it's not
totally broken.
This commit is contained in:
Vadim Zeitlin
2025-04-22 17:05:29 +02:00
parent cbb28ed046
commit cf3e73ed3c
+3 -1
View File
@@ -692,8 +692,10 @@ TEST_CASE("PostgreSQL statement prepare failure", "[postgresql][prepare]")
<< "select * from soci_test where name=9999");
FAIL("expected exception not thrown");
}
catch(soci_error const& e)
catch (postgresql_soci_error const& e)
{
CHECK( e.get_error_category() == soci_error::invalid_statement );
CHECK_THAT( e.what(), Catch::Contains("operator does not exist") );
}
}