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
e2c06aa2
Commit
e2c06aa2
authored
Aug 13, 2019
by
Krystian Kuzniarek
Browse files
remove a custom implementation of std::iterator_traits
parent
90a443f9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
42 deletions
+3
-42
googletest/include/gtest/gtest-param-test.h
googletest/include/gtest/gtest-param-test.h
+3
-3
googletest/include/gtest/internal/gtest-port.h
googletest/include/gtest/internal/gtest-port.h
+0
-21
googletest/test/googletest-port-test.cc
googletest/test/googletest-port-test.cc
+0
-18
No files found.
googletest/include/gtest/gtest-param-test.h
View file @
e2c06aa2
...
...
@@ -174,6 +174,7 @@ TEST_P(DerivedTest, DoesBlah) {
#endif // 0
#include <iterator>
#include <utility>
#include "gtest/internal/gtest-internal.h"
...
...
@@ -292,10 +293,9 @@ internal::ParamGenerator<T> Range(T start, T end) {
//
template
<
typename
ForwardIterator
>
internal
::
ParamGenerator
<
typename
::
testing
::
i
n
ter
nal
::
IteratorT
raits
<
ForwardIterator
>::
value_type
>
typename
std
::
iter
ator_t
raits
<
ForwardIterator
>::
value_type
>
ValuesIn
(
ForwardIterator
begin
,
ForwardIterator
end
)
{
typedef
typename
::
testing
::
internal
::
IteratorTraits
<
ForwardIterator
>
::
value_type
ParamType
;
typedef
typename
std
::
iterator_traits
<
ForwardIterator
>::
value_type
ParamType
;
return
internal
::
ParamGenerator
<
ParamType
>
(
new
internal
::
ValuesInIteratorRangeGenerator
<
ParamType
>
(
begin
,
end
));
}
...
...
googletest/include/gtest/internal/gtest-port.h
View file @
e2c06aa2
...
...
@@ -202,11 +202,6 @@
// Mutex, MutexLock, ThreadLocal, GetThreadCount()
// - synchronization primitives.
//
// Template meta programming:
// IteratorTraits - partial implementation of std::iterator_traits, which
// is not available in libCstd when compiled with Sun C++.
//
//
// Regular expressions:
// RE - a simple regular expression class using the POSIX
// Extended Regular Expression syntax on UNIX-like platforms
...
...
@@ -1937,22 +1932,6 @@ struct is_same : public false_type {};
template
<
typename
T
>
struct
is_same
<
T
,
T
>
:
public
true_type
{};
template
<
typename
Iterator
>
struct
IteratorTraits
{
typedef
typename
Iterator
::
value_type
value_type
;
};
template
<
typename
T
>
struct
IteratorTraits
<
T
*>
{
typedef
T
value_type
;
};
template
<
typename
T
>
struct
IteratorTraits
<
const
T
*>
{
typedef
T
value_type
;
};
#if GTEST_OS_WINDOWS
# define GTEST_PATH_SEP_ "\\"
# define GTEST_HAS_ALT_PATH_SEP_ 1
...
...
googletest/test/googletest-port-test.cc
View file @
e2c06aa2
...
...
@@ -201,24 +201,6 @@ TEST(ImplicitCastTest, CanUseImplicitConstructor) {
EXPECT_TRUE
(
converted
);
}
TEST
(
IteratorTraitsTest
,
WorksForSTLContainerIterators
)
{
StaticAssertTypeEq
<
int
,
IteratorTraits
<
::
std
::
vector
<
int
>::
const_iterator
>::
value_type
>
();
StaticAssertTypeEq
<
bool
,
IteratorTraits
<
::
std
::
list
<
bool
>::
iterator
>::
value_type
>
();
}
TEST
(
IteratorTraitsTest
,
WorksForPointerToNonConst
)
{
StaticAssertTypeEq
<
char
,
IteratorTraits
<
char
*>::
value_type
>
();
StaticAssertTypeEq
<
const
void
*
,
IteratorTraits
<
const
void
**>::
value_type
>
();
}
TEST
(
IteratorTraitsTest
,
WorksForPointerToConst
)
{
StaticAssertTypeEq
<
char
,
IteratorTraits
<
const
char
*>::
value_type
>
();
StaticAssertTypeEq
<
const
void
*
,
IteratorTraits
<
const
void
*
const
*>::
value_type
>
();
}
TEST
(
GtestCheckSyntaxTest
,
BehavesLikeASingleStatement
)
{
if
(
AlwaysFalse
())
GTEST_CHECK_
(
false
)
<<
"This should never be executed; "
...
...
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