1
0
mirror of https://github.com/codership/wsrep-lib.git synced 2025-07-28 20:02:00 +03:00

Removing client_state dependency from client_service.

This commit is contained in:
Teemu Ollakka
2018-06-18 10:21:02 +03:00
parent af3119a58b
commit 03043d3f25
12 changed files with 159 additions and 175 deletions

View File

@ -13,7 +13,7 @@ namespace
applying_server_fixture()
: sc("s1", "s1",
wsrep::server_state::rm_sync)
, cc(sc, sc.client_service(),
, cc(sc,
wsrep::client_id(1),
wsrep::client_state::m_high_priority)
, ws_handle(1, (void*)1)
@ -25,7 +25,7 @@ namespace
{
}
wsrep::mock_server_state sc;
wsrep::mock_client_state cc;
wsrep::mock_client cc;
wsrep::ws_handle ws_handle;
wsrep::ws_meta ws_meta;
};
@ -61,7 +61,7 @@ BOOST_FIXTURE_TEST_CASE(server_state_applying_2pc,
BOOST_FIXTURE_TEST_CASE(server_state_applying_1pc_rollback,
applying_server_fixture)
{
sc.client_service().fail_next_applying_ = true;
cc.fail_next_applying_ = true;
char buf[1] = { 1 };
BOOST_REQUIRE(sc.on_apply(cc, ws_handle, ws_meta,
wsrep::const_buffer(buf, 1)) == 1);
@ -74,7 +74,7 @@ BOOST_FIXTURE_TEST_CASE(server_state_applying_1pc_rollback,
BOOST_FIXTURE_TEST_CASE(server_state_applying_2pc_rollback,
applying_server_fixture)
{
sc.client_service().fail_next_applying_ = true;
cc.fail_next_applying_ = true;
char buf[1] = { 1 };
BOOST_REQUIRE(sc.on_apply(cc, ws_handle, ws_meta,
wsrep::const_buffer(buf, 1)) == 1);
@ -86,10 +86,9 @@ BOOST_AUTO_TEST_CASE(server_state_streaming)
{
wsrep::mock_server_state sc("s1", "s1",
wsrep::server_state::rm_sync);
wsrep::mock_client_state cc(sc,
sc.client_service(),
wsrep::client_id(1),
wsrep::client_state::m_high_priority);
wsrep::mock_client cc(sc,
wsrep::client_id(1),
wsrep::client_state::m_high_priority);
wsrep::ws_handle ws_handle(1, (void*)1);
wsrep::ws_meta ws_meta(wsrep::gtid(wsrep::id("1"), wsrep::seqno(1)),
wsrep::stid(wsrep::id("1"), 1, 1),