1
0
mirror of https://github.com/falk-werner/webfuse-provider synced 2024-09-29 20:20:46 +00:00
falk-werner_webfuse-provider/test/webfuse/tests/adapter/operation/test_context.cc
2020-04-04 23:27:34 +02:00

23 lines
644 B
C++

#include "webfuse/adapter/impl/operation/context.h"
#include "webfuse/adapter/impl/session.h"
#include <gtest/gtest.h>
TEST(wf_impl_operation_context, get_proxy)
{
wf_jsonrpc_proxy * proxy = reinterpret_cast<wf_jsonrpc_proxy*>(42);
wf_impl_session session;
session.rpc = proxy;
wf_impl_operation_context context;
context.session = &session;
ASSERT_EQ(proxy, wf_impl_operation_context_get_proxy(&context));
}
TEST(wf_impl_operation_context, get_proxy_fail_no_session)
{
wf_impl_operation_context context;
context.session = nullptr;
ASSERT_EQ(nullptr, wf_impl_operation_context_get_proxy(&context));
}