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
2814b4b0
Commit
2814b4b0
authored
Mar 13, 2018
by
Gennadiy Civil
Browse files
merging, merging
parent
a719320a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
39 deletions
+23
-39
googletest/include/gtest/internal/gtest-port.h
googletest/include/gtest/internal/gtest-port.h
+2
-0
googletest/test/gtest-printers_test.cc
googletest/test/gtest-printers_test.cc
+21
-39
No files found.
googletest/include/gtest/internal/gtest-port.h
View file @
2814b4b0
...
...
@@ -371,6 +371,8 @@
# define GTEST_HAS_STD_MOVE_ 1
# define GTEST_HAS_STD_UNIQUE_PTR_ 1
# define GTEST_HAS_STD_SHARED_PTR_ 1
# define GTEST_HAS_UNORDERED_MAP_ 1
# define GTEST_HAS_UNORDERED_SET_ 1
#endif
// C++11 specifies that <tuple> provides std::tuple.
...
...
googletest/test/gtest-printers_test.cc
View file @
2814b4b0
...
...
@@ -50,14 +50,13 @@
#include "gtest/gtest.h"
// hash_set are available under Visual C++, or on Linux.
#if GTEST_HAS_HASH_MAP_
# include <hash_map> // NOLINT
#endif // GTEST_HAS_HASH_MAP_
#if GTEST_HAS_UNORDERED_MAP_
# include <unordered_map> // NOLINT
#endif // GTEST_HAS_UNORDERED_MAP_
#if GTEST_HAS_
HASH
_SET_
# include <
hash_set>
// NOLINT
#endif // GTEST_HAS_
HASH
_SET_
#if GTEST_HAS_
UNORDERED
_SET_
# include <
unordered_set>
// NOLINT
#endif // GTEST_HAS_
UNORDERED
_SET_
#if GTEST_HAS_STD_FORWARD_LIST_
# include <forward_list> // NOLINT
...
...
@@ -236,34 +235,6 @@ using ::testing::internal::UniversalTersePrint;
using
::
testing
::
internal
::
UniversalTersePrintTupleFieldsToStrings
;
#endif
// The hash_* classes are not part of the C++ standard. STLport
// defines them in namespace std. MSVC defines them in ::stdext. GCC
// defines them in ::.
#if GTEST_HAS_HASH_MAP_
#ifdef _STLP_HASH_MAP // We got <hash_map> from STLport.
using
::
std
::
hash_map
;
using
::
std
::
hash_multimap
;
#elif _MSC_VER
using
::
stdext
::
hash_map
;
using
::
stdext
::
hash_multimap
;
#endif
#endif
#if GTEST_HAS_HASH_SET_
#ifdef _STLP_HASH_MAP // We got <hash_map> from STLport.
using
::
std
::
hash_map
;
using
::
std
::
hash_multimap
;
#elif _MSC_VER
using
::
stdext
::
hash_map
;
using
::
stdext
::
hash_multimap
;
#endif
#endif
// Prints a value to a string using the universal value printer. This
// is a helper for testing UniversalPrinter<T>::Print() for various types.
template
<
typename
T
>
...
...
@@ -848,7 +819,13 @@ TEST(PrintStlContainerTest, NonEmptyDeque) {
EXPECT_EQ
(
"{ 1, 3 }"
,
Print
(
non_empty
));
}
#if GTEST_HAS_HASH_MAP_
#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
;
...
...
@@ -868,9 +845,14 @@ TEST(PrintStlContainerTest, HashMultiMap) {
<<
" where Print(map1) returns
\"
"
<<
result
<<
"
\"
."
;
}
#endif // GTEST_HAS_HASH_MAP_
#endif // GTEST_HAS_UNORDERED_MAP_
#if GTEST_HAS_UNORDERED_SET_
#if GTEST_HAS_HASH_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
;
...
...
@@ -907,7 +889,7 @@ TEST(PrintStlContainerTest, HashMultiSet) {
EXPECT_TRUE
(
std
::
equal
(
a
,
a
+
kSize
,
numbers
.
begin
()));
}
#endif // GTEST_HAS_
HASH
_SET_
#endif //
GTEST_HAS_
UNORDERED
_SET_
TEST
(
PrintStlContainerTest
,
List
)
{
const
std
::
string
a
[]
=
{
"hello"
,
"world"
};
...
...
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