1
0
mirror of https://github.com/falk-werner/webfuse-provider synced 2024-10-27 20:44:10 +00:00

fix: compile error on arm targets

This commit is contained in:
Falk Werner 2020-04-04 12:49:02 +02:00
parent 289264e269
commit bfd4d43dee
5 changed files with 41 additions and 15 deletions

View File

@ -5,19 +5,17 @@ extern "C"
{
static webfuse_test::MockJsonRpcProxy * webfuse_test_MockJsonRpcProxy = nullptr;
WF_WRAP_FUNC6(webfuse_test_MockJsonRpcProxy, void, wf_jsonrpc_proxy_vinvoke,
WF_WRAP_VFUNC5(webfuse_test_MockJsonRpcProxy, void, wf_jsonrpc_proxy_vinvoke,
struct wf_jsonrpc_proxy *,
wf_jsonrpc_proxy_finished_fn *,
void *,
char const *,
char const *,
va_list);
char const *);
WF_WRAP_FUNC4(webfuse_test_MockJsonRpcProxy, void, wf_jsonrpc_proxy_vnotify,
WF_WRAP_VFUNC3(webfuse_test_MockJsonRpcProxy, void, wf_jsonrpc_proxy_vnotify,
struct wf_jsonrpc_proxy *,
char const *,
char const *,
va_list);
char const *);
}
namespace webfuse_test

View File

@ -12,18 +12,16 @@ class MockJsonRpcProxy
public:
MockJsonRpcProxy();
virtual ~MockJsonRpcProxy();
MOCK_METHOD6(wf_jsonrpc_proxy_vinvoke, void (
MOCK_METHOD5(wf_jsonrpc_proxy_vinvoke, void (
struct wf_jsonrpc_proxy * proxy,
wf_jsonrpc_proxy_finished_fn * finished,
void * user_data,
char const * method_name,
char const * param_info,
va_list args));
MOCK_METHOD4(wf_jsonrpc_proxy_vnotify, void (
char const * param_info));
MOCK_METHOD3(wf_jsonrpc_proxy_vnotify, void (
struct wf_jsonrpc_proxy * proxy,
char const * method_name,
char const * param_info,
va_list args));
char const * param_info));
};

View File

@ -17,7 +17,7 @@ using testing::StrEq;
TEST(wf_impl_operation_close, notify_proxy)
{
MockJsonRpcProxy proxy;
EXPECT_CALL(proxy, wf_jsonrpc_proxy_vnotify(_,StrEq("close"),StrEq("siii"),_)).Times(1);
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)
@ -39,7 +39,7 @@ TEST(wf_impl_operation_close, notify_proxy)
TEST(wf_impl_operation_close, fail_rpc_null)
{
MockJsonRpcProxy proxy;
EXPECT_CALL(proxy, wf_jsonrpc_proxy_vnotify(_,_,_,_)).Times(0);
EXPECT_CALL(proxy, wf_jsonrpc_proxy_vnotify(_,_,_)).Times(0);
MockOperationsContext context;
EXPECT_CALL(context, wf_impl_operations_context_get_proxy(_)).Times(1)

View File

@ -19,7 +19,7 @@ using testing::StrEq;
TEST(wf_impl_operation_open, invoke_proxy)
{
MockJsonRpcProxy proxy;
EXPECT_CALL(proxy, wf_jsonrpc_proxy_vinvoke(_,_,_,StrEq("open"),StrEq("sii"),_)).Times(1);
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)

View File

@ -99,4 +99,34 @@
} \
}
#define WF_WRAP_VFUNC3( GLOBAL_VAR, RETURN_TYPE, FUNC_NAME, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE ) \
extern RETURN_TYPE __real_ ## FUNC_NAME (ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, va_list); \
RETURN_TYPE __wrap_ ## FUNC_NAME (ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, va_list args) \
{ \
if (nullptr == GLOBAL_VAR ) \
{ \
return __real_ ## FUNC_NAME (arg1, arg2, arg3, args); \
} \
else \
{ \
return GLOBAL_VAR -> FUNC_NAME(arg1, arg2, arg3); \
} \
}
#define WF_WRAP_VFUNC5( GLOBAL_VAR, RETURN_TYPE, FUNC_NAME, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE ) \
extern RETURN_TYPE __real_ ## FUNC_NAME (ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, va_list); \
RETURN_TYPE __wrap_ ## FUNC_NAME (ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, va_list args) \
{ \
if (nullptr == GLOBAL_VAR ) \
{ \
return __real_ ## FUNC_NAME (arg1, arg2, arg3, arg4, arg5, args); \
} \
else \
{ \
return GLOBAL_VAR -> FUNC_NAME(arg1, arg2, arg3, arg4, arg5); \
} \
}
#endif