| 39 | |
| 40 | template <typename T> |
| 41 | void ExpectResult(const T& test_case) { |
| 42 | auto result = test_case.op(); |
| 43 | ASSERT_EQ(result.status().code(), test_case.result.status().code()); |
| 44 | if (result.ok()) { |
| 45 | EXPECT_EQ(*result, *test_case.result); |
| 46 | } else { |
| 47 | EXPECT_THAT(result.status().message(), |
| 48 | HasSubstr(test_case.result.status().message())); |
| 49 | } |
| 50 | } |
| 51 | |
| 52 | using IntTestCase = TestCase<int64_t>; |
| 53 | using CheckedIntResultTest = testing::TestWithParam<IntTestCase>; |