From 49469c73e30183b7d3cff0892619fe6ef8d4331a Mon Sep 17 00:00:00 2001 From: Falk Werner Date: Sat, 4 Apr 2020 23:27:34 +0200 Subject: [PATCH] renamed operation_context --- cmake/unit_tests.cmake | 4 +-- lib/webfuse/adapter/impl/filesystem.h | 2 +- lib/webfuse/adapter/impl/operation/close.c | 4 +-- lib/webfuse/adapter/impl/operation/context.c | 4 +-- lib/webfuse/adapter/impl/operation/context.h | 6 ++--- lib/webfuse/adapter/impl/operation/getattr.c | 4 +-- lib/webfuse/adapter/impl/operation/lookup.c | 4 +-- lib/webfuse/adapter/impl/operation/open.c | 4 +-- lib/webfuse/adapter/impl/operation/read.c | 4 +-- lib/webfuse/adapter/impl/operation/readdir.c | 4 +-- test/webfuse/mocks/mock_operation_context.cc | 27 +++++++++++++++++++ test/webfuse/mocks/mock_operation_context.hpp | 22 +++++++++++++++ test/webfuse/mocks/mock_operations_context.cc | 27 ------------------- .../webfuse/mocks/mock_operations_context.hpp | 22 --------------- .../tests/adapter/operation/test_close.cc | 14 +++++----- .../tests/adapter/operation/test_context.cc | 8 +++--- .../tests/adapter/operation/test_getattr.cc | 14 +++++----- .../tests/adapter/operation/test_lookup.cc | 14 +++++----- .../tests/adapter/operation/test_open.cc | 14 +++++----- .../tests/adapter/operation/test_read.cc | 20 +++++++------- .../tests/adapter/operation/test_readdir.cc | 14 +++++----- 21 files changed, 118 insertions(+), 118 deletions(-) create mode 100644 test/webfuse/mocks/mock_operation_context.cc create mode 100644 test/webfuse/mocks/mock_operation_context.hpp delete mode 100644 test/webfuse/mocks/mock_operations_context.cc delete mode 100644 test/webfuse/mocks/mock_operations_context.hpp diff --git a/cmake/unit_tests.cmake b/cmake/unit_tests.cmake index eaa8427..43b9598 100644 --- a/cmake/unit_tests.cmake +++ b/cmake/unit_tests.cmake @@ -31,7 +31,7 @@ add_executable(alltests test/webfuse/mocks/mock_provider_client.cc test/webfuse/mocks/mock_provider.cc test/webfuse/mocks/mock_fuse.cc - test/webfuse/mocks/mock_operations_context.cc + test/webfuse/mocks/mock_operation_context.cc test/webfuse/mocks/mock_jsonrpc_proxy.cc test/webfuse//tests/core/test_util.cc test/webfuse/tests/core/test_container_of.cc @@ -77,7 +77,7 @@ target_link_libraries(alltests PUBLIC -Wl,--wrap=wf_timer_dispose -Wl,--wrap=wf_timer_start -Wl,--wrap=wf_timer_cancel - -Wl,--wrap=wf_impl_operations_context_get_proxy + -Wl,--wrap=wf_impl_operation_context_get_proxy -Wl,--wrap=wf_jsonrpc_proxy_vinvoke -Wl,--wrap=wf_jsonrpc_proxy_vnotify -Wl,--wrap=fuse_req_userdata diff --git a/lib/webfuse/adapter/impl/filesystem.h b/lib/webfuse/adapter/impl/filesystem.h index 9ea6406..791170a 100644 --- a/lib/webfuse/adapter/impl/filesystem.h +++ b/lib/webfuse/adapter/impl/filesystem.h @@ -24,7 +24,7 @@ struct wf_impl_filesystem struct fuse_args args; struct fuse_session * session; struct fuse_buf buffer; - struct wf_impl_operations_context user_data; + struct wf_impl_operation_context user_data; struct lws * wsi; struct wf_mountpoint * mountpoint; }; diff --git a/lib/webfuse/adapter/impl/operation/close.c b/lib/webfuse/adapter/impl/operation/close.c index 5e3c4e8..62d1ec3 100644 --- a/lib/webfuse/adapter/impl/operation/close.c +++ b/lib/webfuse/adapter/impl/operation/close.c @@ -13,8 +13,8 @@ void wf_impl_operation_close( fuse_ino_t inode, struct fuse_file_info * file_info) { - struct wf_impl_operations_context * user_data = fuse_req_userdata(request); - struct wf_jsonrpc_proxy * rpc = wf_impl_operations_context_get_proxy(user_data); + struct wf_impl_operation_context * user_data = fuse_req_userdata(request); + struct wf_jsonrpc_proxy * rpc = wf_impl_operation_context_get_proxy(user_data); if (NULL != rpc) { diff --git a/lib/webfuse/adapter/impl/operation/context.c b/lib/webfuse/adapter/impl/operation/context.c index 1bde8b1..a39978f 100644 --- a/lib/webfuse/adapter/impl/operation/context.c +++ b/lib/webfuse/adapter/impl/operation/context.c @@ -3,8 +3,8 @@ #include "webfuse/adapter/impl/session.h" #include -struct wf_jsonrpc_proxy * wf_impl_operations_context_get_proxy( - struct wf_impl_operations_context * context) +struct wf_jsonrpc_proxy * wf_impl_operation_context_get_proxy( + struct wf_impl_operation_context * context) { struct wf_jsonrpc_proxy * proxy = NULL; diff --git a/lib/webfuse/adapter/impl/operation/context.h b/lib/webfuse/adapter/impl/operation/context.h index 17f5f81..51d886f 100644 --- a/lib/webfuse/adapter/impl/operation/context.h +++ b/lib/webfuse/adapter/impl/operation/context.h @@ -10,15 +10,15 @@ extern "C" { struct wf_impl_session; struct wf_jsonrpc_proxy; -struct wf_impl_operations_context +struct wf_impl_operation_context { struct wf_impl_session * session; double timeout; char * name; }; -extern struct wf_jsonrpc_proxy * wf_impl_operations_context_get_proxy( - struct wf_impl_operations_context * context); +extern struct wf_jsonrpc_proxy * wf_impl_operation_context_get_proxy( + struct wf_impl_operation_context * context); #ifdef __cplusplus } diff --git a/lib/webfuse/adapter/impl/operation/getattr.c b/lib/webfuse/adapter/impl/operation/getattr.c index 3c00840..8318dc2 100644 --- a/lib/webfuse/adapter/impl/operation/getattr.c +++ b/lib/webfuse/adapter/impl/operation/getattr.c @@ -73,8 +73,8 @@ void wf_impl_operation_getattr ( struct fuse_file_info * WF_UNUSED_PARAM(file_info)) { struct fuse_ctx const * context = fuse_req_ctx(request); - struct wf_impl_operations_context * user_data = fuse_req_userdata(request); - struct wf_jsonrpc_proxy * rpc = wf_impl_operations_context_get_proxy(user_data); + struct wf_impl_operation_context * user_data = fuse_req_userdata(request); + struct wf_jsonrpc_proxy * rpc = wf_impl_operation_context_get_proxy(user_data); if (NULL != rpc) { diff --git a/lib/webfuse/adapter/impl/operation/lookup.c b/lib/webfuse/adapter/impl/operation/lookup.c index ca778cd..4ebbe3c 100644 --- a/lib/webfuse/adapter/impl/operation/lookup.c +++ b/lib/webfuse/adapter/impl/operation/lookup.c @@ -84,8 +84,8 @@ void wf_impl_operation_lookup ( char const * name) { struct fuse_ctx const * context = fuse_req_ctx(request); - struct wf_impl_operations_context * user_data = fuse_req_userdata(request); - struct wf_jsonrpc_proxy * rpc = wf_impl_operations_context_get_proxy(user_data); + struct wf_impl_operation_context * user_data = fuse_req_userdata(request); + struct wf_jsonrpc_proxy * rpc = wf_impl_operation_context_get_proxy(user_data); if (NULL != rpc) { diff --git a/lib/webfuse/adapter/impl/operation/open.c b/lib/webfuse/adapter/impl/operation/open.c index 712f240..1b25d99 100644 --- a/lib/webfuse/adapter/impl/operation/open.c +++ b/lib/webfuse/adapter/impl/operation/open.c @@ -48,8 +48,8 @@ void wf_impl_operation_open( fuse_ino_t inode, struct fuse_file_info * file_info) { - struct wf_impl_operations_context * user_data = fuse_req_userdata(request); - struct wf_jsonrpc_proxy * rpc = wf_impl_operations_context_get_proxy(user_data); + struct wf_impl_operation_context * user_data = fuse_req_userdata(request); + struct wf_jsonrpc_proxy * rpc = wf_impl_operation_context_get_proxy(user_data); if (NULL != rpc) { diff --git a/lib/webfuse/adapter/impl/operation/read.c b/lib/webfuse/adapter/impl/operation/read.c index 81b6928..7e2e0f4 100644 --- a/lib/webfuse/adapter/impl/operation/read.c +++ b/lib/webfuse/adapter/impl/operation/read.c @@ -111,8 +111,8 @@ void wf_impl_operation_read( off_t offset, struct fuse_file_info * file_info) { - struct wf_impl_operations_context * user_data = fuse_req_userdata(request); - struct wf_jsonrpc_proxy * rpc = wf_impl_operations_context_get_proxy(user_data); + struct wf_impl_operation_context * user_data = fuse_req_userdata(request); + struct wf_jsonrpc_proxy * rpc = wf_impl_operation_context_get_proxy(user_data); if (NULL != rpc) { diff --git a/lib/webfuse/adapter/impl/operation/readdir.c b/lib/webfuse/adapter/impl/operation/readdir.c index 8022440..6d54636 100644 --- a/lib/webfuse/adapter/impl/operation/readdir.c +++ b/lib/webfuse/adapter/impl/operation/readdir.c @@ -141,8 +141,8 @@ void wf_impl_operation_readdir ( off_t offset, struct fuse_file_info * WF_UNUSED_PARAM(file_info)) { - struct wf_impl_operations_context * user_data = fuse_req_userdata(request); - struct wf_jsonrpc_proxy * rpc = wf_impl_operations_context_get_proxy(user_data); + struct wf_impl_operation_context * user_data = fuse_req_userdata(request); + struct wf_jsonrpc_proxy * rpc = wf_impl_operation_context_get_proxy(user_data); if (NULL != rpc) { diff --git a/test/webfuse/mocks/mock_operation_context.cc b/test/webfuse/mocks/mock_operation_context.cc new file mode 100644 index 0000000..9537533 --- /dev/null +++ b/test/webfuse/mocks/mock_operation_context.cc @@ -0,0 +1,27 @@ +#include "webfuse/mocks/mock_operation_context.hpp" +#include "webfuse/utils/wrap.hpp" + +extern "C" +{ +static webfuse_test::MockOperationContext * webfuse_test_MockOperationContext = nullptr; + +WF_WRAP_FUNC1(webfuse_test_MockOperationContext, + struct wf_jsonrpc_proxy *, wf_impl_operation_context_get_proxy, + struct wf_impl_operation_context *); + +} + +namespace webfuse_test +{ + +MockOperationContext::MockOperationContext() +{ + webfuse_test_MockOperationContext = this; +} + +MockOperationContext::~MockOperationContext() +{ + webfuse_test_MockOperationContext = nullptr; +} + +} \ No newline at end of file diff --git a/test/webfuse/mocks/mock_operation_context.hpp b/test/webfuse/mocks/mock_operation_context.hpp new file mode 100644 index 0000000..e692e76 --- /dev/null +++ b/test/webfuse/mocks/mock_operation_context.hpp @@ -0,0 +1,22 @@ +#ifndef MOCK_OPERATIONS_CONTEXT_HPP +#define MOCK_OPERATIONS_CONTEXT_HPP + +#include "webfuse/adapter/impl/operation/context.h" +#include + +namespace webfuse_test +{ + +class MockOperationContext +{ +public: + MockOperationContext(); + virtual ~MockOperationContext(); + MOCK_METHOD1(wf_impl_operation_context_get_proxy, wf_jsonrpc_proxy * ( + struct wf_impl_operation_context * context)); + +}; + +} + +#endif diff --git a/test/webfuse/mocks/mock_operations_context.cc b/test/webfuse/mocks/mock_operations_context.cc deleted file mode 100644 index 89498f7..0000000 --- a/test/webfuse/mocks/mock_operations_context.cc +++ /dev/null @@ -1,27 +0,0 @@ -#include "webfuse/mocks/mock_operations_context.hpp" -#include "webfuse/utils/wrap.hpp" - -extern "C" -{ -static webfuse_test::MockOperationsContext * webfuse_test_MockOperationsContext = nullptr; - -WF_WRAP_FUNC1(webfuse_test_MockOperationsContext, - struct wf_jsonrpc_proxy *, wf_impl_operations_context_get_proxy, - struct wf_impl_operations_context *); - -} - -namespace webfuse_test -{ - -MockOperationsContext::MockOperationsContext() -{ - webfuse_test_MockOperationsContext = this; -} - -MockOperationsContext::~MockOperationsContext() -{ - webfuse_test_MockOperationsContext = nullptr; -} - -} \ No newline at end of file diff --git a/test/webfuse/mocks/mock_operations_context.hpp b/test/webfuse/mocks/mock_operations_context.hpp deleted file mode 100644 index 1dee54c..0000000 --- a/test/webfuse/mocks/mock_operations_context.hpp +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef MOCK_OPERATIONS_CONTEXT_HPP -#define MOCK_OPERATIONS_CONTEXT_HPP - -#include "webfuse/adapter/impl/operation/context.h" -#include - -namespace webfuse_test -{ - -class MockOperationsContext -{ -public: - MockOperationsContext(); - virtual ~MockOperationsContext(); - MOCK_METHOD1(wf_impl_operations_context_get_proxy, wf_jsonrpc_proxy * ( - struct wf_impl_operations_context * context)); - -}; - -} - -#endif diff --git a/test/webfuse/tests/adapter/operation/test_close.cc b/test/webfuse/tests/adapter/operation/test_close.cc index 885e3bb..00e4763 100644 --- a/test/webfuse/tests/adapter/operation/test_close.cc +++ b/test/webfuse/tests/adapter/operation/test_close.cc @@ -2,13 +2,13 @@ #include #include "webfuse/mocks/mock_fuse.hpp" -#include "webfuse/mocks/mock_operations_context.hpp" +#include "webfuse/mocks/mock_operation_context.hpp" #include "webfuse/mocks/mock_jsonrpc_proxy.hpp" #include using webfuse_test::MockJsonRpcProxy; -using webfuse_test::MockOperationsContext; +using webfuse_test::MockOperationContext; using webfuse_test::FuseMock; using testing::_; using testing::Return; @@ -19,11 +19,11 @@ TEST(wf_impl_operation_close, notify_proxy) MockJsonRpcProxy proxy; EXPECT_CALL(proxy, wf_jsonrpc_proxy_vnotify(_,StrEq("close"),StrEq("siii"))).Times(1); - MockOperationsContext context; - EXPECT_CALL(context, wf_impl_operations_context_get_proxy(_)).Times(1) + MockOperationContext context; + EXPECT_CALL(context, wf_impl_operation_context_get_proxy(_)).Times(1) .WillOnce(Return(reinterpret_cast(&proxy))); - wf_impl_operations_context op_context; + wf_impl_operation_context op_context; op_context.name = nullptr; FuseMock fuse; EXPECT_CALL(fuse, fuse_req_userdata(_)).Times(1).WillOnce(Return(&op_context)); @@ -41,8 +41,8 @@ TEST(wf_impl_operation_close, fail_rpc_null) MockJsonRpcProxy proxy; EXPECT_CALL(proxy, wf_jsonrpc_proxy_vnotify(_,_,_)).Times(0); - MockOperationsContext context; - EXPECT_CALL(context, wf_impl_operations_context_get_proxy(_)).Times(1) + MockOperationContext context; + EXPECT_CALL(context, wf_impl_operation_context_get_proxy(_)).Times(1) .WillOnce(Return(nullptr)); FuseMock fuse; diff --git a/test/webfuse/tests/adapter/operation/test_context.cc b/test/webfuse/tests/adapter/operation/test_context.cc index bd53241..77aa287 100644 --- a/test/webfuse/tests/adapter/operation/test_context.cc +++ b/test/webfuse/tests/adapter/operation/test_context.cc @@ -7,17 +7,17 @@ TEST(wf_impl_operation_context, get_proxy) wf_jsonrpc_proxy * proxy = reinterpret_cast(42); wf_impl_session session; session.rpc = proxy; - wf_impl_operations_context context; + wf_impl_operation_context context; context.session = &session; - ASSERT_EQ(proxy, wf_impl_operations_context_get_proxy(&context)); + ASSERT_EQ(proxy, wf_impl_operation_context_get_proxy(&context)); } TEST(wf_impl_operation_context, get_proxy_fail_no_session) { - wf_impl_operations_context context; + wf_impl_operation_context context; context.session = nullptr; - ASSERT_EQ(nullptr, wf_impl_operations_context_get_proxy(&context)); + ASSERT_EQ(nullptr, wf_impl_operation_context_get_proxy(&context)); } \ No newline at end of file diff --git a/test/webfuse/tests/adapter/operation/test_getattr.cc b/test/webfuse/tests/adapter/operation/test_getattr.cc index 4dc0081..8249692 100644 --- a/test/webfuse/tests/adapter/operation/test_getattr.cc +++ b/test/webfuse/tests/adapter/operation/test_getattr.cc @@ -3,13 +3,13 @@ #include "webfuse/core/status.h" #include "webfuse/mocks/mock_fuse.hpp" -#include "webfuse/mocks/mock_operations_context.hpp" +#include "webfuse/mocks/mock_operation_context.hpp" #include "webfuse/mocks/mock_jsonrpc_proxy.hpp" #include using webfuse_test::MockJsonRpcProxy; -using webfuse_test::MockOperationsContext; +using webfuse_test::MockOperationContext; using webfuse_test::FuseMock; using testing::_; using testing::Return; @@ -37,11 +37,11 @@ TEST(wf_impl_operation_getattr, invoke_proxy) EXPECT_CALL(proxy, wf_jsonrpc_proxy_vinvoke(_,_,_,StrEq("getattr"),StrEq("si"))).Times(1) .WillOnce(Invoke(free_context)); - MockOperationsContext context; - EXPECT_CALL(context, wf_impl_operations_context_get_proxy(_)).Times(1) + MockOperationContext context; + EXPECT_CALL(context, wf_impl_operation_context_get_proxy(_)).Times(1) .WillOnce(Return(reinterpret_cast(&proxy))); - wf_impl_operations_context op_context; + wf_impl_operation_context op_context; op_context.name = nullptr; fuse_ctx fuse_context; fuse_context.gid = 0; @@ -59,8 +59,8 @@ TEST(wf_impl_operation_getattr, invoke_proxy) TEST(wf_impl_operation_getattr, fail_rpc_null) { - MockOperationsContext context; - EXPECT_CALL(context, wf_impl_operations_context_get_proxy(_)).Times(1) + MockOperationContext context; + EXPECT_CALL(context, wf_impl_operation_context_get_proxy(_)).Times(1) .WillOnce(Return(nullptr)); FuseMock fuse; diff --git a/test/webfuse/tests/adapter/operation/test_lookup.cc b/test/webfuse/tests/adapter/operation/test_lookup.cc index 73c5774..002fc30 100644 --- a/test/webfuse/tests/adapter/operation/test_lookup.cc +++ b/test/webfuse/tests/adapter/operation/test_lookup.cc @@ -3,13 +3,13 @@ #include "webfuse/core/status.h" #include "webfuse/mocks/mock_fuse.hpp" -#include "webfuse/mocks/mock_operations_context.hpp" +#include "webfuse/mocks/mock_operation_context.hpp" #include "webfuse/mocks/mock_jsonrpc_proxy.hpp" #include using webfuse_test::MockJsonRpcProxy; -using webfuse_test::MockOperationsContext; +using webfuse_test::MockOperationContext; using webfuse_test::FuseMock; using testing::_; using testing::Return; @@ -37,11 +37,11 @@ TEST(wf_impl_operation_lookup, invoke_proxy) EXPECT_CALL(proxy, wf_jsonrpc_proxy_vinvoke(_,_,_,StrEq("lookup"),StrEq("sis"))).Times(1) .WillOnce(Invoke(free_context)); - MockOperationsContext context; - EXPECT_CALL(context, wf_impl_operations_context_get_proxy(_)).Times(1) + MockOperationContext context; + EXPECT_CALL(context, wf_impl_operation_context_get_proxy(_)).Times(1) .WillOnce(Return(reinterpret_cast(&proxy))); - wf_impl_operations_context op_context; + wf_impl_operation_context op_context; op_context.name = nullptr; fuse_ctx fuse_context; fuse_context.gid = 0; @@ -58,8 +58,8 @@ TEST(wf_impl_operation_lookup, invoke_proxy) TEST(wf_impl_operation_lookup, fail_rpc_null) { - MockOperationsContext context; - EXPECT_CALL(context, wf_impl_operations_context_get_proxy(_)).Times(1) + MockOperationContext context; + EXPECT_CALL(context, wf_impl_operation_context_get_proxy(_)).Times(1) .WillOnce(Return(nullptr)); FuseMock fuse; diff --git a/test/webfuse/tests/adapter/operation/test_open.cc b/test/webfuse/tests/adapter/operation/test_open.cc index 9670985..e3d89bc 100644 --- a/test/webfuse/tests/adapter/operation/test_open.cc +++ b/test/webfuse/tests/adapter/operation/test_open.cc @@ -3,13 +3,13 @@ #include "webfuse/core/status.h" #include "webfuse/mocks/mock_fuse.hpp" -#include "webfuse/mocks/mock_operations_context.hpp" +#include "webfuse/mocks/mock_operation_context.hpp" #include "webfuse/mocks/mock_jsonrpc_proxy.hpp" #include using webfuse_test::MockJsonRpcProxy; -using webfuse_test::MockOperationsContext; +using webfuse_test::MockOperationContext; using webfuse_test::FuseMock; using testing::_; using testing::Return; @@ -20,11 +20,11 @@ TEST(wf_impl_operation_open, invoke_proxy) MockJsonRpcProxy proxy; EXPECT_CALL(proxy, wf_jsonrpc_proxy_vinvoke(_,_,_,StrEq("open"),StrEq("sii"))).Times(1); - MockOperationsContext context; - EXPECT_CALL(context, wf_impl_operations_context_get_proxy(_)).Times(1) + MockOperationContext context; + EXPECT_CALL(context, wf_impl_operation_context_get_proxy(_)).Times(1) .WillOnce(Return(reinterpret_cast(&proxy))); - wf_impl_operations_context op_context; + wf_impl_operation_context op_context; op_context.name = nullptr; FuseMock fuse; EXPECT_CALL(fuse, fuse_req_userdata(_)).Times(1).WillOnce(Return(&op_context)); @@ -39,8 +39,8 @@ TEST(wf_impl_operation_open, invoke_proxy) TEST(wf_impl_operation_open, fail_rpc_null) { - MockOperationsContext context; - EXPECT_CALL(context, wf_impl_operations_context_get_proxy(_)).Times(1) + MockOperationContext context; + EXPECT_CALL(context, wf_impl_operation_context_get_proxy(_)).Times(1) .WillOnce(Return(nullptr)); FuseMock fuse; diff --git a/test/webfuse/tests/adapter/operation/test_read.cc b/test/webfuse/tests/adapter/operation/test_read.cc index 934d060..15b9f9c 100644 --- a/test/webfuse/tests/adapter/operation/test_read.cc +++ b/test/webfuse/tests/adapter/operation/test_read.cc @@ -1,13 +1,13 @@ #include "webfuse/adapter/impl/operation/read.h" #include "webfuse/mocks/mock_fuse.hpp" -#include "webfuse/mocks/mock_operations_context.hpp" +#include "webfuse/mocks/mock_operation_context.hpp" #include "webfuse/mocks/mock_jsonrpc_proxy.hpp" #include using webfuse_test::MockJsonRpcProxy; -using webfuse_test::MockOperationsContext; +using webfuse_test::MockOperationContext; using webfuse_test::FuseMock; using testing::_; using testing::Return; @@ -18,11 +18,11 @@ TEST(wf_impl_operation_read, invoke_proxy) MockJsonRpcProxy proxy; EXPECT_CALL(proxy, wf_jsonrpc_proxy_vinvoke(_,_,_,StrEq("read"),StrEq("siiii"))).Times(1); - MockOperationsContext context; - EXPECT_CALL(context, wf_impl_operations_context_get_proxy(_)).Times(1) + MockOperationContext context; + EXPECT_CALL(context, wf_impl_operation_context_get_proxy(_)).Times(1) .WillOnce(Return(reinterpret_cast(&proxy))); - wf_impl_operations_context op_context; + wf_impl_operation_context op_context; op_context.name = nullptr; FuseMock fuse; EXPECT_CALL(fuse, fuse_req_userdata(_)).Times(1).WillOnce(Return(&op_context)); @@ -41,11 +41,11 @@ TEST(wf_impl_operation_read, invoke_proxy_limit_size) MockJsonRpcProxy proxy; EXPECT_CALL(proxy, wf_jsonrpc_proxy_vinvoke(_,_,_,StrEq("read"),StrEq("siiii"))).Times(1); - MockOperationsContext context; - EXPECT_CALL(context, wf_impl_operations_context_get_proxy(_)).Times(1) + MockOperationContext context; + EXPECT_CALL(context, wf_impl_operation_context_get_proxy(_)).Times(1) .WillOnce(Return(reinterpret_cast(&proxy))); - wf_impl_operations_context op_context; + wf_impl_operation_context op_context; op_context.name = nullptr; FuseMock fuse; EXPECT_CALL(fuse, fuse_req_userdata(_)).Times(1).WillOnce(Return(&op_context)); @@ -61,8 +61,8 @@ TEST(wf_impl_operation_read, invoke_proxy_limit_size) TEST(wf_impl_operation_read, fail_rpc_null) { - MockOperationsContext context; - EXPECT_CALL(context, wf_impl_operations_context_get_proxy(_)).Times(1) + MockOperationContext context; + EXPECT_CALL(context, wf_impl_operation_context_get_proxy(_)).Times(1) .WillOnce(Return(nullptr)); FuseMock fuse; diff --git a/test/webfuse/tests/adapter/operation/test_readdir.cc b/test/webfuse/tests/adapter/operation/test_readdir.cc index 2875eca..c020c3d 100644 --- a/test/webfuse/tests/adapter/operation/test_readdir.cc +++ b/test/webfuse/tests/adapter/operation/test_readdir.cc @@ -3,13 +3,13 @@ #include "webfuse/core/status.h" #include "webfuse/mocks/mock_fuse.hpp" -#include "webfuse/mocks/mock_operations_context.hpp" +#include "webfuse/mocks/mock_operation_context.hpp" #include "webfuse/mocks/mock_jsonrpc_proxy.hpp" #include using webfuse_test::MockJsonRpcProxy; -using webfuse_test::MockOperationsContext; +using webfuse_test::MockOperationContext; using webfuse_test::FuseMock; using testing::_; using testing::Return; @@ -37,11 +37,11 @@ TEST(wf_impl_operation_readdir, invoke_proxy) EXPECT_CALL(proxy, wf_jsonrpc_proxy_vinvoke(_,_,_,StrEq("readdir"),StrEq("si"))) .Times(1).WillOnce(Invoke(free_context)); - MockOperationsContext context; - EXPECT_CALL(context, wf_impl_operations_context_get_proxy(_)).Times(1) + MockOperationContext context; + EXPECT_CALL(context, wf_impl_operation_context_get_proxy(_)).Times(1) .WillOnce(Return(reinterpret_cast(&proxy))); - wf_impl_operations_context op_context; + wf_impl_operation_context op_context; op_context.name = nullptr; FuseMock fuse; EXPECT_CALL(fuse, fuse_req_userdata(_)).Times(1).WillOnce(Return(&op_context)); @@ -58,8 +58,8 @@ TEST(wf_impl_operation_readdir, invoke_proxy) TEST(wf_impl_operation_readdir, fail_rpc_null) { - MockOperationsContext context; - EXPECT_CALL(context, wf_impl_operations_context_get_proxy(_)).Times(1) + MockOperationContext context; + EXPECT_CALL(context, wf_impl_operation_context_get_proxy(_)).Times(1) .WillOnce(Return(nullptr)); FuseMock fuse;