diff --git a/test/server_context_test.cpp b/test/server_context_test.cpp index bb3fa2a..04c9d97 100644 --- a/test/server_context_test.cpp +++ b/test/server_context_test.cpp @@ -83,3 +83,27 @@ BOOST_FIXTURE_TEST_CASE(server_context_applying_2pc_rollback, const wsrep::transaction_context& txc(cc.transaction()); BOOST_REQUIRE(txc.state() == wsrep::transaction_context::s_aborted); } + +BOOST_AUTO_TEST_CASE(server_context_state_strings) +{ + BOOST_REQUIRE(wsrep::to_string( + wsrep::server_context::s_disconnected) == "disconnected"); + BOOST_REQUIRE(wsrep::to_string( + wsrep::server_context::s_initializing) == "initilizing"); + BOOST_REQUIRE(wsrep::to_string( + wsrep::server_context::s_initialized) == "initilized"); + BOOST_REQUIRE(wsrep::to_string( + wsrep::server_context::s_connected) == "connected"); + BOOST_REQUIRE(wsrep::to_string( + wsrep::server_context::s_joiner) == "joiner"); + BOOST_REQUIRE(wsrep::to_string( + wsrep::server_context::s_joined) == "joined"); + BOOST_REQUIRE(wsrep::to_string( + wsrep::server_context::s_donor) == "donor"); + BOOST_REQUIRE(wsrep::to_string( + wsrep::server_context::s_synced) == "synced"); + BOOST_REQUIRE(wsrep::to_string( + wsrep::server_context::s_disconnecting) == "disconnecting"); + BOOST_REQUIRE(wsrep::to_string( + static_cast(0xff)) == "unknown"); +} diff --git a/test/transaction_context_test.cpp b/test/transaction_context_test.cpp index c70c30b..59345ce 100644 --- a/test/transaction_context_test.cpp +++ b/test/transaction_context_test.cpp @@ -1148,3 +1148,49 @@ BOOST_FIXTURE_TEST_CASE(transaction_context_statement_streaming_cert_fail, BOOST_REQUIRE(sc.provider().start_fragments() == 0); BOOST_REQUIRE(sc.provider().rollback_fragments() == 0); } + +/////////////////////////////////////////////////////////////////////////////// +// misc // +/////////////////////////////////////////////////////////////////////////////// + +BOOST_AUTO_TEST_CASE(transaction_context_state_strings) +{ + BOOST_REQUIRE(wsrep::to_string( + wsrep::transaction_context::s_executing) == "executing"); + BOOST_REQUIRE(wsrep::to_string( + wsrep::transaction_context::s_preparing) == "preparing"); + BOOST_REQUIRE( + wsrep::to_string( + wsrep::transaction_context::s_certifying) == "certifying"); + BOOST_REQUIRE( + wsrep::to_string( + wsrep::transaction_context::s_committing) == "committing"); + BOOST_REQUIRE( + wsrep::to_string( + wsrep::transaction_context::s_ordered_commit) == "ordered_commit"); + BOOST_REQUIRE( + wsrep::to_string( + wsrep::transaction_context::s_committed) == "committed"); + BOOST_REQUIRE( + wsrep::to_string( + wsrep::transaction_context::s_cert_failed) == "cert_failed"); + BOOST_REQUIRE( + wsrep::to_string( + wsrep::transaction_context::s_must_abort) == "must_abort"); + BOOST_REQUIRE( + wsrep::to_string( + wsrep::transaction_context::s_aborting) == "aborting"); + BOOST_REQUIRE( + wsrep::to_string( + wsrep::transaction_context::s_aborted) == "aborted"); + BOOST_REQUIRE( + wsrep::to_string( + wsrep::transaction_context::s_must_replay) == "must_replay"); + BOOST_REQUIRE( + wsrep::to_string( + wsrep::transaction_context::s_replaying) == "replaying"); + BOOST_REQUIRE( + wsrep::to_string( + static_cast(0xff)) == "unknown"); + +}