OLD | NEW |
1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROMEOS_PLATFORM_UPDATE_ENGINE_MOCK_DBUS_INTERFACE_H__ | 5 #ifndef CHROMEOS_PLATFORM_UPDATE_ENGINE_MOCK_DBUS_INTERFACE_H__ |
6 #define CHROMEOS_PLATFORM_UPDATE_ENGINE_MOCK_DBUS_INTERFACE_H__ | 6 #define CHROMEOS_PLATFORM_UPDATE_ENGINE_MOCK_DBUS_INTERFACE_H__ |
7 | 7 |
8 #include <gmock/gmock.h> | 8 #include <gmock/gmock.h> |
9 | 9 |
10 #include "update_engine/dbus_interface.h" | 10 #include "update_engine/dbus_interface.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 | 23 |
24 MOCK_METHOD2(BusGet, DBusGConnection*(DBusBusType type, GError **error)); | 24 MOCK_METHOD2(BusGet, DBusGConnection*(DBusBusType type, GError **error)); |
25 | 25 |
26 MOCK_METHOD7(ProxyCall, gboolean(DBusGProxy *proxy, | 26 MOCK_METHOD7(ProxyCall, gboolean(DBusGProxy *proxy, |
27 const char *method, | 27 const char *method, |
28 GError **error, | 28 GError **error, |
29 GType first_arg_type, | 29 GType first_arg_type, |
30 GType var_arg1, | 30 GType var_arg1, |
31 GHashTable** var_arg2, | 31 GHashTable** var_arg2, |
32 GType var_arg3)); | 32 GType var_arg3)); |
| 33 MOCK_METHOD10(ProxyCall, gboolean(DBusGProxy* proxy, |
| 34 const char* method, |
| 35 GError** error, |
| 36 GType var_arg1, const char* var_arg2, |
| 37 GType var_arg3, |
| 38 GType var_arg4, gchar** var_arg5, |
| 39 GType var_arg6, GArray** var_arg7)); |
| 40 |
| 41 // Since gmock only supports mocking functions up to 10 args, we |
| 42 // take the 11-arg function we'd like to mock, drop the last arg |
| 43 // and call the 10-arg version. Dropping the last arg isn't ideal, |
| 44 // but this is a lot better than nothing. |
| 45 gboolean ProxyCall(DBusGProxy* proxy, |
| 46 const char* method, |
| 47 GError** error, |
| 48 GType var_arg1, const char* var_arg2, |
| 49 GType var_arg3, |
| 50 GType var_arg4, gchar** var_arg5, |
| 51 GType var_arg6, GArray** var_arg7, |
| 52 GType var_arg8) { |
| 53 return ProxyCall(proxy, |
| 54 method, |
| 55 error, |
| 56 var_arg1, var_arg2, |
| 57 var_arg3, |
| 58 var_arg4, var_arg5, |
| 59 var_arg6, var_arg7); |
| 60 } |
33 }; | 61 }; |
34 | 62 |
35 } // namespace chromeos_update_engine | 63 } // namespace chromeos_update_engine |
36 | 64 |
37 #endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_MOCK_DBUS_INTERFACE_H__ | 65 #endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_MOCK_DBUS_INTERFACE_H__ |
OLD | NEW |