Delete and re-add libpqxx-7.7.3 due to weird corruption.
This commit is contained in:
parent
5a8d2c3cb4
commit
e96515433d
457 changed files with 0 additions and 110654 deletions
|
@ -1,45 +0,0 @@
|
|||
#include <pqxx/except>
|
||||
#include <pqxx/transaction>
|
||||
|
||||
#include "../test_helpers.hxx"
|
||||
|
||||
|
||||
namespace
|
||||
{
|
||||
void test_exceptions()
|
||||
{
|
||||
std::string const broken_query{"SELECT HORRIBLE ERROR"},
|
||||
err{"Error message"};
|
||||
|
||||
try
|
||||
{
|
||||
throw pqxx::sql_error{err, broken_query};
|
||||
}
|
||||
catch (std::exception const &e)
|
||||
{
|
||||
PQXX_CHECK_EQUAL(e.what(), err, "Exception contains wrong message.");
|
||||
auto downcast{dynamic_cast<pqxx::sql_error const *>(&e)};
|
||||
PQXX_CHECK(
|
||||
downcast != nullptr, "exception-to-sql_error downcast is broken.");
|
||||
PQXX_CHECK_EQUAL(
|
||||
downcast->query(), broken_query,
|
||||
"Getting query from pqxx exception is broken.");
|
||||
}
|
||||
|
||||
pqxx::connection conn;
|
||||
pqxx::work tx{conn};
|
||||
try
|
||||
{
|
||||
tx.exec("INVALID QUERY HERE");
|
||||
}
|
||||
catch (pqxx::syntax_error const &e)
|
||||
{
|
||||
// SQL syntax error has sqlstate error 42601.
|
||||
PQXX_CHECK_EQUAL(
|
||||
e.sqlstate(), "42601", "Unexpected sqlstate on syntax error.");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
PQXX_REGISTER_TEST(test_exceptions);
|
||||
} // namespace
|
Loading…
Add table
Add a link
Reference in a new issue