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
cac6c1bb
Commit
cac6c1bb
authored
Jul 27, 2015
by
kosak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tests based on GTEST_HAS_STD_UNIQUE_PTR_ and GTEST_HAS_STD_SHARED_PTR_.
Pull in gtest 744.
parent
6702b97d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
0 deletions
+18
-0
gmock-internal-utils_test.cc
test/gmock-internal-utils_test.cc
+18
-0
No files found.
test/gmock-internal-utils_test.cc
View file @
cac6c1bb
...
@@ -96,6 +96,13 @@ TEST(ConvertIdentifierNameToWordsTest, WorksWhenNameIsMixture) {
...
@@ -96,6 +96,13 @@ TEST(ConvertIdentifierNameToWordsTest, WorksWhenNameIsMixture) {
TEST
(
PointeeOfTest
,
WorksForSmartPointers
)
{
TEST
(
PointeeOfTest
,
WorksForSmartPointers
)
{
CompileAssertTypesEqual
<
const
char
,
CompileAssertTypesEqual
<
const
char
,
PointeeOf
<
internal
::
linked_ptr
<
const
char
>
>::
type
>
();
PointeeOf
<
internal
::
linked_ptr
<
const
char
>
>::
type
>
();
#if GTEST_HAS_STD_UNIQUE_PTR_
CompileAssertTypesEqual
<
int
,
PointeeOf
<
std
::
unique_ptr
<
int
>
>::
type
>
();
#endif // GTEST_HAS_STD_UNIQUE_PTR_
#if GTEST_HAS_STD_SHARED_PTR_
CompileAssertTypesEqual
<
std
::
string
,
PointeeOf
<
std
::
shared_ptr
<
std
::
string
>
>::
type
>
();
#endif // GTEST_HAS_STD_SHARED_PTR_
}
}
TEST
(
PointeeOfTest
,
WorksForRawPointers
)
{
TEST
(
PointeeOfTest
,
WorksForRawPointers
)
{
...
@@ -105,6 +112,17 @@ TEST(PointeeOfTest, WorksForRawPointers) {
...
@@ -105,6 +112,17 @@ TEST(PointeeOfTest, WorksForRawPointers) {
}
}
TEST
(
GetRawPointerTest
,
WorksForSmartPointers
)
{
TEST
(
GetRawPointerTest
,
WorksForSmartPointers
)
{
#if GTEST_HAS_STD_UNIQUE_PTR_
const
char
*
const
raw_p1
=
new
const
char
(
'a'
);
// NOLINT
const
std
::
unique_ptr
<
const
char
>
p1
(
raw_p1
);
EXPECT_EQ
(
raw_p1
,
GetRawPointer
(
p1
));
#endif // GTEST_HAS_STD_UNIQUE_PTR_
#if GTEST_HAS_STD_SHARED_PTR_
double
*
const
raw_p2
=
new
double
(
2.5
);
// NOLINT
const
std
::
shared_ptr
<
double
>
p2
(
raw_p2
);
EXPECT_EQ
(
raw_p2
,
GetRawPointer
(
p2
));
#endif // GTEST_HAS_STD_SHARED_PTR_
const
char
*
const
raw_p4
=
new
const
char
(
'a'
);
// NOLINT
const
char
*
const
raw_p4
=
new
const
char
(
'a'
);
// NOLINT
const
internal
::
linked_ptr
<
const
char
>
p4
(
raw_p4
);
const
internal
::
linked_ptr
<
const
char
>
p4
(
raw_p4
);
EXPECT_EQ
(
raw_p4
,
GetRawPointer
(
p4
));
EXPECT_EQ
(
raw_p4
,
GetRawPointer
(
p4
));
...
...
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