ZeroTierOne/ext/libpqxx-7.7.3/test/unit/test_simultaneous_transactions.cxx

21 lines
405 B
C++
Raw Normal View History

2022-06-23 17:24:33 +00:00
#include <pqxx/nontransaction>
#include <pqxx/subtransaction>
#include "../test_helpers.hxx"
namespace
{
void test_simultaneous_transactions()
{
pqxx::connection conn;
pqxx::nontransaction n1{conn};
PQXX_CHECK_THROWS(
pqxx::nontransaction n2{conn}, std::logic_error,
"Allowed to open simultaneous nontransactions.");
}
PQXX_REGISTER_TEST(test_simultaneous_transactions);
} // namespace