Daniel Cheng | 178560f | 2024-01-22 19:30:38 | [diff] [blame] | 1 | // Copyright 2024 The Chromium Authors |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef BASE_TEST_FIDL_MATCHERS_H_ |
| 6 | #define BASE_TEST_FIDL_MATCHERS_H_ |
| 7 | |
| 8 | #include <lib/fidl/cpp/comparison.h> |
| 9 | |
| 10 | #include "testing/gmock/include/gmock/gmock-matchers.h" |
| 11 | |
| 12 | namespace base::test { |
| 13 | |
| 14 | // Matcher that verifies a fidl struct is equal to the expected fidl struct. |
| 15 | MATCHER_P(FidlEq, |
| 16 | expected, |
| 17 | "Matches if the expected fidl struct is equal to the argument per " |
| 18 | "fidl::Equals().") { |
| 19 | return fidl::Equals(arg, expected); |
| 20 | } |
| 21 | |
| 22 | } // namespace base::test |
| 23 | |
Lei Zhang | c6e08e5 | 2024-05-29 01:14:54 | [diff] [blame] | 24 | #endif // BASE_TEST_FIDL_MATCHERS_H_ |