1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
#include <test_helpers.hxx>
#include <pqxx/util>
using namespace PGSTD;
using namespace pqxx;
namespace
{
void test_thread_safety_model(transaction_base &)
{
const thread_safety_model model = describe_thread_safety();
if (model.have_safe_strerror &&
model.safe_libpq &&
model.safe_query_cancel &&
model.safe_result_copy &&
model.safe_kerberos)
PQXX_CHECK_EQUAL(
model.description,
"",
"Thread-safety looks okay but model description is nonempty.");
else
PQXX_CHECK_NOT_EQUAL(
model.description,
"",
"Thread-safety model is imperfect but lacks description.");
}
} // namespace
PQXX_REGISTER_TEST_NODB(test_thread_safety_model)
|