mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-01-05 04:34:09 +00:00
be7ce4110e
This reverts commit e96515433d
.
38 lines
907 B
C++
38 lines
907 B
C++
#include <pqxx/transaction>
|
|
|
|
#include "../test_helpers.hxx"
|
|
|
|
extern "C"
|
|
{
|
|
#include <libpq-fe.h>
|
|
}
|
|
|
|
namespace
|
|
{
|
|
void test_error_verbosity()
|
|
{
|
|
PQXX_CHECK_EQUAL(
|
|
static_cast<int>(pqxx::error_verbosity::terse),
|
|
static_cast<int>(PQERRORS_TERSE),
|
|
"error_verbosity enum should match PGVerbosity.");
|
|
PQXX_CHECK_EQUAL(
|
|
static_cast<int>(pqxx::error_verbosity::normal),
|
|
static_cast<int>(PQERRORS_DEFAULT),
|
|
"error_verbosity enum should match PGVerbosity.");
|
|
PQXX_CHECK_EQUAL(
|
|
static_cast<int>(pqxx::error_verbosity::verbose),
|
|
static_cast<int>(PQERRORS_VERBOSE),
|
|
"error_verbosity enum should match PGVerbosity.");
|
|
|
|
pqxx::connection conn;
|
|
pqxx::work tx{conn};
|
|
conn.set_verbosity(pqxx::error_verbosity::terse);
|
|
tx.exec1("SELECT 1");
|
|
conn.set_verbosity(pqxx::error_verbosity::verbose);
|
|
tx.exec1("SELECT 2");
|
|
}
|
|
|
|
|
|
PQXX_REGISTER_TEST(test_error_verbosity);
|
|
} // namespace
|