20 #ifndef PAGESPEED_KERNEL_BASE_GTEST_H_
21 #define PAGESPEED_KERNEL_BASE_GTEST_H_
25 #include "testing/gtest/include/gtest/gtest.h"
27 namespace net_instaweb {
38 inline GTEST_API_ AssertionResult CmpHelperSTREQ(
39 const char* expected_expression,
40 const char* actual_expression,
41 const StringPiece& expected,
42 const StringPiece& actual) {
43 return CmpHelperSTREQ(expected_expression, actual_expression,
44 expected.as_string().c_str(),
45 actual.as_string().c_str());
49 inline GTEST_API_ AssertionResult CmpHelperSTRNE(
50 const char* expected_expression,
51 const char* actual_expression,
52 const StringPiece& expected,
53 const StringPiece& actual) {
54 return CmpHelperSTRNE(expected_expression, actual_expression,
55 expected.as_string().c_str(),
56 actual.as_string().c_str());
61 #define EXPECT_HAS_SUBSTR(needle, haystack) \
62 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSUBSTR, needle, haystack)
64 #define EXPECT_HAS_SUBSTR_NE(needle, haystack) \
65 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSUBSTRNE, needle, haystack)
67 template <
typename StringType>
68 inline GTEST_API_ AssertionResult CmpHelperSUBSTR(
69 const char* haystack_expression,
70 const char* needle_expression,
71 const StringType haystack,
72 const StringPiece& needle) {
73 return ::testing::IsSubstring(haystack_expression, needle_expression,
74 haystack, needle.as_string());
77 template <
typename StringType1,
typename StringType2>
78 inline GTEST_API_ AssertionResult CmpHelperSUBSTR(
79 const char* haystack_expression,
80 const char* needle_expression,
81 const StringType1 haystack,
82 const StringType2 needle) {
83 return ::testing::IsSubstring(haystack_expression, needle_expression,
87 template <
typename StringType>
88 inline GTEST_API_ AssertionResult CmpHelperSUBSTRNE(
89 const char* haystack_expression,
90 const char* needle_expression,
91 const StringType haystack,
92 const StringPiece& needle) {
93 return ::testing::IsNotSubstring(haystack_expression, needle_expression,
94 haystack, needle.as_string());
97 template <
typename StringType1,
typename StringType2>
98 inline GTEST_API_ AssertionResult CmpHelperSUBSTRNE(
99 const char* haystack_expression,
100 const char* needle_expression,
101 const StringType1 haystack,
102 const StringType2 needle) {
103 return ::testing::IsNotSubstring(haystack_expression, needle_expression,
std::string GoogleString
PAGESPEED_KERNEL_BASE_STRING_H_.
Definition: string.h:24