Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
googletest
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
googletest
Commits
4898cdac
Commit
4898cdac
authored
Jan 26, 2021
by
CJ Johnson
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3204 from kuzkry:CmpHelperXX-overloads-removal
PiperOrigin-RevId: 352626267
parents
2c06d021
100ffc33
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
67 deletions
+1
-67
gtest.h
googletest/include/gtest/gtest.h
+1
-16
gtest.cc
googletest/src/gtest.cc
+0
-51
No files found.
googletest/include/gtest/gtest.h
View file @
4898cdac
...
...
@@ -1549,14 +1549,6 @@ AssertionResult CmpHelperEQ(const char* lhs_expression,
return
CmpHelperEQFailure
(
lhs_expression
,
rhs_expression
,
lhs
,
rhs
);
}
// With this overloaded version, we allow anonymous enums to be used
// in {ASSERT|EXPECT}_EQ when compiled with gcc 4, as anonymous enums
// can be implicitly cast to BiggestInt.
GTEST_API_
AssertionResult
CmpHelperEQ
(
const
char
*
lhs_expression
,
const
char
*
rhs_expression
,
BiggestInt
lhs
,
BiggestInt
rhs
);
class
EqHelper
{
public
:
// This templatized version is for the general case.
...
...
@@ -1613,11 +1605,6 @@ AssertionResult CmpHelperOpFailure(const char* expr1, const char* expr2,
// ASSERT_?? and EXPECT_??. It is here just to avoid copy-and-paste
// of similar code.
//
// For each templatized helper function, we also define an overloaded
// version for BiggestInt in order to reduce code bloat and allow
// anonymous enums to be used with {ASSERT|EXPECT}_?? when compiled
// with gcc 4.
//
// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
#define GTEST_IMPL_CMP_HELPER_(op_name, op)\
...
...
@@ -1629,9 +1616,7 @@ AssertionResult CmpHelper##op_name(const char* expr1, const char* expr2, \
} else {\
return CmpHelperOpFailure(expr1, expr2, val1, val2, #op);\
}\
}\
GTEST_API_ AssertionResult CmpHelper##op_name(\
const char* expr1, const char* expr2, BiggestInt val1, BiggestInt val2)
}
// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
...
...
googletest/src/gtest.cc
View file @
4898cdac
...
...
@@ -1603,57 +1603,6 @@ AssertionResult DoubleLE(const char* expr1, const char* expr2,
namespace
internal
{
// The helper function for {ASSERT|EXPECT}_EQ with int or enum
// arguments.
AssertionResult
CmpHelperEQ
(
const
char
*
lhs_expression
,
const
char
*
rhs_expression
,
BiggestInt
lhs
,
BiggestInt
rhs
)
{
if
(
lhs
==
rhs
)
{
return
AssertionSuccess
();
}
return
EqFailure
(
lhs_expression
,
rhs_expression
,
FormatForComparisonFailureMessage
(
lhs
,
rhs
),
FormatForComparisonFailureMessage
(
rhs
,
lhs
),
false
);
}
// A macro for implementing the helper functions needed to implement
// ASSERT_?? and EXPECT_?? with integer or enum arguments. It is here
// just to avoid copy-and-paste of similar code.
#define GTEST_IMPL_CMP_HELPER_(op_name, op)\
AssertionResult CmpHelper##op_name(const char* expr1, const char* expr2, \
BiggestInt val1, BiggestInt val2) {\
if (val1 op val2) {\
return AssertionSuccess();\
} else {\
return AssertionFailure() \
<< "Expected: (" << expr1 << ") " #op " (" << expr2\
<< "), actual: " << FormatForComparisonFailureMessage(val1, val2)\
<< " vs " << FormatForComparisonFailureMessage(val2, val1);\
}\
}
// Implements the helper function for {ASSERT|EXPECT}_NE with int or
// enum arguments.
GTEST_IMPL_CMP_HELPER_
(
NE
,
!=
)
// Implements the helper function for {ASSERT|EXPECT}_LE with int or
// enum arguments.
GTEST_IMPL_CMP_HELPER_
(
LE
,
<=
)
// Implements the helper function for {ASSERT|EXPECT}_LT with int or
// enum arguments.
GTEST_IMPL_CMP_HELPER_
(
LT
,
<
)
// Implements the helper function for {ASSERT|EXPECT}_GE with int or
// enum arguments.
GTEST_IMPL_CMP_HELPER_
(
GE
,
>=
)
// Implements the helper function for {ASSERT|EXPECT}_GT with int or
// enum arguments.
GTEST_IMPL_CMP_HELPER_
(
GT
,
>
)
#undef GTEST_IMPL_CMP_HELPER_
// The helper function for {ASSERT|EXPECT}_STREQ.
AssertionResult
CmpHelperSTREQ
(
const
char
*
lhs_expression
,
const
char
*
rhs_expression
,
...
...
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