11cb0ef41Sopenharmony_ci// Copyright 2006, Google Inc. 21cb0ef41Sopenharmony_ci// All rights reserved. 31cb0ef41Sopenharmony_ci// 41cb0ef41Sopenharmony_ci// Redistribution and use in source and binary forms, with or without 51cb0ef41Sopenharmony_ci// modification, are permitted provided that the following conditions are 61cb0ef41Sopenharmony_ci// met: 71cb0ef41Sopenharmony_ci// 81cb0ef41Sopenharmony_ci// * Redistributions of source code must retain the above copyright 91cb0ef41Sopenharmony_ci// notice, this list of conditions and the following disclaimer. 101cb0ef41Sopenharmony_ci// * Redistributions in binary form must reproduce the above 111cb0ef41Sopenharmony_ci// copyright notice, this list of conditions and the following disclaimer 121cb0ef41Sopenharmony_ci// in the documentation and/or other materials provided with the 131cb0ef41Sopenharmony_ci// distribution. 141cb0ef41Sopenharmony_ci// * Neither the name of Google Inc. nor the names of its 151cb0ef41Sopenharmony_ci// contributors may be used to endorse or promote products derived from 161cb0ef41Sopenharmony_ci// this software without specific prior written permission. 171cb0ef41Sopenharmony_ci// 181cb0ef41Sopenharmony_ci// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 191cb0ef41Sopenharmony_ci// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 201cb0ef41Sopenharmony_ci// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 211cb0ef41Sopenharmony_ci// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 221cb0ef41Sopenharmony_ci// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 231cb0ef41Sopenharmony_ci// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 241cb0ef41Sopenharmony_ci// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 251cb0ef41Sopenharmony_ci// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 261cb0ef41Sopenharmony_ci// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 271cb0ef41Sopenharmony_ci// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 281cb0ef41Sopenharmony_ci// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 291cb0ef41Sopenharmony_ci// 301cb0ef41Sopenharmony_ci// Implements a family of generic predicate assertion macros. 311cb0ef41Sopenharmony_ci 321cb0ef41Sopenharmony_ci// IWYU pragma: private, include "gtest/gtest.h" 331cb0ef41Sopenharmony_ci// IWYU pragma: friend gtest/.* 341cb0ef41Sopenharmony_ci// IWYU pragma: friend gmock/.* 351cb0ef41Sopenharmony_ci 361cb0ef41Sopenharmony_ci#ifndef GOOGLETEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_ 371cb0ef41Sopenharmony_ci#define GOOGLETEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_ 381cb0ef41Sopenharmony_ci 391cb0ef41Sopenharmony_ci#include "gtest/gtest-assertion-result.h" 401cb0ef41Sopenharmony_ci#include "gtest/internal/gtest-internal.h" 411cb0ef41Sopenharmony_ci#include "gtest/internal/gtest-port.h" 421cb0ef41Sopenharmony_ci 431cb0ef41Sopenharmony_cinamespace testing { 441cb0ef41Sopenharmony_ci 451cb0ef41Sopenharmony_ci// This header implements a family of generic predicate assertion 461cb0ef41Sopenharmony_ci// macros: 471cb0ef41Sopenharmony_ci// 481cb0ef41Sopenharmony_ci// ASSERT_PRED_FORMAT1(pred_format, v1) 491cb0ef41Sopenharmony_ci// ASSERT_PRED_FORMAT2(pred_format, v1, v2) 501cb0ef41Sopenharmony_ci// ... 511cb0ef41Sopenharmony_ci// 521cb0ef41Sopenharmony_ci// where pred_format is a function or functor that takes n (in the 531cb0ef41Sopenharmony_ci// case of ASSERT_PRED_FORMATn) values and their source expression 541cb0ef41Sopenharmony_ci// text, and returns a testing::AssertionResult. See the definition 551cb0ef41Sopenharmony_ci// of ASSERT_EQ in gtest.h for an example. 561cb0ef41Sopenharmony_ci// 571cb0ef41Sopenharmony_ci// If you don't care about formatting, you can use the more 581cb0ef41Sopenharmony_ci// restrictive version: 591cb0ef41Sopenharmony_ci// 601cb0ef41Sopenharmony_ci// ASSERT_PRED1(pred, v1) 611cb0ef41Sopenharmony_ci// ASSERT_PRED2(pred, v1, v2) 621cb0ef41Sopenharmony_ci// ... 631cb0ef41Sopenharmony_ci// 641cb0ef41Sopenharmony_ci// where pred is an n-ary function or functor that returns bool, 651cb0ef41Sopenharmony_ci// and the values v1, v2, ..., must support the << operator for 661cb0ef41Sopenharmony_ci// streaming to std::ostream. 671cb0ef41Sopenharmony_ci// 681cb0ef41Sopenharmony_ci// We also define the EXPECT_* variations. 691cb0ef41Sopenharmony_ci// 701cb0ef41Sopenharmony_ci// For now we only support predicates whose arity is at most 5. 711cb0ef41Sopenharmony_ci// Please email googletestframework@googlegroups.com if you need 721cb0ef41Sopenharmony_ci// support for higher arities. 731cb0ef41Sopenharmony_ci 741cb0ef41Sopenharmony_ci// GTEST_ASSERT_ is the basic statement to which all of the assertions 751cb0ef41Sopenharmony_ci// in this file reduce. Don't use this in your code. 761cb0ef41Sopenharmony_ci 771cb0ef41Sopenharmony_ci#define GTEST_ASSERT_(expression, on_failure) \ 781cb0ef41Sopenharmony_ci GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ 791cb0ef41Sopenharmony_ci if (const ::testing::AssertionResult gtest_ar = (expression)) \ 801cb0ef41Sopenharmony_ci ; \ 811cb0ef41Sopenharmony_ci else \ 821cb0ef41Sopenharmony_ci on_failure(gtest_ar.failure_message()) 831cb0ef41Sopenharmony_ci 841cb0ef41Sopenharmony_ci// Helper function for implementing {EXPECT|ASSERT}_PRED1. Don't use 851cb0ef41Sopenharmony_ci// this in your code. 861cb0ef41Sopenharmony_citemplate <typename Pred, typename T1> 871cb0ef41Sopenharmony_ciAssertionResult AssertPred1Helper(const char* pred_text, const char* e1, 881cb0ef41Sopenharmony_ci Pred pred, const T1& v1) { 891cb0ef41Sopenharmony_ci if (pred(v1)) return AssertionSuccess(); 901cb0ef41Sopenharmony_ci 911cb0ef41Sopenharmony_ci return AssertionFailure() 921cb0ef41Sopenharmony_ci << pred_text << "(" << e1 << ") evaluates to false, where" 931cb0ef41Sopenharmony_ci << "\n" 941cb0ef41Sopenharmony_ci << e1 << " evaluates to " << ::testing::PrintToString(v1); 951cb0ef41Sopenharmony_ci} 961cb0ef41Sopenharmony_ci 971cb0ef41Sopenharmony_ci// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT1. 981cb0ef41Sopenharmony_ci// Don't use this in your code. 991cb0ef41Sopenharmony_ci#define GTEST_PRED_FORMAT1_(pred_format, v1, on_failure) \ 1001cb0ef41Sopenharmony_ci GTEST_ASSERT_(pred_format(#v1, v1), on_failure) 1011cb0ef41Sopenharmony_ci 1021cb0ef41Sopenharmony_ci// Internal macro for implementing {EXPECT|ASSERT}_PRED1. Don't use 1031cb0ef41Sopenharmony_ci// this in your code. 1041cb0ef41Sopenharmony_ci#define GTEST_PRED1_(pred, v1, on_failure) \ 1051cb0ef41Sopenharmony_ci GTEST_ASSERT_(::testing::AssertPred1Helper(#pred, #v1, pred, v1), on_failure) 1061cb0ef41Sopenharmony_ci 1071cb0ef41Sopenharmony_ci// Unary predicate assertion macros. 1081cb0ef41Sopenharmony_ci#define EXPECT_PRED_FORMAT1(pred_format, v1) \ 1091cb0ef41Sopenharmony_ci GTEST_PRED_FORMAT1_(pred_format, v1, GTEST_NONFATAL_FAILURE_) 1101cb0ef41Sopenharmony_ci#define EXPECT_PRED1(pred, v1) GTEST_PRED1_(pred, v1, GTEST_NONFATAL_FAILURE_) 1111cb0ef41Sopenharmony_ci#define ASSERT_PRED_FORMAT1(pred_format, v1) \ 1121cb0ef41Sopenharmony_ci GTEST_PRED_FORMAT1_(pred_format, v1, GTEST_FATAL_FAILURE_) 1131cb0ef41Sopenharmony_ci#define ASSERT_PRED1(pred, v1) GTEST_PRED1_(pred, v1, GTEST_FATAL_FAILURE_) 1141cb0ef41Sopenharmony_ci 1151cb0ef41Sopenharmony_ci// Helper function for implementing {EXPECT|ASSERT}_PRED2. Don't use 1161cb0ef41Sopenharmony_ci// this in your code. 1171cb0ef41Sopenharmony_citemplate <typename Pred, typename T1, typename T2> 1181cb0ef41Sopenharmony_ciAssertionResult AssertPred2Helper(const char* pred_text, const char* e1, 1191cb0ef41Sopenharmony_ci const char* e2, Pred pred, const T1& v1, 1201cb0ef41Sopenharmony_ci const T2& v2) { 1211cb0ef41Sopenharmony_ci if (pred(v1, v2)) return AssertionSuccess(); 1221cb0ef41Sopenharmony_ci 1231cb0ef41Sopenharmony_ci return AssertionFailure() 1241cb0ef41Sopenharmony_ci << pred_text << "(" << e1 << ", " << e2 1251cb0ef41Sopenharmony_ci << ") evaluates to false, where" 1261cb0ef41Sopenharmony_ci << "\n" 1271cb0ef41Sopenharmony_ci << e1 << " evaluates to " << ::testing::PrintToString(v1) << "\n" 1281cb0ef41Sopenharmony_ci << e2 << " evaluates to " << ::testing::PrintToString(v2); 1291cb0ef41Sopenharmony_ci} 1301cb0ef41Sopenharmony_ci 1311cb0ef41Sopenharmony_ci// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT2. 1321cb0ef41Sopenharmony_ci// Don't use this in your code. 1331cb0ef41Sopenharmony_ci#define GTEST_PRED_FORMAT2_(pred_format, v1, v2, on_failure) \ 1341cb0ef41Sopenharmony_ci GTEST_ASSERT_(pred_format(#v1, #v2, v1, v2), on_failure) 1351cb0ef41Sopenharmony_ci 1361cb0ef41Sopenharmony_ci// Internal macro for implementing {EXPECT|ASSERT}_PRED2. Don't use 1371cb0ef41Sopenharmony_ci// this in your code. 1381cb0ef41Sopenharmony_ci#define GTEST_PRED2_(pred, v1, v2, on_failure) \ 1391cb0ef41Sopenharmony_ci GTEST_ASSERT_(::testing::AssertPred2Helper(#pred, #v1, #v2, pred, v1, v2), \ 1401cb0ef41Sopenharmony_ci on_failure) 1411cb0ef41Sopenharmony_ci 1421cb0ef41Sopenharmony_ci// Binary predicate assertion macros. 1431cb0ef41Sopenharmony_ci#define EXPECT_PRED_FORMAT2(pred_format, v1, v2) \ 1441cb0ef41Sopenharmony_ci GTEST_PRED_FORMAT2_(pred_format, v1, v2, GTEST_NONFATAL_FAILURE_) 1451cb0ef41Sopenharmony_ci#define EXPECT_PRED2(pred, v1, v2) \ 1461cb0ef41Sopenharmony_ci GTEST_PRED2_(pred, v1, v2, GTEST_NONFATAL_FAILURE_) 1471cb0ef41Sopenharmony_ci#define ASSERT_PRED_FORMAT2(pred_format, v1, v2) \ 1481cb0ef41Sopenharmony_ci GTEST_PRED_FORMAT2_(pred_format, v1, v2, GTEST_FATAL_FAILURE_) 1491cb0ef41Sopenharmony_ci#define ASSERT_PRED2(pred, v1, v2) \ 1501cb0ef41Sopenharmony_ci GTEST_PRED2_(pred, v1, v2, GTEST_FATAL_FAILURE_) 1511cb0ef41Sopenharmony_ci 1521cb0ef41Sopenharmony_ci// Helper function for implementing {EXPECT|ASSERT}_PRED3. Don't use 1531cb0ef41Sopenharmony_ci// this in your code. 1541cb0ef41Sopenharmony_citemplate <typename Pred, typename T1, typename T2, typename T3> 1551cb0ef41Sopenharmony_ciAssertionResult AssertPred3Helper(const char* pred_text, const char* e1, 1561cb0ef41Sopenharmony_ci const char* e2, const char* e3, Pred pred, 1571cb0ef41Sopenharmony_ci const T1& v1, const T2& v2, const T3& v3) { 1581cb0ef41Sopenharmony_ci if (pred(v1, v2, v3)) return AssertionSuccess(); 1591cb0ef41Sopenharmony_ci 1601cb0ef41Sopenharmony_ci return AssertionFailure() 1611cb0ef41Sopenharmony_ci << pred_text << "(" << e1 << ", " << e2 << ", " << e3 1621cb0ef41Sopenharmony_ci << ") evaluates to false, where" 1631cb0ef41Sopenharmony_ci << "\n" 1641cb0ef41Sopenharmony_ci << e1 << " evaluates to " << ::testing::PrintToString(v1) << "\n" 1651cb0ef41Sopenharmony_ci << e2 << " evaluates to " << ::testing::PrintToString(v2) << "\n" 1661cb0ef41Sopenharmony_ci << e3 << " evaluates to " << ::testing::PrintToString(v3); 1671cb0ef41Sopenharmony_ci} 1681cb0ef41Sopenharmony_ci 1691cb0ef41Sopenharmony_ci// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT3. 1701cb0ef41Sopenharmony_ci// Don't use this in your code. 1711cb0ef41Sopenharmony_ci#define GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, on_failure) \ 1721cb0ef41Sopenharmony_ci GTEST_ASSERT_(pred_format(#v1, #v2, #v3, v1, v2, v3), on_failure) 1731cb0ef41Sopenharmony_ci 1741cb0ef41Sopenharmony_ci// Internal macro for implementing {EXPECT|ASSERT}_PRED3. Don't use 1751cb0ef41Sopenharmony_ci// this in your code. 1761cb0ef41Sopenharmony_ci#define GTEST_PRED3_(pred, v1, v2, v3, on_failure) \ 1771cb0ef41Sopenharmony_ci GTEST_ASSERT_( \ 1781cb0ef41Sopenharmony_ci ::testing::AssertPred3Helper(#pred, #v1, #v2, #v3, pred, v1, v2, v3), \ 1791cb0ef41Sopenharmony_ci on_failure) 1801cb0ef41Sopenharmony_ci 1811cb0ef41Sopenharmony_ci// Ternary predicate assertion macros. 1821cb0ef41Sopenharmony_ci#define EXPECT_PRED_FORMAT3(pred_format, v1, v2, v3) \ 1831cb0ef41Sopenharmony_ci GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, GTEST_NONFATAL_FAILURE_) 1841cb0ef41Sopenharmony_ci#define EXPECT_PRED3(pred, v1, v2, v3) \ 1851cb0ef41Sopenharmony_ci GTEST_PRED3_(pred, v1, v2, v3, GTEST_NONFATAL_FAILURE_) 1861cb0ef41Sopenharmony_ci#define ASSERT_PRED_FORMAT3(pred_format, v1, v2, v3) \ 1871cb0ef41Sopenharmony_ci GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, GTEST_FATAL_FAILURE_) 1881cb0ef41Sopenharmony_ci#define ASSERT_PRED3(pred, v1, v2, v3) \ 1891cb0ef41Sopenharmony_ci GTEST_PRED3_(pred, v1, v2, v3, GTEST_FATAL_FAILURE_) 1901cb0ef41Sopenharmony_ci 1911cb0ef41Sopenharmony_ci// Helper function for implementing {EXPECT|ASSERT}_PRED4. Don't use 1921cb0ef41Sopenharmony_ci// this in your code. 1931cb0ef41Sopenharmony_citemplate <typename Pred, typename T1, typename T2, typename T3, typename T4> 1941cb0ef41Sopenharmony_ciAssertionResult AssertPred4Helper(const char* pred_text, const char* e1, 1951cb0ef41Sopenharmony_ci const char* e2, const char* e3, 1961cb0ef41Sopenharmony_ci const char* e4, Pred pred, const T1& v1, 1971cb0ef41Sopenharmony_ci const T2& v2, const T3& v3, const T4& v4) { 1981cb0ef41Sopenharmony_ci if (pred(v1, v2, v3, v4)) return AssertionSuccess(); 1991cb0ef41Sopenharmony_ci 2001cb0ef41Sopenharmony_ci return AssertionFailure() 2011cb0ef41Sopenharmony_ci << pred_text << "(" << e1 << ", " << e2 << ", " << e3 << ", " << e4 2021cb0ef41Sopenharmony_ci << ") evaluates to false, where" 2031cb0ef41Sopenharmony_ci << "\n" 2041cb0ef41Sopenharmony_ci << e1 << " evaluates to " << ::testing::PrintToString(v1) << "\n" 2051cb0ef41Sopenharmony_ci << e2 << " evaluates to " << ::testing::PrintToString(v2) << "\n" 2061cb0ef41Sopenharmony_ci << e3 << " evaluates to " << ::testing::PrintToString(v3) << "\n" 2071cb0ef41Sopenharmony_ci << e4 << " evaluates to " << ::testing::PrintToString(v4); 2081cb0ef41Sopenharmony_ci} 2091cb0ef41Sopenharmony_ci 2101cb0ef41Sopenharmony_ci// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT4. 2111cb0ef41Sopenharmony_ci// Don't use this in your code. 2121cb0ef41Sopenharmony_ci#define GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, on_failure) \ 2131cb0ef41Sopenharmony_ci GTEST_ASSERT_(pred_format(#v1, #v2, #v3, #v4, v1, v2, v3, v4), on_failure) 2141cb0ef41Sopenharmony_ci 2151cb0ef41Sopenharmony_ci// Internal macro for implementing {EXPECT|ASSERT}_PRED4. Don't use 2161cb0ef41Sopenharmony_ci// this in your code. 2171cb0ef41Sopenharmony_ci#define GTEST_PRED4_(pred, v1, v2, v3, v4, on_failure) \ 2181cb0ef41Sopenharmony_ci GTEST_ASSERT_(::testing::AssertPred4Helper(#pred, #v1, #v2, #v3, #v4, pred, \ 2191cb0ef41Sopenharmony_ci v1, v2, v3, v4), \ 2201cb0ef41Sopenharmony_ci on_failure) 2211cb0ef41Sopenharmony_ci 2221cb0ef41Sopenharmony_ci// 4-ary predicate assertion macros. 2231cb0ef41Sopenharmony_ci#define EXPECT_PRED_FORMAT4(pred_format, v1, v2, v3, v4) \ 2241cb0ef41Sopenharmony_ci GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, GTEST_NONFATAL_FAILURE_) 2251cb0ef41Sopenharmony_ci#define EXPECT_PRED4(pred, v1, v2, v3, v4) \ 2261cb0ef41Sopenharmony_ci GTEST_PRED4_(pred, v1, v2, v3, v4, GTEST_NONFATAL_FAILURE_) 2271cb0ef41Sopenharmony_ci#define ASSERT_PRED_FORMAT4(pred_format, v1, v2, v3, v4) \ 2281cb0ef41Sopenharmony_ci GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, GTEST_FATAL_FAILURE_) 2291cb0ef41Sopenharmony_ci#define ASSERT_PRED4(pred, v1, v2, v3, v4) \ 2301cb0ef41Sopenharmony_ci GTEST_PRED4_(pred, v1, v2, v3, v4, GTEST_FATAL_FAILURE_) 2311cb0ef41Sopenharmony_ci 2321cb0ef41Sopenharmony_ci// Helper function for implementing {EXPECT|ASSERT}_PRED5. Don't use 2331cb0ef41Sopenharmony_ci// this in your code. 2341cb0ef41Sopenharmony_citemplate <typename Pred, typename T1, typename T2, typename T3, typename T4, 2351cb0ef41Sopenharmony_ci typename T5> 2361cb0ef41Sopenharmony_ciAssertionResult AssertPred5Helper(const char* pred_text, const char* e1, 2371cb0ef41Sopenharmony_ci const char* e2, const char* e3, 2381cb0ef41Sopenharmony_ci const char* e4, const char* e5, Pred pred, 2391cb0ef41Sopenharmony_ci const T1& v1, const T2& v2, const T3& v3, 2401cb0ef41Sopenharmony_ci const T4& v4, const T5& v5) { 2411cb0ef41Sopenharmony_ci if (pred(v1, v2, v3, v4, v5)) return AssertionSuccess(); 2421cb0ef41Sopenharmony_ci 2431cb0ef41Sopenharmony_ci return AssertionFailure() 2441cb0ef41Sopenharmony_ci << pred_text << "(" << e1 << ", " << e2 << ", " << e3 << ", " << e4 2451cb0ef41Sopenharmony_ci << ", " << e5 << ") evaluates to false, where" 2461cb0ef41Sopenharmony_ci << "\n" 2471cb0ef41Sopenharmony_ci << e1 << " evaluates to " << ::testing::PrintToString(v1) << "\n" 2481cb0ef41Sopenharmony_ci << e2 << " evaluates to " << ::testing::PrintToString(v2) << "\n" 2491cb0ef41Sopenharmony_ci << e3 << " evaluates to " << ::testing::PrintToString(v3) << "\n" 2501cb0ef41Sopenharmony_ci << e4 << " evaluates to " << ::testing::PrintToString(v4) << "\n" 2511cb0ef41Sopenharmony_ci << e5 << " evaluates to " << ::testing::PrintToString(v5); 2521cb0ef41Sopenharmony_ci} 2531cb0ef41Sopenharmony_ci 2541cb0ef41Sopenharmony_ci// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT5. 2551cb0ef41Sopenharmony_ci// Don't use this in your code. 2561cb0ef41Sopenharmony_ci#define GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, on_failure) \ 2571cb0ef41Sopenharmony_ci GTEST_ASSERT_(pred_format(#v1, #v2, #v3, #v4, #v5, v1, v2, v3, v4, v5), \ 2581cb0ef41Sopenharmony_ci on_failure) 2591cb0ef41Sopenharmony_ci 2601cb0ef41Sopenharmony_ci// Internal macro for implementing {EXPECT|ASSERT}_PRED5. Don't use 2611cb0ef41Sopenharmony_ci// this in your code. 2621cb0ef41Sopenharmony_ci#define GTEST_PRED5_(pred, v1, v2, v3, v4, v5, on_failure) \ 2631cb0ef41Sopenharmony_ci GTEST_ASSERT_(::testing::AssertPred5Helper(#pred, #v1, #v2, #v3, #v4, #v5, \ 2641cb0ef41Sopenharmony_ci pred, v1, v2, v3, v4, v5), \ 2651cb0ef41Sopenharmony_ci on_failure) 2661cb0ef41Sopenharmony_ci 2671cb0ef41Sopenharmony_ci// 5-ary predicate assertion macros. 2681cb0ef41Sopenharmony_ci#define EXPECT_PRED_FORMAT5(pred_format, v1, v2, v3, v4, v5) \ 2691cb0ef41Sopenharmony_ci GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, GTEST_NONFATAL_FAILURE_) 2701cb0ef41Sopenharmony_ci#define EXPECT_PRED5(pred, v1, v2, v3, v4, v5) \ 2711cb0ef41Sopenharmony_ci GTEST_PRED5_(pred, v1, v2, v3, v4, v5, GTEST_NONFATAL_FAILURE_) 2721cb0ef41Sopenharmony_ci#define ASSERT_PRED_FORMAT5(pred_format, v1, v2, v3, v4, v5) \ 2731cb0ef41Sopenharmony_ci GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, GTEST_FATAL_FAILURE_) 2741cb0ef41Sopenharmony_ci#define ASSERT_PRED5(pred, v1, v2, v3, v4, v5) \ 2751cb0ef41Sopenharmony_ci GTEST_PRED5_(pred, v1, v2, v3, v4, v5, GTEST_FATAL_FAILURE_) 2761cb0ef41Sopenharmony_ci 2771cb0ef41Sopenharmony_ci} // namespace testing 2781cb0ef41Sopenharmony_ci 2791cb0ef41Sopenharmony_ci#endif // GOOGLETEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_ 280