1
0
mirror of https://github.com/falk-werner/webfuse-provider synced 2024-10-27 20:44:10 +00:00
falk-werner_webfuse-provider/test/webfuse/tests/adapter/operation/test_context.cc

23 lines
644 B
C++
Raw Normal View History

#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;
2020-04-04 21:27:34 +00:00
wf_impl_operation_context context;
context.session = &session;
2020-04-04 21:27:34 +00:00
ASSERT_EQ(proxy, wf_impl_operation_context_get_proxy(&context));
}
TEST(wf_impl_operation_context, get_proxy_fail_no_session)
{
2020-04-04 21:27:34 +00:00
wf_impl_operation_context context;
context.session = nullptr;
2020-04-04 21:27:34 +00:00
ASSERT_EQ(nullptr, wf_impl_operation_context_get_proxy(&context));
}