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