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
3468af9b
Commit
3468af9b
authored
Oct 22, 2018
by
Jerry Turcios
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://github.com/google/googletest
parents
648ac832
82987067
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
222 additions
and
58 deletions
+222
-58
gmock.pc.in
googlemock/cmake/gmock.pc.in
+3
-2
gmock_main.pc.in
googlemock/cmake/gmock_main.pc.in
+3
-2
gtest.pc.in
googletest/cmake/gtest.pc.in
+3
-2
gtest_main.pc.in
googletest/cmake/gtest_main.pc.in
+3
-2
gtest-internal.h
googletest/include/gtest/internal/gtest-internal.h
+106
-0
gtest-param-util.h
googletest/include/gtest/internal/gtest-param-util.h
+9
-37
googletest-env-var-test.py
googletest/test/googletest-env-var-test.py
+2
-2
googletest-filter-unittest.py
googletest/test/googletest-filter-unittest.py
+8
-5
googletest-output-test.py
googletest/test/googletest-output-test.py
+1
-1
googletest-throw-on-failure-test.py
googletest/test/googletest-throw-on-failure-test.py
+1
-1
googletest-uninitialized-test.py
googletest/test/googletest-uninitialized-test.py
+2
-2
gtest_unittest.cc
googletest/test/gtest_unittest.cc
+78
-0
gtest_xml_output_unittest.py
googletest/test/gtest_xml_output_unittest.py
+2
-1
gtest_xml_test_utils.py
googletest/test/gtest_xml_test_utils.py
+1
-1
No files found.
googlemock/cmake/gmock.pc.in
View file @
3468af9b
libdir=@CMAKE_INSTALL_FULL_LIBDIR@
prefix=${pcfiledir}/../..
includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@
includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@
Name: gmock
Name: gmock
Description: GoogleMock (without main() function)
Description: GoogleMock (without main() function)
...
...
googlemock/cmake/gmock_main.pc.in
View file @
3468af9b
libdir=@CMAKE_INSTALL_FULL_LIBDIR@
prefix=${pcfiledir}/../..
includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@
includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@
Name: gmock_main
Name: gmock_main
Description: GoogleMock (with main() function)
Description: GoogleMock (with main() function)
...
...
googletest/cmake/gtest.pc.in
View file @
3468af9b
libdir=@CMAKE_INSTALL_FULL_LIBDIR@
prefix=${pcfiledir}/../..
includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@
includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@
Name: gtest
Name: gtest
Description: GoogleTest (without main() function)
Description: GoogleTest (without main() function)
...
...
googletest/cmake/gtest_main.pc.in
View file @
3468af9b
libdir=@CMAKE_INSTALL_FULL_LIBDIR@
prefix=${pcfiledir}/../..
includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@
includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@
Name: gtest_main
Name: gtest_main
Description: GoogleTest (with main() function)
Description: GoogleTest (with main() function)
...
...
googletest/include/gtest/internal/gtest-internal.h
View file @
3468af9b
...
@@ -1176,6 +1176,112 @@ class NativeArray {
...
@@ -1176,6 +1176,112 @@ class NativeArray {
GTEST_DISALLOW_ASSIGN_
(
NativeArray
);
GTEST_DISALLOW_ASSIGN_
(
NativeArray
);
};
};
// Backport of std::index_sequence.
template
<
size_t
...
Is
>
struct
IndexSequence
{
using
type
=
IndexSequence
;
};
// Double the IndexSequence, and one if plus_one is true.
template
<
bool
plus_one
,
typename
T
,
size_t
sizeofT
>
struct
DoubleSequence
;
template
<
size_t
...
I
,
size_t
sizeofT
>
struct
DoubleSequence
<
true
,
IndexSequence
<
I
...
>
,
sizeofT
>
{
using
type
=
IndexSequence
<
I
...,
(
sizeofT
+
I
)...,
2
*
sizeofT
>
;
};
template
<
size_t
...
I
,
size_t
sizeofT
>
struct
DoubleSequence
<
false
,
IndexSequence
<
I
...
>
,
sizeofT
>
{
using
type
=
IndexSequence
<
I
...,
(
sizeofT
+
I
)...
>
;
};
// Backport of std::make_index_sequence.
// It uses O(ln(N)) instantiation depth.
template
<
size_t
N
>
struct
MakeIndexSequence
:
DoubleSequence
<
N
%
2
==
1
,
typename
MakeIndexSequence
<
N
/
2
>::
type
,
N
/
2
>::
type
{};
template
<>
struct
MakeIndexSequence
<
0
>
:
IndexSequence
<>
{};
// FIXME: This implementation of ElemFromList is O(1) in instantiation depth,
// but it is O(N^2) in total instantiations. Not sure if this is the best
// tradeoff, as it will make it somewhat slow to compile.
template
<
typename
T
,
size_t
,
size_t
>
struct
ElemFromListImpl
{};
template
<
typename
T
,
size_t
I
>
struct
ElemFromListImpl
<
T
,
I
,
I
>
{
using
type
=
T
;
};
// Get the Nth element from T...
// It uses O(1) instantiation depth.
template
<
size_t
N
,
typename
I
,
typename
...
T
>
struct
ElemFromList
;
template
<
size_t
N
,
size_t
...
I
,
typename
...
T
>
struct
ElemFromList
<
N
,
IndexSequence
<
I
...
>
,
T
...
>
:
ElemFromListImpl
<
T
,
N
,
I
>
...
{};
template
<
typename
...
T
>
class
FlatTuple
;
template
<
typename
Derived
,
size_t
I
>
struct
FlatTupleElemBase
;
template
<
typename
...
T
,
size_t
I
>
struct
FlatTupleElemBase
<
FlatTuple
<
T
...
>
,
I
>
{
using
value_type
=
typename
ElemFromList
<
I
,
typename
MakeIndexSequence
<
sizeof
...(
T
)
>::
type
,
T
...
>::
type
;
FlatTupleElemBase
()
=
default
;
explicit
FlatTupleElemBase
(
value_type
t
)
:
value
(
std
::
move
(
t
))
{}
value_type
value
;
};
template
<
typename
Derived
,
typename
Idx
>
struct
FlatTupleBase
;
template
<
size_t
...
Idx
,
typename
...
T
>
struct
FlatTupleBase
<
FlatTuple
<
T
...
>
,
IndexSequence
<
Idx
...
>>
:
FlatTupleElemBase
<
FlatTuple
<
T
...
>
,
Idx
>
...
{
using
Indices
=
IndexSequence
<
Idx
...
>
;
FlatTupleBase
()
=
default
;
explicit
FlatTupleBase
(
T
...
t
)
:
FlatTupleElemBase
<
FlatTuple
<
T
...
>
,
Idx
>
(
std
::
move
(
t
))...
{}
};
// Analog to std::tuple but with different tradeoffs.
// This class minimizes the template instantiation depth, thus allowing more
// elements that std::tuple would. std::tuple has been seen to require an
// instantiation depth of more than 10x the number of elements in some
// implementations.
// FlatTuple and ElemFromList are not recursive and have a fixed depth
// regardless of T...
// MakeIndexSequence, on the other hand, it is recursive but with an
// instantiation depth of O(ln(N)).
template
<
typename
...
T
>
class
FlatTuple
:
private
FlatTupleBase
<
FlatTuple
<
T
...
>
,
typename
MakeIndexSequence
<
sizeof
...(
T
)
>::
type
>
{
using
Indices
=
typename
FlatTuple
::
FlatTupleBase
::
Indices
;
public
:
FlatTuple
()
=
default
;
explicit
FlatTuple
(
T
...
t
)
:
FlatTuple
::
FlatTupleBase
(
std
::
move
(
t
)...)
{}
template
<
size_t
I
>
const
typename
ElemFromList
<
I
,
Indices
,
T
...
>::
type
&
Get
()
const
{
return
static_cast
<
const
FlatTupleElemBase
<
FlatTuple
,
I
>*>
(
this
)
->
value
;
}
template
<
size_t
I
>
typename
ElemFromList
<
I
,
Indices
,
T
...
>::
type
&
Get
()
{
return
static_cast
<
FlatTupleElemBase
<
FlatTuple
,
I
>*>
(
this
)
->
value
;
}
};
}
// namespace internal
}
// namespace internal
}
// namespace testing
}
// namespace testing
...
...
googletest/include/gtest/internal/gtest-param-util.h
View file @
3468af9b
...
@@ -74,27 +74,6 @@ namespace internal {
...
@@ -74,27 +74,6 @@ namespace internal {
// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
// Utility Functions
// Utility Functions
// Block of code creating for_each_in_tuple
template
<
int
...
Is
>
struct
sequence
{};
template
<
int
N
,
int
...
Is
>
struct
generate_sequence
:
generate_sequence
<
N
-
1
,
N
-
1
,
Is
...
>
{};
template
<
int
...
Is
>
struct
generate_sequence
<
0
,
Is
...
>
:
sequence
<
Is
...
>
{};
template
<
typename
T
,
typename
F
,
int
...
Is
>
void
ForEachInTupleImpl
(
T
&&
t
,
F
f_gtest
,
sequence
<
Is
...
>
)
{
int
l
[]
=
{(
f_gtest
(
std
::
get
<
Is
>
(
t
)),
0
)...};
(
void
)
l
;
// silence "unused variable warning"
}
template
<
typename
...
T
,
typename
F
>
void
ForEachInTuple
(
const
std
::
tuple
<
T
...
>&
t
,
F
f_gtest
)
{
internal
::
ForEachInTupleImpl
(
t
,
f_gtest
,
internal
::
generate_sequence
<
sizeof
...(
T
)
>
());
}
// Outputs a message explaining invalid registration of different
// Outputs a message explaining invalid registration of different
// fixture class for the same test case. This may happen when
// fixture class for the same test case. This may happen when
// TEST_P macro is used to define two tests with the same name
// TEST_P macro is used to define two tests with the same name
...
@@ -747,30 +726,23 @@ internal::ParamGenerator<typename Container::value_type> ValuesIn(
...
@@ -747,30 +726,23 @@ internal::ParamGenerator<typename Container::value_type> ValuesIn(
namespace
internal
{
namespace
internal
{
// Used in the Values() function to provide polymorphic capabilities.
// Used in the Values() function to provide polymorphic capabilities.
template
<
typename
T
>
struct
PushBack
{
template
<
typename
U
>
void
operator
()(
const
U
&
u
)
{
v_
.
push_back
(
static_cast
<
T
>
(
u
));
}
std
::
vector
<
T
>&
v_
;
};
template
<
typename
...
Ts
>
template
<
typename
...
Ts
>
class
ValueArray
{
class
ValueArray
{
public
:
public
:
ValueArray
(
Ts
...
v
)
:
v_
{
std
::
move
(
v
)...}
{}
ValueArray
(
Ts
...
v
)
:
v_
{
std
::
move
(
v
)...}
{}
template
<
typename
Tn
>
template
<
typename
T
>
operator
ParamGenerator
<
Tn
>
()
const
{
operator
ParamGenerator
<
T
>
()
const
{
// NOLINT
std
::
vector
<
Tn
>
vc_accumulate
;
return
ValuesIn
(
MakeVector
<
T
>
(
MakeIndexSequence
<
sizeof
...(
Ts
)
>
()));
PushBack
<
Tn
>
fnc
{
vc_accumulate
};
ForEachInTuple
(
v_
,
fnc
);
return
ValuesIn
(
std
::
move
(
vc_accumulate
));
}
}
private
:
private
:
std
::
tuple
<
Ts
...
>
v_
;
template
<
typename
T
,
size_t
...
I
>
std
::
vector
<
T
>
MakeVector
(
IndexSequence
<
I
...
>
)
const
{
return
std
::
vector
<
T
>
{
static_cast
<
T
>
(
v_
.
template
Get
<
I
>
())...};
}
FlatTuple
<
Ts
...
>
v_
;
};
};
}
// namespace internal
}
// namespace internal
...
...
googletest/test/googletest-env-var-test.py
View file @
3468af9b
...
@@ -45,8 +45,8 @@ environ = os.environ.copy()
...
@@ -45,8 +45,8 @@ environ = os.environ.copy()
def
AssertEq
(
expected
,
actual
):
def
AssertEq
(
expected
,
actual
):
if
expected
!=
actual
:
if
expected
!=
actual
:
print
'Expected:
%
s'
%
(
expected
,
)
print
(
'Expected:
%
s'
%
(
expected
,)
)
print
' Actual:
%
s'
%
(
actual
,
)
print
(
' Actual:
%
s'
%
(
actual
,)
)
raise
AssertionError
raise
AssertionError
...
...
googletest/test/googletest-filter-unittest.py
View file @
3468af9b
...
@@ -42,7 +42,10 @@ we test that here also.
...
@@ -42,7 +42,10 @@ we test that here also.
import
os
import
os
import
re
import
re
import
sets
try
:
from
sets
import
Set
as
set
# For Python 2.3 compatibility
except
ImportError
:
pass
import
sys
import
sys
import
gtest_test_utils
import
gtest_test_utils
...
@@ -57,7 +60,7 @@ CAN_PASS_EMPTY_ENV = False
...
@@ -57,7 +60,7 @@ CAN_PASS_EMPTY_ENV = False
if
sys
.
executable
:
if
sys
.
executable
:
os
.
environ
[
'EMPTY_VAR'
]
=
''
os
.
environ
[
'EMPTY_VAR'
]
=
''
child
=
gtest_test_utils
.
Subprocess
(
child
=
gtest_test_utils
.
Subprocess
(
[
sys
.
executable
,
'-c'
,
'import os; print
\'
EMPTY_VAR
\'
in os.environ
'
])
[
sys
.
executable
,
'-c'
,
'import os; print
(
\'
EMPTY_VAR
\'
in os.environ)
'
])
CAN_PASS_EMPTY_ENV
=
eval
(
child
.
output
)
CAN_PASS_EMPTY_ENV
=
eval
(
child
.
output
)
...
@@ -72,7 +75,7 @@ if sys.executable:
...
@@ -72,7 +75,7 @@ if sys.executable:
os
.
environ
[
'UNSET_VAR'
]
=
'X'
os
.
environ
[
'UNSET_VAR'
]
=
'X'
del
os
.
environ
[
'UNSET_VAR'
]
del
os
.
environ
[
'UNSET_VAR'
]
child
=
gtest_test_utils
.
Subprocess
(
child
=
gtest_test_utils
.
Subprocess
(
[
sys
.
executable
,
'-c'
,
'import os; print
\'
UNSET_VAR
\'
not in os.environ
'
[
sys
.
executable
,
'-c'
,
'import os; print
(
\'
UNSET_VAR
\'
not in os.environ)
'
])
])
CAN_UNSET_ENV
=
eval
(
child
.
output
)
CAN_UNSET_ENV
=
eval
(
child
.
output
)
...
@@ -245,14 +248,14 @@ class GTestFilterUnitTest(gtest_test_utils.TestCase):
...
@@ -245,14 +248,14 @@ class GTestFilterUnitTest(gtest_test_utils.TestCase):
for
slice_var
in
list_of_sets
:
for
slice_var
in
list_of_sets
:
full_partition
.
extend
(
slice_var
)
full_partition
.
extend
(
slice_var
)
self
.
assertEqual
(
len
(
set_var
),
len
(
full_partition
))
self
.
assertEqual
(
len
(
set_var
),
len
(
full_partition
))
self
.
assertEqual
(
set
s
.
Set
(
set_var
),
sets
.
S
et
(
full_partition
))
self
.
assertEqual
(
set
(
set_var
),
s
et
(
full_partition
))
def
AdjustForParameterizedTests
(
self
,
tests_to_run
):
def
AdjustForParameterizedTests
(
self
,
tests_to_run
):
"""Adjust tests_to_run in case value parameterized tests are disabled."""
"""Adjust tests_to_run in case value parameterized tests are disabled."""
global
param_tests_present
global
param_tests_present
if
not
param_tests_present
:
if
not
param_tests_present
:
return
list
(
set
s
.
Set
(
tests_to_run
)
-
sets
.
S
et
(
PARAM_TESTS
))
return
list
(
set
(
tests_to_run
)
-
s
et
(
PARAM_TESTS
))
else
:
else
:
return
tests_to_run
return
tests_to_run
...
...
googletest/test/googletest-output-test.py
View file @
3468af9b
...
@@ -287,7 +287,7 @@ class GTestOutputTest(gtest_test_utils.TestCase):
...
@@ -287,7 +287,7 @@ class GTestOutputTest(gtest_test_utils.TestCase):
# sequences when we read the golden file irrespective of an operating
# sequences when we read the golden file irrespective of an operating
# system used. Therefore, we need to strip those \r's from newlines
# system used. Therefore, we need to strip those \r's from newlines
# unconditionally.
# unconditionally.
golden
=
ToUnixLineEnding
(
golden_file
.
read
())
golden
=
ToUnixLineEnding
(
golden_file
.
read
()
.
decode
()
)
golden_file
.
close
()
golden_file
.
close
()
# We want the test to pass regardless of certain features being
# We want the test to pass regardless of certain features being
...
...
googletest/test/googletest-throw-on-failure-test.py
View file @
3468af9b
...
@@ -68,7 +68,7 @@ def SetEnvVar(env_var, value):
...
@@ -68,7 +68,7 @@ def SetEnvVar(env_var, value):
def
Run
(
command
):
def
Run
(
command
):
"""Runs a command; returns True/False if its exit code is/isn't 0."""
"""Runs a command; returns True/False if its exit code is/isn't 0."""
print
'Running "
%
s". . .'
%
' '
.
join
(
command
)
print
(
'Running "
%
s". . .'
%
' '
.
join
(
command
)
)
p
=
gtest_test_utils
.
Subprocess
(
command
)
p
=
gtest_test_utils
.
Subprocess
(
command
)
return
p
.
exited
and
p
.
exit_code
==
0
return
p
.
exited
and
p
.
exit_code
==
0
...
...
googletest/test/googletest-uninitialized-test.py
View file @
3468af9b
...
@@ -43,8 +43,8 @@ def Assert(condition):
...
@@ -43,8 +43,8 @@ def Assert(condition):
def
AssertEq
(
expected
,
actual
):
def
AssertEq
(
expected
,
actual
):
if
expected
!=
actual
:
if
expected
!=
actual
:
print
'Expected:
%
s'
%
(
expected
,
)
print
(
'Expected:
%
s'
%
(
expected
,)
)
print
' Actual:
%
s'
%
(
actual
,
)
print
(
' Actual:
%
s'
%
(
actual
,)
)
raise
AssertionError
raise
AssertionError
...
...
googletest/test/gtest_unittest.cc
View file @
3468af9b
...
@@ -7450,6 +7450,84 @@ TEST(NativeArrayTest, WorksForTwoDimensionalArray) {
...
@@ -7450,6 +7450,84 @@ TEST(NativeArrayTest, WorksForTwoDimensionalArray) {
EXPECT_EQ
(
a
,
na
.
begin
());
EXPECT_EQ
(
a
,
na
.
begin
());
}
}
// IndexSequence
TEST
(
IndexSequence
,
MakeIndexSequence
)
{
using
testing
::
internal
::
IndexSequence
;
using
testing
::
internal
::
MakeIndexSequence
;
EXPECT_TRUE
(
(
std
::
is_same
<
IndexSequence
<>
,
MakeIndexSequence
<
0
>::
type
>::
value
));
EXPECT_TRUE
(
(
std
::
is_same
<
IndexSequence
<
0
>
,
MakeIndexSequence
<
1
>::
type
>::
value
));
EXPECT_TRUE
(
(
std
::
is_same
<
IndexSequence
<
0
,
1
>
,
MakeIndexSequence
<
2
>::
type
>::
value
));
EXPECT_TRUE
((
std
::
is_same
<
IndexSequence
<
0
,
1
,
2
>
,
MakeIndexSequence
<
3
>::
type
>::
value
));
EXPECT_TRUE
(
(
std
::
is_base_of
<
IndexSequence
<
0
,
1
,
2
>
,
MakeIndexSequence
<
3
>>::
value
));
}
// ElemFromList
TEST
(
ElemFromList
,
Basic
)
{
using
testing
::
internal
::
ElemFromList
;
using
Idx
=
testing
::
internal
::
MakeIndexSequence
<
3
>::
type
;
EXPECT_TRUE
((
std
::
is_same
<
int
,
ElemFromList
<
0
,
Idx
,
int
,
double
,
char
>::
type
>::
value
));
EXPECT_TRUE
(
(
std
::
is_same
<
double
,
ElemFromList
<
1
,
Idx
,
int
,
double
,
char
>::
type
>::
value
));
EXPECT_TRUE
(
(
std
::
is_same
<
char
,
ElemFromList
<
2
,
Idx
,
int
,
double
,
char
>::
type
>::
value
));
EXPECT_TRUE
(
(
std
::
is_same
<
char
,
ElemFromList
<
7
,
testing
::
internal
::
MakeIndexSequence
<
12
>::
type
,
int
,
int
,
int
,
int
,
int
,
int
,
int
,
char
,
int
,
int
,
int
,
int
>::
type
>::
value
));
}
// FlatTuple
TEST
(
FlatTuple
,
Basic
)
{
using
testing
::
internal
::
FlatTuple
;
FlatTuple
<
int
,
double
,
const
char
*>
tuple
=
{};
EXPECT_EQ
(
0
,
tuple
.
Get
<
0
>
());
EXPECT_EQ
(
0.0
,
tuple
.
Get
<
1
>
());
EXPECT_EQ
(
nullptr
,
tuple
.
Get
<
2
>
());
tuple
=
FlatTuple
<
int
,
double
,
const
char
*>
(
7
,
3.2
,
"Foo"
);
EXPECT_EQ
(
7
,
tuple
.
Get
<
0
>
());
EXPECT_EQ
(
3.2
,
tuple
.
Get
<
1
>
());
EXPECT_EQ
(
std
::
string
(
"Foo"
),
tuple
.
Get
<
2
>
());
tuple
.
Get
<
1
>
()
=
5.1
;
EXPECT_EQ
(
5.1
,
tuple
.
Get
<
1
>
());
}
TEST
(
FlatTuple
,
ManyTypes
)
{
using
testing
::
internal
::
FlatTuple
;
// Instantiate FlatTuple with 257 ints.
// Tests show that we can do it with thousands of elements, but very long
// compile times makes it unusuitable for this test.
#define GTEST_FLAT_TUPLE_INT8 int, int, int, int, int, int, int, int,
#define GTEST_FLAT_TUPLE_INT16 GTEST_FLAT_TUPLE_INT8 GTEST_FLAT_TUPLE_INT8
#define GTEST_FLAT_TUPLE_INT32 GTEST_FLAT_TUPLE_INT16 GTEST_FLAT_TUPLE_INT16
#define GTEST_FLAT_TUPLE_INT64 GTEST_FLAT_TUPLE_INT32 GTEST_FLAT_TUPLE_INT32
#define GTEST_FLAT_TUPLE_INT128 GTEST_FLAT_TUPLE_INT64 GTEST_FLAT_TUPLE_INT64
#define GTEST_FLAT_TUPLE_INT256 GTEST_FLAT_TUPLE_INT128 GTEST_FLAT_TUPLE_INT128
// Let's make sure that we can have a very long list of types without blowing
// up the template instantiation depth.
FlatTuple
<
GTEST_FLAT_TUPLE_INT256
int
>
tuple
;
tuple
.
Get
<
0
>
()
=
7
;
tuple
.
Get
<
99
>
()
=
17
;
tuple
.
Get
<
256
>
()
=
1000
;
EXPECT_EQ
(
7
,
tuple
.
Get
<
0
>
());
EXPECT_EQ
(
17
,
tuple
.
Get
<
99
>
());
EXPECT_EQ
(
1000
,
tuple
.
Get
<
256
>
());
}
// Tests SkipPrefix().
// Tests SkipPrefix().
TEST
(
SkipPrefixTest
,
SkipsWhenPrefixMatches
)
{
TEST
(
SkipPrefixTest
,
SkipsWhenPrefixMatches
)
{
...
...
googletest/test/gtest_xml_output_unittest.py
View file @
3468af9b
...
@@ -266,7 +266,8 @@ class GTestXMLOutputUnitTest(gtest_xml_test_utils.GTestXMLTestCase):
...
@@ -266,7 +266,8 @@ class GTestXMLOutputUnitTest(gtest_xml_test_utils.GTestXMLTestCase):
'gtest_no_test_unittest'
)
'gtest_no_test_unittest'
)
try
:
try
:
os
.
remove
(
output_file
)
os
.
remove
(
output_file
)
except
OSError
,
e
:
except
OSError
:
e
=
sys
.
exc_info
()[
1
]
if
e
.
errno
!=
errno
.
ENOENT
:
if
e
.
errno
!=
errno
.
ENOENT
:
raise
raise
...
...
googletest/test/gtest_xml_test_utils.py
View file @
3468af9b
...
@@ -94,7 +94,7 @@ class GTestXMLTestCase(gtest_test_utils.TestCase):
...
@@ -94,7 +94,7 @@ class GTestXMLTestCase(gtest_test_utils.TestCase):
self
.
assertEquals
(
self
.
assertEquals
(
len
(
expected_children
),
len
(
actual_children
),
len
(
expected_children
),
len
(
actual_children
),
'number of child elements differ in element '
+
actual_node
.
tagName
)
'number of child elements differ in element '
+
actual_node
.
tagName
)
for
child_id
,
child
in
expected_children
.
ite
rite
ms
():
for
child_id
,
child
in
expected_children
.
items
():
self
.
assert_
(
child_id
in
actual_children
,
self
.
assert_
(
child_id
in
actual_children
,
'<
%
s> is not in <
%
s> (in element
%
s)'
%
'<
%
s> is not in <
%
s> (in element
%
s)'
%
(
child_id
,
actual_children
,
actual_node
.
tagName
))
(
child_id
,
actual_children
,
actual_node
.
tagName
))
...
...
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