Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
yangql
googletest
Commits
2d1835b0
Commit
2d1835b0
authored
Sep 27, 2010
by
zhanyong.wan
Browse files
Removes uses of deprecated AssertionFailure() API (by Vlad Losev).
parent
b5d3a178
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
82 additions
and
115 deletions
+82
-115
include/gtest/gtest.h
include/gtest/gtest.h
+2
-3
include/gtest/gtest_pred_impl.h
include/gtest/gtest_pred_impl.h
+36
-46
scripts/gen_gtest_pred_impl.py
scripts/gen_gtest_pred_impl.py
+5
-8
src/gtest.cc
src/gtest.cc
+28
-42
test/gtest_pred_impl_unittest.cc
test/gtest_pred_impl_unittest.cc
+11
-16
No files found.
include/gtest/gtest.h
View file @
2d1835b0
...
@@ -1385,11 +1385,10 @@ AssertionResult CmpHelper##op_name(const char* expr1, const char* expr2, \
...
@@ -1385,11 +1385,10 @@ AssertionResult CmpHelper##op_name(const char* expr1, const char* expr2, \
if (val1 op val2) {\
if (val1 op val2) {\
return AssertionSuccess();\
return AssertionSuccess();\
} else {\
} else {\
Message msg;
\
return AssertionFailure()
\
msg
<< "Expected: (" << expr1 << ") " #op " (" << expr2\
<< "Expected: (" << expr1 << ") " #op " (" << expr2\
<< "), actual: " << FormatForComparisonFailureMessage(val1, val2)\
<< "), actual: " << FormatForComparisonFailureMessage(val1, val2)\
<< " vs " << FormatForComparisonFailureMessage(val2, val1);\
<< " vs " << FormatForComparisonFailureMessage(val2, val1);\
return AssertionFailure(msg);\
}\
}\
}\
}\
GTEST_API_ AssertionResult CmpHelper##op_name(\
GTEST_API_ AssertionResult CmpHelper##op_name(\
...
...
include/gtest/gtest_pred_impl.h
View file @
2d1835b0
...
@@ -27,7 +27,7 @@
...
@@ -27,7 +27,7 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// This file is AUTOMATICALLY GENERATED on
10/02
/200
8
by command
// This file is AUTOMATICALLY GENERATED on
09/24
/20
1
0 by command
// 'gen_gtest_pred_impl.py 5'. DO NOT EDIT BY HAND!
// 'gen_gtest_pred_impl.py 5'. DO NOT EDIT BY HAND!
//
//
// Implements a family of generic predicate assertion macros.
// Implements a family of generic predicate assertion macros.
...
@@ -90,11 +90,9 @@ AssertionResult AssertPred1Helper(const char* pred_text,
...
@@ -90,11 +90,9 @@ AssertionResult AssertPred1Helper(const char* pred_text,
const
T1
&
v1
)
{
const
T1
&
v1
)
{
if
(
pred
(
v1
))
return
AssertionSuccess
();
if
(
pred
(
v1
))
return
AssertionSuccess
();
Message
msg
;
return
AssertionFailure
()
<<
pred_text
<<
"("
msg
<<
pred_text
<<
"("
<<
e1
<<
") evaluates to false, where"
<<
e1
<<
") evaluates to false, where"
<<
"
\n
"
<<
e1
<<
" evaluates to "
<<
v1
;
<<
"
\n
"
<<
e1
<<
" evaluates to "
<<
v1
;
return
AssertionFailure
(
msg
);
}
}
// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT1.
// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT1.
...
@@ -136,13 +134,11 @@ AssertionResult AssertPred2Helper(const char* pred_text,
...
@@ -136,13 +134,11 @@ AssertionResult AssertPred2Helper(const char* pred_text,
const
T2
&
v2
)
{
const
T2
&
v2
)
{
if
(
pred
(
v1
,
v2
))
return
AssertionSuccess
();
if
(
pred
(
v1
,
v2
))
return
AssertionSuccess
();
Message
msg
;
return
AssertionFailure
()
<<
pred_text
<<
"("
msg
<<
pred_text
<<
"("
<<
e1
<<
", "
<<
e1
<<
", "
<<
e2
<<
") evaluates to false, where"
<<
e2
<<
") evaluates to false, where"
<<
"
\n
"
<<
e1
<<
" evaluates to "
<<
v1
<<
"
\n
"
<<
e1
<<
" evaluates to "
<<
v1
<<
"
\n
"
<<
e2
<<
" evaluates to "
<<
v2
;
<<
"
\n
"
<<
e2
<<
" evaluates to "
<<
v2
;
return
AssertionFailure
(
msg
);
}
}
// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT2.
// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT2.
...
@@ -189,15 +185,13 @@ AssertionResult AssertPred3Helper(const char* pred_text,
...
@@ -189,15 +185,13 @@ AssertionResult AssertPred3Helper(const char* pred_text,
const
T3
&
v3
)
{
const
T3
&
v3
)
{
if
(
pred
(
v1
,
v2
,
v3
))
return
AssertionSuccess
();
if
(
pred
(
v1
,
v2
,
v3
))
return
AssertionSuccess
();
Message
msg
;
return
AssertionFailure
()
<<
pred_text
<<
"("
msg
<<
pred_text
<<
"("
<<
e1
<<
", "
<<
e1
<<
", "
<<
e2
<<
", "
<<
e2
<<
", "
<<
e3
<<
") evaluates to false, where"
<<
e3
<<
") evaluates to false, where"
<<
"
\n
"
<<
e1
<<
" evaluates to "
<<
v1
<<
"
\n
"
<<
e1
<<
" evaluates to "
<<
v1
<<
"
\n
"
<<
e2
<<
" evaluates to "
<<
v2
<<
"
\n
"
<<
e2
<<
" evaluates to "
<<
v2
<<
"
\n
"
<<
e3
<<
" evaluates to "
<<
v3
;
<<
"
\n
"
<<
e3
<<
" evaluates to "
<<
v3
;
return
AssertionFailure
(
msg
);
}
}
// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT3.
// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT3.
...
@@ -249,17 +243,15 @@ AssertionResult AssertPred4Helper(const char* pred_text,
...
@@ -249,17 +243,15 @@ AssertionResult AssertPred4Helper(const char* pred_text,
const
T4
&
v4
)
{
const
T4
&
v4
)
{
if
(
pred
(
v1
,
v2
,
v3
,
v4
))
return
AssertionSuccess
();
if
(
pred
(
v1
,
v2
,
v3
,
v4
))
return
AssertionSuccess
();
Message
msg
;
return
AssertionFailure
()
<<
pred_text
<<
"("
msg
<<
pred_text
<<
"("
<<
e1
<<
", "
<<
e1
<<
", "
<<
e2
<<
", "
<<
e2
<<
", "
<<
e3
<<
", "
<<
e3
<<
", "
<<
e4
<<
") evaluates to false, where"
<<
e4
<<
") evaluates to false, where"
<<
"
\n
"
<<
e1
<<
" evaluates to "
<<
v1
<<
"
\n
"
<<
e1
<<
" evaluates to "
<<
v1
<<
"
\n
"
<<
e2
<<
" evaluates to "
<<
v2
<<
"
\n
"
<<
e2
<<
" evaluates to "
<<
v2
<<
"
\n
"
<<
e3
<<
" evaluates to "
<<
v3
<<
"
\n
"
<<
e3
<<
" evaluates to "
<<
v3
<<
"
\n
"
<<
e4
<<
" evaluates to "
<<
v4
;
<<
"
\n
"
<<
e4
<<
" evaluates to "
<<
v4
;
return
AssertionFailure
(
msg
);
}
}
// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT4.
// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT4.
...
@@ -316,19 +308,17 @@ AssertionResult AssertPred5Helper(const char* pred_text,
...
@@ -316,19 +308,17 @@ AssertionResult AssertPred5Helper(const char* pred_text,
const
T5
&
v5
)
{
const
T5
&
v5
)
{
if
(
pred
(
v1
,
v2
,
v3
,
v4
,
v5
))
return
AssertionSuccess
();
if
(
pred
(
v1
,
v2
,
v3
,
v4
,
v5
))
return
AssertionSuccess
();
Message
msg
;
return
AssertionFailure
()
<<
pred_text
<<
"("
msg
<<
pred_text
<<
"("
<<
e1
<<
", "
<<
e1
<<
", "
<<
e2
<<
", "
<<
e2
<<
", "
<<
e3
<<
", "
<<
e3
<<
", "
<<
e4
<<
", "
<<
e4
<<
", "
<<
e5
<<
") evaluates to false, where"
<<
e5
<<
") evaluates to false, where"
<<
"
\n
"
<<
e1
<<
" evaluates to "
<<
v1
<<
"
\n
"
<<
e1
<<
" evaluates to "
<<
v1
<<
"
\n
"
<<
e2
<<
" evaluates to "
<<
v2
<<
"
\n
"
<<
e2
<<
" evaluates to "
<<
v2
<<
"
\n
"
<<
e3
<<
" evaluates to "
<<
v3
<<
"
\n
"
<<
e3
<<
" evaluates to "
<<
v3
<<
"
\n
"
<<
e4
<<
" evaluates to "
<<
v4
<<
"
\n
"
<<
e4
<<
" evaluates to "
<<
v4
<<
"
\n
"
<<
e5
<<
" evaluates to "
<<
v5
;
<<
"
\n
"
<<
e5
<<
" evaluates to "
<<
v5
;
return
AssertionFailure
(
msg
);
}
}
// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT5.
// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT5.
...
...
scripts/gen_gtest_pred_impl.py
View file @
2d1835b0
...
@@ -238,21 +238,19 @@ AssertionResult AssertPred%(n)sHelper(const char* pred_text""" % DEFS
...
@@ -238,21 +238,19 @@ AssertionResult AssertPred%(n)sHelper(const char* pred_text""" % DEFS
impl
+=
""") {
impl
+=
""") {
if (pred(%(vs)s)) return AssertionSuccess();
if (pred(%(vs)s)) return AssertionSuccess();
Message msg;
"""
%
DEFS
"""
%
DEFS
impl
+=
'
msg
<< pred_text << "("'
impl
+=
'
return AssertionFailure()
<< pred_text << "("'
impl
+=
Iter
(
n
,
"""
impl
+=
Iter
(
n
,
"""
<< e%s"""
,
sep
=
' << ", "'
)
<< e%s"""
,
sep
=
' << ", "'
)
impl
+=
' << ") evaluates to false, where"'
impl
+=
' << ") evaluates to false, where"'
impl
+=
Iter
(
n
,
"""
impl
+=
Iter
(
n
,
"""
<< "
\\
n" << e%s << " evaluates to " << v%s"""
)
<< "
\\
n" << e%s << " evaluates to " << v%s"""
)
impl
+=
""";
impl
+=
""";
return AssertionFailure(msg);
}
}
// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT%(n)s.
// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT%(n)s.
...
@@ -478,15 +476,14 @@ testing::AssertionResult PredFormatFunction%(n)s(""" % DEFS
...
@@ -478,15 +476,14 @@ testing::AssertionResult PredFormatFunction%(n)s(""" % DEFS
if (PredFunction%(n)s(%(vs)s))
if (PredFunction%(n)s(%(vs)s))
return testing::AssertionSuccess();
return testing::AssertionSuccess();
testing::
Message msg;
return
testing::
AssertionFailure()
msg
<< """
%
DEFS
<< """
%
DEFS
tests
+=
Iter
(
n
,
'e%s'
,
sep
=
' << " + " << '
)
tests
+=
Iter
(
n
,
'e%s'
,
sep
=
' << " + " << '
)
tests
+=
"""
tests
+=
"""
<< " is expected to be positive, but evaluates to "
<< " is expected to be positive, but evaluates to "
<< %(v_sum)s << ".";
<< %(v_sum)s << ".";
return testing::AssertionFailure(msg);
}
}
"""
%
DEFS
"""
%
DEFS
...
...
src/gtest.cc
View file @
2d1835b0
...
@@ -618,23 +618,21 @@ AssertionResult HasOneFailure(const char* /* results_expr */,
...
@@ -618,23 +618,21 @@ AssertionResult HasOneFailure(const char* /* results_expr */,
for
(
int
i
=
0
;
i
<
results
.
size
();
i
++
)
{
for
(
int
i
=
0
;
i
<
results
.
size
();
i
++
)
{
msg
<<
"
\n
"
<<
results
.
GetTestPartResult
(
i
);
msg
<<
"
\n
"
<<
results
.
GetTestPartResult
(
i
);
}
}
return
AssertionFailure
(
msg
)
;
return
AssertionFailure
(
)
<<
msg
;
}
}
const
TestPartResult
&
r
=
results
.
GetTestPartResult
(
0
);
const
TestPartResult
&
r
=
results
.
GetTestPartResult
(
0
);
if
(
r
.
type
()
!=
type
)
{
if
(
r
.
type
()
!=
type
)
{
msg
<<
"Expected: "
<<
expected
<<
"
\n
"
return
AssertionFailure
()
<<
"Expected: "
<<
expected
<<
"
\n
"
<<
" Actual:
\n
"
<<
" Actual:
\n
"
<<
r
;
<<
r
;
return
AssertionFailure
(
msg
);
}
}
if
(
strstr
(
r
.
message
(),
substr
.
c_str
())
==
NULL
)
{
if
(
strstr
(
r
.
message
(),
substr
.
c_str
())
==
NULL
)
{
msg
<<
"Expected: "
<<
expected
<<
" containing
\"
"
return
AssertionFailure
()
<<
"Expected: "
<<
expected
<<
" containing
\"
"
<<
substr
<<
"
\"\n
"
<<
substr
<<
"
\"\n
"
<<
" Actual:
\n
"
<<
" Actual:
\n
"
<<
r
;
<<
r
;
return
AssertionFailure
(
msg
);
}
}
return
AssertionSuccess
();
return
AssertionSuccess
();
...
@@ -1011,7 +1009,7 @@ AssertionResult EqFailure(const char* expected_expression,
...
@@ -1011,7 +1009,7 @@ AssertionResult EqFailure(const char* expected_expression,
msg
<<
"
\n
Which is: "
<<
expected_value
;
msg
<<
"
\n
Which is: "
<<
expected_value
;
}
}
return
AssertionFailure
(
msg
)
;
return
AssertionFailure
(
)
<<
msg
;
}
}
// Constructs a failure message for Boolean assertions such as EXPECT_TRUE.
// Constructs a failure message for Boolean assertions such as EXPECT_TRUE.
...
@@ -1041,13 +1039,12 @@ AssertionResult DoubleNearPredFormat(const char* expr1,
...
@@ -1041,13 +1039,12 @@ AssertionResult DoubleNearPredFormat(const char* expr1,
// TODO(wan): do not print the value of an expression if it's
// TODO(wan): do not print the value of an expression if it's
// already a literal.
// already a literal.
Message
msg
;
return
AssertionFailure
()
msg
<<
"The difference between "
<<
expr1
<<
" and "
<<
expr2
<<
"The difference between "
<<
expr1
<<
" and "
<<
expr2
<<
" is "
<<
diff
<<
", which exceeds "
<<
abs_error_expr
<<
", where
\n
"
<<
" is "
<<
diff
<<
", which exceeds "
<<
abs_error_expr
<<
", where
\n
"
<<
expr1
<<
" evaluates to "
<<
val1
<<
",
\n
"
<<
expr1
<<
" evaluates to "
<<
val1
<<
",
\n
"
<<
expr2
<<
" evaluates to "
<<
val2
<<
", and
\n
"
<<
expr2
<<
" evaluates to "
<<
val2
<<
", and
\n
"
<<
abs_error_expr
<<
" evaluates to "
<<
abs_error
<<
"."
;
<<
abs_error_expr
<<
" evaluates to "
<<
abs_error
<<
"."
;
return
AssertionFailure
(
msg
);
}
}
...
@@ -1080,12 +1077,10 @@ AssertionResult FloatingPointLE(const char* expr1,
...
@@ -1080,12 +1077,10 @@ AssertionResult FloatingPointLE(const char* expr1,
val2_ss
<<
std
::
setprecision
(
std
::
numeric_limits
<
RawType
>::
digits10
+
2
)
val2_ss
<<
std
::
setprecision
(
std
::
numeric_limits
<
RawType
>::
digits10
+
2
)
<<
val2
;
<<
val2
;
Message
msg
;
return
AssertionFailure
()
msg
<<
"Expected: ("
<<
expr1
<<
") <= ("
<<
expr2
<<
")
\n
"
<<
"Expected: ("
<<
expr1
<<
") <= ("
<<
expr2
<<
")
\n
"
<<
" Actual: "
<<
StringStreamToString
(
&
val1_ss
)
<<
" vs "
<<
" Actual: "
<<
StringStreamToString
(
&
val1_ss
)
<<
" vs "
<<
StringStreamToString
(
&
val2_ss
);
<<
StringStreamToString
(
&
val2_ss
);
return
AssertionFailure
(
msg
);
}
}
}
// namespace internal
}
// namespace internal
...
@@ -1132,11 +1127,10 @@ AssertionResult CmpHelper##op_name(const char* expr1, const char* expr2, \
...
@@ -1132,11 +1127,10 @@ AssertionResult CmpHelper##op_name(const char* expr1, const char* expr2, \
if (val1 op val2) {\
if (val1 op val2) {\
return AssertionSuccess();\
return AssertionSuccess();\
} else {\
} else {\
Message msg;
\
return AssertionFailure()
\
msg
<< "Expected: (" << expr1 << ") " #op " (" << expr2\
<< "Expected: (" << expr1 << ") " #op " (" << expr2\
<< "), actual: " << FormatForComparisonFailureMessage(val1, val2)\
<< "), actual: " << FormatForComparisonFailureMessage(val1, val2)\
<< " vs " << FormatForComparisonFailureMessage(val2, val1);\
<< " vs " << FormatForComparisonFailureMessage(val2, val1);\
return AssertionFailure(msg);\
}\
}\
}
}
...
@@ -1198,11 +1192,9 @@ AssertionResult CmpHelperSTRNE(const char* s1_expression,
...
@@ -1198,11 +1192,9 @@ AssertionResult CmpHelperSTRNE(const char* s1_expression,
if
(
!
String
::
CStringEquals
(
s1
,
s2
))
{
if
(
!
String
::
CStringEquals
(
s1
,
s2
))
{
return
AssertionSuccess
();
return
AssertionSuccess
();
}
else
{
}
else
{
Message
msg
;
return
AssertionFailure
()
<<
"Expected: ("
<<
s1_expression
<<
") != ("
msg
<<
"Expected: ("
<<
s1_expression
<<
") != ("
<<
s2_expression
<<
"), actual:
\"
"
<<
s2_expression
<<
"), actual:
\"
"
<<
s1
<<
"
\"
vs
\"
"
<<
s2
<<
"
\"
"
;
<<
s1
<<
"
\"
vs
\"
"
<<
s2
<<
"
\"
"
;
return
AssertionFailure
(
msg
);
}
}
}
}
...
@@ -1214,11 +1206,10 @@ AssertionResult CmpHelperSTRCASENE(const char* s1_expression,
...
@@ -1214,11 +1206,10 @@ AssertionResult CmpHelperSTRCASENE(const char* s1_expression,
if
(
!
String
::
CaseInsensitiveCStringEquals
(
s1
,
s2
))
{
if
(
!
String
::
CaseInsensitiveCStringEquals
(
s1
,
s2
))
{
return
AssertionSuccess
();
return
AssertionSuccess
();
}
else
{
}
else
{
Message
msg
;
return
AssertionFailure
()
msg
<<
"Expected: ("
<<
s1_expression
<<
") != ("
<<
"Expected: ("
<<
s1_expression
<<
") != ("
<<
s2_expression
<<
") (ignoring case), actual:
\"
"
<<
s2_expression
<<
") (ignoring case), actual:
\"
"
<<
s1
<<
"
\"
vs
\"
"
<<
s2
<<
"
\"
"
;
<<
s1
<<
"
\"
vs
\"
"
<<
s2
<<
"
\"
"
;
return
AssertionFailure
(
msg
);
}
}
}
}
...
@@ -1267,13 +1258,12 @@ AssertionResult IsSubstringImpl(
...
@@ -1267,13 +1258,12 @@ AssertionResult IsSubstringImpl(
const
bool
is_wide_string
=
sizeof
(
needle
[
0
])
>
1
;
const
bool
is_wide_string
=
sizeof
(
needle
[
0
])
>
1
;
const
char
*
const
begin_string_quote
=
is_wide_string
?
"L
\"
"
:
"
\"
"
;
const
char
*
const
begin_string_quote
=
is_wide_string
?
"L
\"
"
:
"
\"
"
;
return
AssertionFailure
(
return
AssertionFailure
()
Message
()
<<
"Value of: "
<<
needle_expr
<<
"
\n
"
<<
"Value of: "
<<
needle_expr
<<
"
\n
"
<<
" Actual: "
<<
begin_string_quote
<<
needle
<<
"
\"\n
"
<<
" Actual: "
<<
begin_string_quote
<<
needle
<<
"
\"\n
"
<<
"Expected: "
<<
(
expected_to_be_substring
?
""
:
"not "
)
<<
"Expected: "
<<
(
expected_to_be_substring
?
""
:
"not "
)
<<
"a substring of "
<<
haystack_expr
<<
"
\n
"
<<
"a substring of "
<<
haystack_expr
<<
"
\n
"
<<
"Which is: "
<<
begin_string_quote
<<
haystack
<<
"
\"
"
)
;
<<
"Which is: "
<<
begin_string_quote
<<
haystack
<<
"
\"
"
;
}
}
}
// namespace
}
// namespace
...
@@ -1369,11 +1359,9 @@ AssertionResult HRESULTFailureHelper(const char* expr,
...
@@ -1369,11 +1359,9 @@ AssertionResult HRESULTFailureHelper(const char* expr,
#endif // GTEST_OS_WINDOWS_MOBILE
#endif // GTEST_OS_WINDOWS_MOBILE
const
String
error_hex
(
String
::
Format
(
"0x%08X "
,
hr
));
const
String
error_hex
(
String
::
Format
(
"0x%08X "
,
hr
));
Message
msg
;
return
::
testing
::
AssertionFailure
()
msg
<<
"Expected: "
<<
expr
<<
" "
<<
expected
<<
".
\n
"
<<
"Expected: "
<<
expr
<<
" "
<<
expected
<<
".
\n
"
<<
" Actual: "
<<
error_hex
<<
error_text
<<
"
\n
"
;
<<
" Actual: "
<<
error_hex
<<
error_text
<<
"
\n
"
;
return
::
testing
::
AssertionFailure
(
msg
);
}
}
}
// namespace
}
// namespace
...
@@ -1584,12 +1572,10 @@ AssertionResult CmpHelperSTRNE(const char* s1_expression,
...
@@ -1584,12 +1572,10 @@ AssertionResult CmpHelperSTRNE(const char* s1_expression,
return
AssertionSuccess
();
return
AssertionSuccess
();
}
}
Message
msg
;
return
AssertionFailure
()
<<
"Expected: ("
<<
s1_expression
<<
") != ("
msg
<<
"Expected: ("
<<
s1_expression
<<
") != ("
<<
s2_expression
<<
"), actual: "
<<
s2_expression
<<
"), actual: "
<<
String
::
ShowWideCStringQuoted
(
s1
)
<<
String
::
ShowWideCStringQuoted
(
s1
)
<<
" vs "
<<
String
::
ShowWideCStringQuoted
(
s2
);
<<
" vs "
<<
String
::
ShowWideCStringQuoted
(
s2
);
return
AssertionFailure
(
msg
);
}
}
// Compares two C strings, ignoring case. Returns true iff they have
// Compares two C strings, ignoring case. Returns true iff they have
...
...
test/gtest_pred_impl_unittest.cc
View file @
2d1835b0
...
@@ -27,7 +27,7 @@
...
@@ -27,7 +27,7 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// This file is AUTOMATICALLY GENERATED on
10/02
/200
8
by command
// This file is AUTOMATICALLY GENERATED on
09/24
/20
1
0 by command
// 'gen_gtest_pred_impl.py 5'. DO NOT EDIT BY HAND!
// 'gen_gtest_pred_impl.py 5'. DO NOT EDIT BY HAND!
// Regression test for gtest_pred_impl.h
// Regression test for gtest_pred_impl.h
...
@@ -103,11 +103,10 @@ testing::AssertionResult PredFormatFunction1(const char* e1,
...
@@ -103,11 +103,10 @@ testing::AssertionResult PredFormatFunction1(const char* e1,
if
(
PredFunction1
(
v1
))
if
(
PredFunction1
(
v1
))
return
testing
::
AssertionSuccess
();
return
testing
::
AssertionSuccess
();
testing
::
Message
msg
;
return
testing
::
AssertionFailure
()
msg
<<
e1
<<
e1
<<
" is expected to be positive, but evaluates to "
<<
" is expected to be positive, but evaluates to "
<<
v1
<<
"."
;
<<
v1
<<
"."
;
return
testing
::
AssertionFailure
(
msg
);
}
}
// A unary predicate-formatter functor.
// A unary predicate-formatter functor.
...
@@ -494,11 +493,10 @@ testing::AssertionResult PredFormatFunction2(const char* e1,
...
@@ -494,11 +493,10 @@ testing::AssertionResult PredFormatFunction2(const char* e1,
if
(
PredFunction2
(
v1
,
v2
))
if
(
PredFunction2
(
v1
,
v2
))
return
testing
::
AssertionSuccess
();
return
testing
::
AssertionSuccess
();
testing
::
Message
msg
;
return
testing
::
AssertionFailure
()
msg
<<
e1
<<
" + "
<<
e2
<<
e1
<<
" + "
<<
e2
<<
" is expected to be positive, but evaluates to "
<<
" is expected to be positive, but evaluates to "
<<
v1
+
v2
<<
"."
;
<<
v1
+
v2
<<
"."
;
return
testing
::
AssertionFailure
(
msg
);
}
}
// A binary predicate-formatter functor.
// A binary predicate-formatter functor.
...
@@ -927,11 +925,10 @@ testing::AssertionResult PredFormatFunction3(const char* e1,
...
@@ -927,11 +925,10 @@ testing::AssertionResult PredFormatFunction3(const char* e1,
if
(
PredFunction3
(
v1
,
v2
,
v3
))
if
(
PredFunction3
(
v1
,
v2
,
v3
))
return
testing
::
AssertionSuccess
();
return
testing
::
AssertionSuccess
();
testing
::
Message
msg
;
return
testing
::
AssertionFailure
()
msg
<<
e1
<<
" + "
<<
e2
<<
" + "
<<
e3
<<
e1
<<
" + "
<<
e2
<<
" + "
<<
e3
<<
" is expected to be positive, but evaluates to "
<<
" is expected to be positive, but evaluates to "
<<
v1
+
v2
+
v3
<<
"."
;
<<
v1
+
v2
+
v3
<<
"."
;
return
testing
::
AssertionFailure
(
msg
);
}
}
// A ternary predicate-formatter functor.
// A ternary predicate-formatter functor.
...
@@ -1402,11 +1399,10 @@ testing::AssertionResult PredFormatFunction4(const char* e1,
...
@@ -1402,11 +1399,10 @@ testing::AssertionResult PredFormatFunction4(const char* e1,
if
(
PredFunction4
(
v1
,
v2
,
v3
,
v4
))
if
(
PredFunction4
(
v1
,
v2
,
v3
,
v4
))
return
testing
::
AssertionSuccess
();
return
testing
::
AssertionSuccess
();
testing
::
Message
msg
;
return
testing
::
AssertionFailure
()
msg
<<
e1
<<
" + "
<<
e2
<<
" + "
<<
e3
<<
" + "
<<
e4
<<
e1
<<
" + "
<<
e2
<<
" + "
<<
e3
<<
" + "
<<
e4
<<
" is expected to be positive, but evaluates to "
<<
" is expected to be positive, but evaluates to "
<<
v1
+
v2
+
v3
+
v4
<<
"."
;
<<
v1
+
v2
+
v3
+
v4
<<
"."
;
return
testing
::
AssertionFailure
(
msg
);
}
}
// A 4-ary predicate-formatter functor.
// A 4-ary predicate-formatter functor.
...
@@ -1919,11 +1915,10 @@ testing::AssertionResult PredFormatFunction5(const char* e1,
...
@@ -1919,11 +1915,10 @@ testing::AssertionResult PredFormatFunction5(const char* e1,
if
(
PredFunction5
(
v1
,
v2
,
v3
,
v4
,
v5
))
if
(
PredFunction5
(
v1
,
v2
,
v3
,
v4
,
v5
))
return
testing
::
AssertionSuccess
();
return
testing
::
AssertionSuccess
();
testing
::
Message
msg
;
return
testing
::
AssertionFailure
()
msg
<<
e1
<<
" + "
<<
e2
<<
" + "
<<
e3
<<
" + "
<<
e4
<<
" + "
<<
e5
<<
e1
<<
" + "
<<
e2
<<
" + "
<<
e3
<<
" + "
<<
e4
<<
" + "
<<
e5
<<
" is expected to be positive, but evaluates to "
<<
" is expected to be positive, but evaluates to "
<<
v1
+
v2
+
v3
+
v4
+
v5
<<
"."
;
<<
v1
+
v2
+
v3
+
v4
+
v5
<<
"."
;
return
testing
::
AssertionFailure
(
msg
);
}
}
// A 5-ary predicate-formatter functor.
// A 5-ary predicate-formatter functor.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment