test56.cxx 445 B

123456789101112131415161718192021222324
  1. #include <pqxx/transaction>
  2. #include "test_helpers.hxx"
  3. using namespace pqxx;
  4. // Simple test program for libpqxx. Issue invalid query and handle error.
  5. namespace
  6. {
  7. void test_056()
  8. {
  9. connection conn;
  10. work tx{conn};
  11. quiet_errorhandler d(conn);
  12. PQXX_CHECK_THROWS(
  13. tx.exec("DELIBERATELY INVALID TEST QUERY..."), sql_error,
  14. "SQL syntax error did not raise expected exception.");
  15. }
  16. PQXX_REGISTER_TEST(test_056);
  17. } // namespace