1 // Copyright 2022 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 #include "quiche_platform_impl/quiche_test_helpers_impl.h"
6 
7 namespace http2::test {
8 
9 // This is a copy of the same named method in ::testing::internal.
10 // TODO(jamessynge): See about getting something like VERIFY_* adopted by
11 // gUnit (probably a very difficult task!).
GetBoolAssertionFailureMessage(const::testing::AssertionResult & assertion_result,const char * expression_text,const char * actual_predicate_value,const char * expected_predicate_value)12 std::string GetBoolAssertionFailureMessage(
13     const ::testing::AssertionResult& assertion_result,
14     const char* expression_text,
15     const char* actual_predicate_value,
16     const char* expected_predicate_value) {
17   const char* actual_message = assertion_result.message();
18   ::testing::Message msg;
19   msg << "Value of: " << expression_text
20       << "\n  Actual: " << actual_predicate_value;
21   if (actual_message[0] != '\0')
22     msg << " (" << actual_message << ")";
23   msg << "\nExpected: " << expected_predicate_value;
24   return msg.GetString();
25 }
26 
27 }  // namespace http2::test
28