David Rochberg | fa1d31d | 2012-03-20 10:38:07 -0400 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium OS Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | #ifndef DBUS_PROPERTY_MATCHERS_H_ |
| 5 | #define DBUS_PROPERTY_MATCHERS_H_ |
| 6 | |
| 7 | #include <gmock/gmock.h> |
| 8 | |
| 9 | #include "shill/dbus_properties.h" |
| 10 | |
| 11 | MATCHER_P2(HasDBusPropertyWithValueU32, key, value, "") { |
| 12 | shill::DBusPropertiesMap::const_iterator it = arg.find(key); |
| 13 | return it != arg.end() && value == it->second.reader().get_uint32(); |
| 14 | } |
| 15 | |
| 16 | MATCHER_P2(HasDBusPropertyWithValueI32, key, value, "") { |
| 17 | shill::DBusPropertiesMap::const_iterator it = arg.find(key); |
| 18 | return it != arg.end() && value == it->second.reader().get_int32(); |
| 19 | } |
| 20 | |
| 21 | #endif // DBUS_PROPERTY_MATCHERS_H_ |