#include "mock/mock_hook.h"
#include "mock/test_fixture.h"
-extern "C" wl_display* wl_display_connect(const char *name) {
+extern "C" struct wl_display* wl_display_connect(const char *name) {
return MOCK_HOOK_P1(WaylandMock, wl_display_connect, name);
}
-extern "C" void wl_display_disconnect(wl_display* display) {
+extern "C" void wl_display_disconnect(struct wl_display* display) {
MOCK_HOOK_P1(WaylandMock, wl_display_disconnect, display);
}
-extern "C" wl_proxy* wl_proxy_marshal_constructor(wl_proxy* proxy, uint32_t opcode,
- const wl_interface* interface, ...) {
+extern "C" wl_proxy* wl_proxy_marshal_constructor(struct wl_proxy* proxy,
+ uint32_t opcode, const struct wl_interface* interface, ...) {
static int dummy;
- return (wl_proxy*)&dummy;
+ return (struct wl_proxy*)&dummy;
}
-extern "C" int wl_proxy_add_listener(wl_proxy *proxy,
+extern "C" int wl_proxy_add_listener(struct wl_proxy *proxy,
void (**implementation)(void), void *data) {
return MOCK_HOOK_P3(WaylandMock, wl_proxy_add_listener, proxy,
implementation, data);
}
-extern "C" int wl_display_roundtrip(wl_display* display) {
+extern "C" int wl_display_roundtrip(struct wl_display* display) {
return MOCK_HOOK_P1(WaylandMock, wl_display_roundtrip, display);
}
-extern "C" void wl_proxy_marshal(wl_proxy *proxy, uint32_t opcode, ...) {
+extern "C" void wl_proxy_marshal(struct wl_proxy *proxy, uint32_t opcode, ...) {
}
-extern "C" void wl_proxy_destroy(wl_proxy *proxy) {
+extern "C" void wl_proxy_destroy(struct wl_proxy *proxy) {
+}
+
+extern "C" struct wl_proxy* wl_proxy_marshal_flags(struct wl_proxy* proxy,
+ uint32_t opcode, const struct wl_interface* interface, uint32_t version,
+ uint32_t flags, ...) {
+ static int dummy;
+ return (struct wl_proxy*)&dummy;
+}
+
+extern "C" uint32_t wl_proxy_get_version(struct wl_proxy* proxy) {
+ return 7;
}
#define UNIT_TESTS_MOCK_WAYLAND_MOCK_H_
#include <gmock/gmock.h>
-#include <wayland-client.h>
-#include <wayland-tbm-client.h>
-#include <tizen-extension-client-protocol.h>
#include "mock/module_mock.h"
using ::testing::Invoke;
ON_CALL(*this, wl_display_connect(_))
- .WillByDefault(Invoke([&](const char*) -> wl_display* {
- static int dummy;
- return (wl_display*)&dummy;
- }));
+ .WillByDefault(Invoke([&](const char*) -> struct wl_display* {
+ static int dummy;
+ return (wl_display*)&dummy;
+ }));
+ ON_CALL(*this, wl_proxy_add_listener(_, _, _))
+ .WillByDefault(Invoke([&](
+ struct wl_proxy*, void (**)(void), void*) -> int {
+ return 0;
+ }));
}
- MOCK_METHOD1(wl_display_connect, wl_display* (const char*));
- MOCK_METHOD1(wl_display_disconnect, void (wl_display*));
- MOCK_METHOD3(wl_proxy_add_listener, int (wl_proxy*, void (**)(void), void*));
- MOCK_METHOD1(wl_display_roundtrip, int (wl_display*));
+ MOCK_METHOD1(wl_display_connect, struct wl_display* (const char*));
+ MOCK_METHOD1(wl_display_disconnect, void (struct wl_display*));
+ MOCK_METHOD3(wl_proxy_add_listener,
+ int (struct wl_proxy*, void (**)(void), void*));
+ MOCK_METHOD1(wl_display_roundtrip, int (struct wl_display*));
};
#endif // UNIT_TESTS_MOCK_WAYLAND_MOCK_H_