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
262aaf2f
Commit
262aaf2f
authored
Mar 14, 2018
by
Gennadiy Civil
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erging, cont
parent
2814b4b0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
15 deletions
+4
-15
gtest-printers_test.cc
googletest/test/gtest-printers_test.cc
+4
-15
No files found.
googletest/test/gtest-printers_test.cc
View file @
262aaf2f
...
...
@@ -821,20 +821,14 @@ TEST(PrintStlContainerTest, NonEmptyDeque) {
#if GTEST_HAS_UNORDERED_MAP_
template
<
class
Key
,
class
T
>
using
hash_map
=
::
std
::
unordered_map
<
Key
,
T
>
;
template
<
class
Key
,
class
T
>
using
hash_multimap
=
::
std
::
unordered_multimap
<
Key
,
T
>
;
TEST
(
PrintStlContainerTest
,
OneElementHashMap
)
{
hash
_map
<
int
,
char
>
map1
;
::
std
::
unordered
_map
<
int
,
char
>
map1
;
map1
[
1
]
=
'a'
;
EXPECT_EQ
(
"{ (1, 'a' (97, 0x61)) }"
,
Print
(
map1
));
}
TEST
(
PrintStlContainerTest
,
HashMultiMap
)
{
hash
_multimap
<
int
,
bool
>
map1
;
::
std
::
unordered
_multimap
<
int
,
bool
>
map1
;
map1
.
insert
(
make_pair
(
5
,
true
));
map1
.
insert
(
make_pair
(
5
,
false
));
...
...
@@ -849,13 +843,8 @@ TEST(PrintStlContainerTest, HashMultiMap) {
#if GTEST_HAS_UNORDERED_SET_
template
<
class
Key
>
using
hash_set
=
::
std
::
unordered_set
<
Key
>
;
template
<
class
Key
>
using
hash_multiset
=
::
std
::
unordered_multiset
<
Key
>
;
TEST
(
PrintStlContainerTest
,
HashSet
)
{
hash
_set
<
int
>
set1
;
::
std
::
unordered
_set
<
int
>
set1
;
set1
.
insert
(
1
);
EXPECT_EQ
(
"{ 1 }"
,
Print
(
set1
));
}
...
...
@@ -863,7 +852,7 @@ TEST(PrintStlContainerTest, HashSet) {
TEST
(
PrintStlContainerTest
,
HashMultiSet
)
{
const
int
kSize
=
5
;
int
a
[
kSize
]
=
{
1
,
1
,
2
,
5
,
1
};
hash
_multiset
<
int
>
set1
(
a
,
a
+
kSize
);
::
std
::
unordered
_multiset
<
int
>
set1
(
a
,
a
+
kSize
);
// Elements of hash_multiset can be printed in any order.
const
std
::
string
result
=
Print
(
set1
);
...
...
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