Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
yangql
googletest
Commits
8965a6a0
Commit
8965a6a0
authored
Nov 04, 2011
by
vladlosev
Browse files
Improves conformance to the Google C++ Style Guide (by Greg Miller).
parent
829402ed
Changes
35
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
111 additions
and
61 deletions
+111
-61
include/gtest/gtest-spi.h
include/gtest/gtest-spi.h
+1
-1
include/gtest/gtest-test-part.h
include/gtest/gtest-test-part.h
+1
-0
include/gtest/gtest.h
include/gtest/gtest.h
+3
-3
include/gtest/gtest_pred_impl.h
include/gtest/gtest_pred_impl.h
+6
-6
include/gtest/internal/gtest-port.h
include/gtest/internal/gtest-port.h
+2
-2
include/gtest/internal/gtest-string.h
include/gtest/internal/gtest-string.h
+4
-4
include/gtest/internal/gtest-tuple.h
include/gtest/internal/gtest-tuple.h
+66
-22
include/gtest/internal/gtest-tuple.h.pump
include/gtest/internal/gtest-tuple.h.pump
+6
-3
include/gtest/internal/gtest-type-util.h
include/gtest/internal/gtest-type-util.h
+4
-2
include/gtest/internal/gtest-type-util.h.pump
include/gtest/internal/gtest-type-util.h.pump
+4
-2
samples/sample10_unittest.cc
samples/sample10_unittest.cc
+1
-2
samples/sample1_unittest.cc
samples/sample1_unittest.cc
+1
-1
samples/sample2.h
samples/sample2.h
+0
-1
samples/sample2_unittest.cc
samples/sample2_unittest.cc
+4
-4
samples/sample3-inl.h
samples/sample3-inl.h
+3
-4
samples/sample5_unittest.cc
samples/sample5_unittest.cc
+1
-1
scripts/gen_gtest_pred_impl.py
scripts/gen_gtest_pred_impl.py
+2
-2
src/gtest-death-test.cc
src/gtest-death-test.cc
+1
-0
src/gtest-internal-inl.h
src/gtest-internal-inl.h
+1
-0
src/gtest-port.cc
src/gtest-port.cc
+0
-1
No files found.
include/gtest/gtest-spi.h
View file @
8965a6a0
...
...
@@ -223,7 +223,7 @@ class GTEST_API_ SingleFailureChecker {
(substr));\
{\
::testing::ScopedFakeTestPartResultReporter gtest_reporter(\
::testing::ScopedFakeTestPartResultReporter::INTERCEPT_ALL_THREADS,\
::testing::ScopedFakeTestPartResultReporter::INTERCEPT_ALL_THREADS,
\
>est_failures);\
if (::testing::internal::AlwaysTrue()) { statement; }\
}\
...
...
include/gtest/gtest-test-part.h
View file @
8965a6a0
...
...
@@ -96,6 +96,7 @@ class GTEST_API_ TestPartResult {
// Returns true iff the test part fatally failed.
bool
fatally_failed
()
const
{
return
type_
==
kFatalFailure
;
}
private:
Type
type_
;
...
...
include/gtest/gtest.h
View file @
8965a6a0
...
...
@@ -52,6 +52,7 @@
#define GTEST_INCLUDE_GTEST_GTEST_H_
#include <limits>
#include <ostream>
#include <vector>
#include "gtest/internal/gtest-internal.h"
...
...
@@ -672,7 +673,6 @@ class GTEST_API_ TestInfo {
const
TestResult
*
result
()
const
{
return
&
result_
;
}
private:
#if GTEST_HAS_DEATH_TEST
friend
class
internal
::
DefaultDeathTestFactory
;
#endif // GTEST_HAS_DEATH_TEST
...
...
@@ -1456,11 +1456,11 @@ GTEST_IMPL_CMP_HELPER_(NE, !=);
// Implements the helper function for {ASSERT|EXPECT}_LE
GTEST_IMPL_CMP_HELPER_
(
LE
,
<=
);
// Implements the helper function for {ASSERT|EXPECT}_LT
GTEST_IMPL_CMP_HELPER_
(
LT
,
<
);
GTEST_IMPL_CMP_HELPER_
(
LT
,
<
);
// Implements the helper function for {ASSERT|EXPECT}_GE
GTEST_IMPL_CMP_HELPER_
(
GE
,
>=
);
// Implements the helper function for {ASSERT|EXPECT}_GT
GTEST_IMPL_CMP_HELPER_
(
GT
,
>
);
GTEST_IMPL_CMP_HELPER_
(
GT
,
>
);
#undef GTEST_IMPL_CMP_HELPER_
...
...
include/gtest/gtest_pred_impl.h
View file @
8965a6a0
...
...
@@ -27,7 +27,7 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// This file is AUTOMATICALLY GENERATED on
09/24
/201
0
by command
// This file is AUTOMATICALLY GENERATED on
10/31
/201
1
by command
// 'gen_gtest_pred_impl.py 5'. DO NOT EDIT BY HAND!
//
// Implements a family of generic predicate assertion macros.
...
...
@@ -98,7 +98,7 @@ AssertionResult AssertPred1Helper(const char* pred_text,
// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT1.
// Don't use this in your code.
#define GTEST_PRED_FORMAT1_(pred_format, v1, on_failure)\
GTEST_ASSERT_(pred_format(#v1, v1),\
GTEST_ASSERT_(pred_format(#v1, v1),
\
on_failure)
// Internal macro for implementing {EXPECT|ASSERT}_PRED1. Don't use
...
...
@@ -144,7 +144,7 @@ AssertionResult AssertPred2Helper(const char* pred_text,
// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT2.
// Don't use this in your code.
#define GTEST_PRED_FORMAT2_(pred_format, v1, v2, on_failure)\
GTEST_ASSERT_(pred_format(#v1, #v2, v1, v2),\
GTEST_ASSERT_(pred_format(#v1, #v2, v1, v2),
\
on_failure)
// Internal macro for implementing {EXPECT|ASSERT}_PRED2. Don't use
...
...
@@ -197,7 +197,7 @@ AssertionResult AssertPred3Helper(const char* pred_text,
// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT3.
// Don't use this in your code.
#define GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, on_failure)\
GTEST_ASSERT_(pred_format(#v1, #v2, #v3, v1, v2, v3),\
GTEST_ASSERT_(pred_format(#v1, #v2, #v3, v1, v2, v3),
\
on_failure)
// Internal macro for implementing {EXPECT|ASSERT}_PRED3. Don't use
...
...
@@ -257,7 +257,7 @@ AssertionResult AssertPred4Helper(const char* pred_text,
// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT4.
// Don't use this in your code.
#define GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, on_failure)\
GTEST_ASSERT_(pred_format(#v1, #v2, #v3, #v4, v1, v2, v3, v4),\
GTEST_ASSERT_(pred_format(#v1, #v2, #v3, #v4, v1, v2, v3, v4),
\
on_failure)
// Internal macro for implementing {EXPECT|ASSERT}_PRED4. Don't use
...
...
@@ -324,7 +324,7 @@ AssertionResult AssertPred5Helper(const char* pred_text,
// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT5.
// Don't use this in your code.
#define GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, on_failure)\
GTEST_ASSERT_(pred_format(#v1, #v2, #v3, #v4, #v5, v1, v2, v3, v4, v5),\
GTEST_ASSERT_(pred_format(#v1, #v2, #v3, #v4, #v5, v1, v2, v3, v4, v5),
\
on_failure)
// Internal macro for implementing {EXPECT|ASSERT}_PRED5. Don't use
...
...
include/gtest/internal/gtest-port.h
View file @
8965a6a0
...
...
@@ -812,6 +812,7 @@ class scoped_ptr {
ptr_
=
p
;
}
}
private:
T
*
ptr_
;
...
...
@@ -1110,7 +1111,7 @@ class Notification {
// Blocks until the controller thread notifies. Must be called from a test
// thread.
void
WaitForNotification
()
{
while
(
!
notified_
)
{
while
(
!
notified_
)
{
SleepMilliseconds
(
10
);
}
}
...
...
@@ -1754,7 +1755,6 @@ class TypeWithSize<4> {
template
<>
class
TypeWithSize
<
8
>
{
public:
#if GTEST_OS_WINDOWS
typedef
__int64
Int
;
typedef
unsigned
__int64
UInt
;
...
...
include/gtest/internal/gtest-string.h
View file @
8965a6a0
...
...
@@ -47,10 +47,10 @@
#endif
#include <string.h>
#include "gtest/internal/gtest-port.h"
#include <string>
#include "gtest/internal/gtest-port.h"
namespace
testing
{
namespace
internal
{
...
...
@@ -223,14 +223,14 @@ class GTEST_API_ String {
// Converting a ::std::string or ::string containing an embedded NUL
// character to a String will result in the prefix up to the first
// NUL character.
String
(
const
::
std
::
string
&
str
)
{
String
(
const
::
std
::
string
&
str
)
{
// NOLINT
ConstructNonNull
(
str
.
c_str
(),
str
.
length
());
}
operator
::
std
::
string
()
const
{
return
::
std
::
string
(
c_str
(),
length
());
}
#if GTEST_HAS_GLOBAL_STRING
String
(
const
::
string
&
str
)
{
String
(
const
::
string
&
str
)
{
// NOLINT
ConstructNonNull
(
str
.
c_str
(),
str
.
length
());
}
...
...
include/gtest/internal/gtest-tuple.h
View file @
8965a6a0
// This file was GENERATED by a script. DO NOT EDIT BY HAND!!!
// This file was GENERATED by command:
// pump.py gtest-tuple.h.pump
// DO NOT EDIT BY HAND!!!
// Copyright 2009 Google Inc.
// All Rights Reserved.
...
...
@@ -140,34 +142,54 @@ template <bool kIndexValid, int kIndex, class Tuple>
struct
TupleElement
;
template
<
GTEST_10_TYPENAMES_
(
T
)>
struct
TupleElement
<
true
,
0
,
GTEST_10_TUPLE_
(
T
)
>
{
typedef
T0
type
;
};
struct
TupleElement
<
true
,
0
,
GTEST_10_TUPLE_
(
T
)
>
{
typedef
T0
type
;
};
template
<
GTEST_10_TYPENAMES_
(
T
)>
struct
TupleElement
<
true
,
1
,
GTEST_10_TUPLE_
(
T
)
>
{
typedef
T1
type
;
};
struct
TupleElement
<
true
,
1
,
GTEST_10_TUPLE_
(
T
)
>
{
typedef
T1
type
;
};
template
<
GTEST_10_TYPENAMES_
(
T
)>
struct
TupleElement
<
true
,
2
,
GTEST_10_TUPLE_
(
T
)
>
{
typedef
T2
type
;
};
struct
TupleElement
<
true
,
2
,
GTEST_10_TUPLE_
(
T
)
>
{
typedef
T2
type
;
};
template
<
GTEST_10_TYPENAMES_
(
T
)>
struct
TupleElement
<
true
,
3
,
GTEST_10_TUPLE_
(
T
)
>
{
typedef
T3
type
;
};
struct
TupleElement
<
true
,
3
,
GTEST_10_TUPLE_
(
T
)
>
{
typedef
T3
type
;
};
template
<
GTEST_10_TYPENAMES_
(
T
)>
struct
TupleElement
<
true
,
4
,
GTEST_10_TUPLE_
(
T
)
>
{
typedef
T4
type
;
};
struct
TupleElement
<
true
,
4
,
GTEST_10_TUPLE_
(
T
)
>
{
typedef
T4
type
;
};
template
<
GTEST_10_TYPENAMES_
(
T
)>
struct
TupleElement
<
true
,
5
,
GTEST_10_TUPLE_
(
T
)
>
{
typedef
T5
type
;
};
struct
TupleElement
<
true
,
5
,
GTEST_10_TUPLE_
(
T
)
>
{
typedef
T5
type
;
};
template
<
GTEST_10_TYPENAMES_
(
T
)>
struct
TupleElement
<
true
,
6
,
GTEST_10_TUPLE_
(
T
)
>
{
typedef
T6
type
;
};
struct
TupleElement
<
true
,
6
,
GTEST_10_TUPLE_
(
T
)
>
{
typedef
T6
type
;
};
template
<
GTEST_10_TYPENAMES_
(
T
)>
struct
TupleElement
<
true
,
7
,
GTEST_10_TUPLE_
(
T
)
>
{
typedef
T7
type
;
};
struct
TupleElement
<
true
,
7
,
GTEST_10_TUPLE_
(
T
)
>
{
typedef
T7
type
;
};
template
<
GTEST_10_TYPENAMES_
(
T
)>
struct
TupleElement
<
true
,
8
,
GTEST_10_TUPLE_
(
T
)
>
{
typedef
T8
type
;
};
struct
TupleElement
<
true
,
8
,
GTEST_10_TUPLE_
(
T
)
>
{
typedef
T8
type
;
};
template
<
GTEST_10_TYPENAMES_
(
T
)>
struct
TupleElement
<
true
,
9
,
GTEST_10_TUPLE_
(
T
)
>
{
typedef
T9
type
;
};
struct
TupleElement
<
true
,
9
,
GTEST_10_TUPLE_
(
T
)
>
{
typedef
T9
type
;
};
}
// namespace gtest_internal
...
...
@@ -708,37 +730,59 @@ inline GTEST_10_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
template
<
typename
Tuple
>
struct
tuple_size
;
template
<
GTEST_0_TYPENAMES_
(
T
)>
struct
tuple_size
<
GTEST_0_TUPLE_
(
T
)
>
{
static
const
int
value
=
0
;
};
struct
tuple_size
<
GTEST_0_TUPLE_
(
T
)
>
{
static
const
int
value
=
0
;
};
template
<
GTEST_1_TYPENAMES_
(
T
)>
struct
tuple_size
<
GTEST_1_TUPLE_
(
T
)
>
{
static
const
int
value
=
1
;
};
struct
tuple_size
<
GTEST_1_TUPLE_
(
T
)
>
{
static
const
int
value
=
1
;
};
template
<
GTEST_2_TYPENAMES_
(
T
)>
struct
tuple_size
<
GTEST_2_TUPLE_
(
T
)
>
{
static
const
int
value
=
2
;
};
struct
tuple_size
<
GTEST_2_TUPLE_
(
T
)
>
{
static
const
int
value
=
2
;
};
template
<
GTEST_3_TYPENAMES_
(
T
)>
struct
tuple_size
<
GTEST_3_TUPLE_
(
T
)
>
{
static
const
int
value
=
3
;
};
struct
tuple_size
<
GTEST_3_TUPLE_
(
T
)
>
{
static
const
int
value
=
3
;
};
template
<
GTEST_4_TYPENAMES_
(
T
)>
struct
tuple_size
<
GTEST_4_TUPLE_
(
T
)
>
{
static
const
int
value
=
4
;
};
struct
tuple_size
<
GTEST_4_TUPLE_
(
T
)
>
{
static
const
int
value
=
4
;
};
template
<
GTEST_5_TYPENAMES_
(
T
)>
struct
tuple_size
<
GTEST_5_TUPLE_
(
T
)
>
{
static
const
int
value
=
5
;
};
struct
tuple_size
<
GTEST_5_TUPLE_
(
T
)
>
{
static
const
int
value
=
5
;
};
template
<
GTEST_6_TYPENAMES_
(
T
)>
struct
tuple_size
<
GTEST_6_TUPLE_
(
T
)
>
{
static
const
int
value
=
6
;
};
struct
tuple_size
<
GTEST_6_TUPLE_
(
T
)
>
{
static
const
int
value
=
6
;
};
template
<
GTEST_7_TYPENAMES_
(
T
)>
struct
tuple_size
<
GTEST_7_TUPLE_
(
T
)
>
{
static
const
int
value
=
7
;
};
struct
tuple_size
<
GTEST_7_TUPLE_
(
T
)
>
{
static
const
int
value
=
7
;
};
template
<
GTEST_8_TYPENAMES_
(
T
)>
struct
tuple_size
<
GTEST_8_TUPLE_
(
T
)
>
{
static
const
int
value
=
8
;
};
struct
tuple_size
<
GTEST_8_TUPLE_
(
T
)
>
{
static
const
int
value
=
8
;
};
template
<
GTEST_9_TYPENAMES_
(
T
)>
struct
tuple_size
<
GTEST_9_TUPLE_
(
T
)
>
{
static
const
int
value
=
9
;
};
struct
tuple_size
<
GTEST_9_TUPLE_
(
T
)
>
{
static
const
int
value
=
9
;
};
template
<
GTEST_10_TYPENAMES_
(
T
)>
struct
tuple_size
<
GTEST_10_TUPLE_
(
T
)
>
{
static
const
int
value
=
10
;
};
struct
tuple_size
<
GTEST_10_TUPLE_
(
T
)
>
{
static
const
int
value
=
10
;
};
template
<
int
k
,
class
Tuple
>
struct
tuple_element
{
...
...
include/gtest/internal/gtest-tuple.h.pump
View file @
8965a6a0
...
...
@@ -118,8 +118,9 @@ struct TupleElement;
$
for
i
[[
template
<
GTEST_
$
(
n
)
_TYPENAMES_
(
T
)>
struct
TupleElement
<
true
,
$
i
,
GTEST_
$
(
n
)
_TUPLE_
(
T
)
>
[[]]
{
typedef
T
$
i
type
;
};
struct
TupleElement
<
true
,
$
i
,
GTEST_
$
(
n
)
_TUPLE_
(
T
)
>
{
typedef
T
$
i
type
;
};
]]
...
...
@@ -220,7 +221,9 @@ template <typename Tuple> struct tuple_size;
$
for
j
[[
template
<
GTEST_
$
(
j
)
_TYPENAMES_
(
T
)>
struct
tuple_size
<
GTEST_
$
(
j
)
_TUPLE_
(
T
)
>
{
static
const
int
value
=
$
j
;
};
struct
tuple_size
<
GTEST_
$
(
j
)
_TUPLE_
(
T
)
>
{
static
const
int
value
=
$
j
;
};
]]
...
...
include/gtest/internal/gtest-type-util.h
View file @
8965a6a0
...
...
@@ -3300,7 +3300,9 @@ struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
// INSTANTIATE_TYPED_TEST_CASE_P().
template
<
typename
T
>
struct
TypeList
{
typedef
Types1
<
T
>
type
;
};
struct
TypeList
{
typedef
Types1
<
T
>
type
;
};
template
<
typename
T1
,
typename
T2
,
typename
T3
,
typename
T4
,
typename
T5
,
typename
T6
,
typename
T7
,
typename
T8
,
typename
T9
,
typename
T10
,
...
...
include/gtest/internal/gtest-type-util.h.pump
View file @
8965a6a0
...
...
@@ -279,7 +279,9 @@ struct Templates<$for j, [[T$j]]$for k[[, NoneT]]> {
// INSTANTIATE_TYPED_TEST_CASE_P().
template
<
typename
T
>
struct
TypeList
{
typedef
Types1
<
T
>
type
;
};
struct
TypeList
{
typedef
Types1
<
T
>
type
;
};
$
range
i
1.
.
n
...
...
samples/sample10_unittest.cc
View file @
8965a6a0
...
...
@@ -89,8 +89,7 @@ class LeakChecker : public EmptyTestEventListener {
// You can generate a failure in any event handler except
// OnTestPartResult. Just use an appropriate Google Test assertion to do
// it.
EXPECT_TRUE
(
difference
<=
0
)
<<
"Leaked "
<<
difference
<<
" unit(s) of Water!"
;
EXPECT_LE
(
difference
,
0
)
<<
"Leaked "
<<
difference
<<
" unit(s) of Water!"
;
}
int
initially_allocated_
;
...
...
samples/sample1_unittest.cc
View file @
8965a6a0
...
...
@@ -81,7 +81,7 @@ TEST(FactorialTest, Negative) {
// test case.
EXPECT_EQ
(
1
,
Factorial
(
-
5
));
EXPECT_EQ
(
1
,
Factorial
(
-
1
));
EXPECT_T
RUE
(
Factorial
(
-
10
)
>
0
);
EXPECT_
G
T
(
Factorial
(
-
10
)
,
0
);
// <TechnicalDetails>
//
...
...
samples/sample2.h
View file @
8965a6a0
...
...
@@ -44,7 +44,6 @@ class MyString {
const
MyString
&
operator
=
(
const
MyString
&
rhs
);
public:
// Clones a 0-terminated C string, allocating memory using new.
static
const
char
*
CloneCString
(
const
char
*
a_c_string
);
...
...
samples/sample2_unittest.cc
View file @
8965a6a0
...
...
@@ -79,7 +79,7 @@ const char kHelloString[] = "Hello, world!";
// Tests the c'tor that accepts a C string.
TEST
(
MyString
,
ConstructorFromCString
)
{
const
MyString
s
(
kHelloString
);
EXPECT_
TRUE
(
strcmp
(
s
.
c_string
(),
kHelloString
)
==
0
);
EXPECT_
EQ
(
0
,
strcmp
(
s
.
c_string
(),
kHelloString
));
EXPECT_EQ
(
sizeof
(
kHelloString
)
/
sizeof
(
kHelloString
[
0
])
-
1
,
s
.
Length
());
}
...
...
@@ -88,7 +88,7 @@ TEST(MyString, ConstructorFromCString) {
TEST
(
MyString
,
CopyConstructor
)
{
const
MyString
s1
(
kHelloString
);
const
MyString
s2
=
s1
;
EXPECT_
TRUE
(
strcmp
(
s2
.
c_string
(),
kHelloString
)
==
0
);
EXPECT_
EQ
(
0
,
strcmp
(
s2
.
c_string
(),
kHelloString
));
}
// Tests the Set method.
...
...
@@ -96,12 +96,12 @@ TEST(MyString, Set) {
MyString
s
;
s
.
Set
(
kHelloString
);
EXPECT_
TRUE
(
strcmp
(
s
.
c_string
(),
kHelloString
)
==
0
);
EXPECT_
EQ
(
0
,
strcmp
(
s
.
c_string
(),
kHelloString
));
// Set should work when the input pointer is the same as the one
// already in the MyString object.
s
.
Set
(
s
.
c_string
());
EXPECT_
TRUE
(
strcmp
(
s
.
c_string
(),
kHelloString
)
==
0
);
EXPECT_
EQ
(
0
,
strcmp
(
s
.
c_string
(),
kHelloString
));
// Can we set the MyString to NULL?
s
.
Set
(
NULL
);
...
...
samples/sample3-inl.h
View file @
8965a6a0
...
...
@@ -60,7 +60,7 @@ class QueueNode {
private:
// Creates a node with a given element value. The next pointer is
// set to NULL.
QueueNode
(
const
E
&
an_element
)
:
element_
(
an_element
),
next_
(
NULL
)
{}
explicit
QueueNode
(
const
E
&
an_element
)
:
element_
(
an_element
),
next_
(
NULL
)
{}
// We disable the default assignment operator and copy c'tor.
const
QueueNode
&
operator
=
(
const
QueueNode
&
);
...
...
@@ -72,8 +72,7 @@ class QueueNode {
template
<
typename
E
>
// E is the element type.
class
Queue
{
public:
public:
// Creates an empty queue.
Queue
()
:
head_
(
NULL
),
last_
(
NULL
),
size_
(
0
)
{}
...
...
@@ -168,6 +167,6 @@ public:
// We disallow copying a queue.
Queue
(
const
Queue
&
);
const
Queue
&
operator
=
(
const
Queue
&
);
};
};
#endif // GTEST_SAMPLES_SAMPLE3_INL_H_
samples/sample5_unittest.cc
View file @
8965a6a0
...
...
@@ -101,7 +101,7 @@ TEST_F(IntegerFunctionTest, Factorial) {
// Tests factorial of negative numbers.
EXPECT_EQ
(
1
,
Factorial
(
-
5
));
EXPECT_EQ
(
1
,
Factorial
(
-
1
));
EXPECT_T
RUE
(
Factorial
(
-
10
)
>
0
);
EXPECT_
G
T
(
Factorial
(
-
10
)
,
0
);
// Tests factorial of 0.
EXPECT_EQ
(
1
,
Factorial
(
0
));
...
...
scripts/gen_gtest_pred_impl.py
View file @
8965a6a0
...
...
@@ -117,7 +117,7 @@ def HeaderPreamble(n):
// Makes sure this header is not included before gtest.h.
#ifndef GTEST_INCLUDE_GTEST_GTEST_H_
#error Do not include gtest_pred_impl.h directly. Include gtest.h instead.
#
error Do not include gtest_pred_impl.h directly. Include gtest.h instead.
#endif // GTEST_INCLUDE_GTEST_GTEST_H_
// This header implements a family of generic predicate assertion
...
...
@@ -256,7 +256,7 @@ AssertionResult AssertPred%(n)sHelper(const char* pred_text""" % DEFS
// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT%(n)s.
// Don't use this in your code.
#define GTEST_PRED_FORMAT%(n)s_(pred_format, %(vs)s, on_failure)
\\
GTEST_ASSERT_(pred_format(%(vts)s, %(vs)s),
\\
GTEST_ASSERT_(pred_format(%(vts)s, %(vs)s),
\\
on_failure)
// Internal macro for implementing {EXPECT|ASSERT}_PRED%(n)s. Don't use
...
...
src/gtest-death-test.cc
View file @
8965a6a0
...
...
@@ -913,6 +913,7 @@ class Arguments {
char
*
const
*
Argv
()
{
return
&
args_
[
0
];
}
private:
std
::
vector
<
char
*>
args_
;
};
...
...
src/gtest-internal-inl.h
View file @
8965a6a0
...
...
@@ -196,6 +196,7 @@ class GTestFlagSaver {
GTEST_FLAG
(
stream_result_to
)
=
stream_result_to_
;
GTEST_FLAG
(
throw_on_failure
)
=
throw_on_failure_
;
}
private:
// Fields for saving the original values of flags.
bool
also_run_disabled_tests_
;
...
...
src/gtest-port.cc
View file @
8965a6a0
...
...
@@ -514,7 +514,6 @@ class CapturedStream {
public:
// The ctor redirects the stream to a temporary file.
CapturedStream
(
int
fd
)
:
fd_
(
fd
),
uncaptured_fd_
(
dup
(
fd
))
{
# if GTEST_OS_WINDOWS
char
temp_dir_path
[
MAX_PATH
+
1
]
=
{
'\0'
};
// NOLINT
char
temp_file_path
[
MAX_PATH
+
1
]
=
{
'\0'
};
// NOLINT
...
...
Prev
1
2
Next
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