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:
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
Reference in New Issue
Block a user