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. |
Ben Chan | c45688b | 2014-07-02 23:50:45 -0700 | [diff] [blame] | 4 | |
| 5 | #ifndef SHILL_DBUS_PROPERTY_MATCHERS_H_ |
| 6 | #define SHILL_DBUS_PROPERTY_MATCHERS_H_ |
David Rochberg | fa1d31d | 2012-03-20 10:38:07 -0400 | [diff] [blame] | 7 | |
| 8 | #include <gmock/gmock.h> |
| 9 | |
| 10 | #include "shill/dbus_properties.h" |
| 11 | |
| 12 | MATCHER_P2(HasDBusPropertyWithValueU32, key, value, "") { |
| 13 | shill::DBusPropertiesMap::const_iterator it = arg.find(key); |
| 14 | return it != arg.end() && value == it->second.reader().get_uint32(); |
| 15 | } |
| 16 | |
| 17 | MATCHER_P2(HasDBusPropertyWithValueI32, key, value, "") { |
| 18 | shill::DBusPropertiesMap::const_iterator it = arg.find(key); |
| 19 | return it != arg.end() && value == it->second.reader().get_int32(); |
| 20 | } |
| 21 | |
Ben Chan | c45688b | 2014-07-02 23:50:45 -0700 | [diff] [blame] | 22 | #endif // SHILL_DBUS_PROPERTY_MATCHERS_H_ |