1
0
mirror of https://github.com/falk-werner/webfuse-provider synced 2026-03-02 04:09:18 +00:00

added implementation of wfp_client_disconnect

This commit is contained in:
Falk Werner
2020-04-07 20:37:50 +02:00
parent 36f2b82a67
commit 3eb5dc89a7
7 changed files with 61 additions and 5 deletions

View File

@@ -67,6 +67,12 @@ private:
{
wfp_client_service(context->client);
}
wfp_client_disconnect(context->client);
while (wfp_impl_client_is_connected(context->client))
{
wfp_client_service(context->client);
}
}
std::mutex shutdown_lock;

View File

@@ -52,6 +52,11 @@ public:
server->waitForConnection();
}
void Disconnect()
{
wfp_client_protocol_disconnect(protocol);
}
void SendToClient(json_t * request)
{
server->sendMessage(request);
@@ -166,6 +171,16 @@ TEST(client_protocol, connect)
if (HasFatalFailure()) { return; }
}
TEST(client_protocol, disconnect_without_connect)
{
MockProviderClient provider;
ClientProtocolFixture fixture(provider);
EXPECT_CALL(provider, OnDisconnected()).Times(1);
fixture.Disconnect();
}
TEST(client_protocol, connect_with_username_authentication)
{
MockProviderClient provider;
@@ -184,7 +199,6 @@ TEST(client_protocol, connect_with_username_authentication)
std::string filesystem;
fixture.AwaitAddFilesystem(filesystem);
if (HasFatalFailure()) { return; }
}
TEST(client_protocol, getattr)
@@ -216,4 +230,6 @@ TEST(client_protocol, getattr)
ASSERT_TRUE(json_is_object(response));
json_decref(response);
fixture.Disconnect();
}