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
bf6df7ea
Commit
bf6df7ea
authored
Jul 26, 2019
by
Krystian Kuzniarek
Browse files
fix typos
parent
2134e3fd
Changes
42
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
108 additions
and
108 deletions
+108
-108
CONTRIBUTING.md
CONTRIBUTING.md
+1
-1
googlemock/docs/cheat_sheet.md
googlemock/docs/cheat_sheet.md
+2
-2
googlemock/docs/cook_book.md
googlemock/docs/cook_book.md
+6
-6
googlemock/include/gmock/gmock-actions.h
googlemock/include/gmock/gmock-actions.h
+5
-5
googlemock/include/gmock/gmock-cardinalities.h
googlemock/include/gmock/gmock-cardinalities.h
+5
-5
googlemock/include/gmock/gmock-matchers.h
googlemock/include/gmock/gmock-matchers.h
+12
-12
googlemock/include/gmock/gmock-spec-builders.h
googlemock/include/gmock/gmock-spec-builders.h
+14
-14
googlemock/include/gmock/internal/gmock-internal-utils.h
googlemock/include/gmock/internal/gmock-internal-utils.h
+9
-9
googlemock/scripts/upload.py
googlemock/scripts/upload.py
+1
-1
googlemock/src/gmock-internal-utils.cc
googlemock/src/gmock-internal-utils.cc
+2
-2
googlemock/src/gmock-spec-builders.cc
googlemock/src/gmock-spec-builders.cc
+5
-5
googlemock/src/gmock.cc
googlemock/src/gmock.cc
+1
-1
googlemock/test/gmock-cardinalities_test.cc
googlemock/test/gmock-cardinalities_test.cc
+2
-2
googlemock/test/gmock-matchers_test.cc
googlemock/test/gmock-matchers_test.cc
+3
-3
googlemock/test/gmock-spec-builders_test.cc
googlemock/test/gmock-spec-builders_test.cc
+2
-2
googletest/include/gtest/gtest-death-test.h
googletest/include/gtest/gtest-death-test.h
+2
-2
googletest/include/gtest/gtest-matchers.h
googletest/include/gtest/gtest-matchers.h
+4
-4
googletest/include/gtest/gtest-test-part.h
googletest/include/gtest/gtest-test-part.h
+5
-5
googletest/include/gtest/gtest.h
googletest/include/gtest/gtest.h
+26
-26
googletest/include/gtest/internal/gtest-filepath.h
googletest/include/gtest/internal/gtest-filepath.h
+1
-1
No files found.
CONTRIBUTING.md
View file @
bf6df7ea
...
@@ -21,7 +21,7 @@ accept your pull requests.
...
@@ -21,7 +21,7 @@ accept your pull requests.
## Are you a Googler?
## Are you a Googler?
If you are a Googler, plese make an attempt to submit an internal change rather
If you are a Googler, ple
a
se make an attempt to submit an internal change rather
than a GitHub Pull Request. If you are not able to submit an internal change a
than a GitHub Pull Request. If you are not able to submit an internal change a
PR is acceptable as an alternative.
PR is acceptable as an alternative.
...
...
googlemock/docs/cheat_sheet.md
View file @
bf6df7ea
...
@@ -857,12 +857,12 @@ you can do it earlier:
...
@@ -857,12 +857,12 @@ you can do it earlier:
using ::testing::Mock;
using ::testing::Mock;
...
...
// Verifies and removes the expectations on mock_obj;
// Verifies and removes the expectations on mock_obj;
// returns true if
f
successful.
// returns true if successful.
Mock::VerifyAndClearExpectations(&mock_obj);
Mock::VerifyAndClearExpectations(&mock_obj);
...
...
// Verifies and removes the expectations on mock_obj;
// Verifies and removes the expectations on mock_obj;
// also removes the default actions set by ON_CALL();
// also removes the default actions set by ON_CALL();
// returns true if
f
successful.
// returns true if successful.
Mock::VerifyAndClear(&mock_obj);
Mock::VerifyAndClear(&mock_obj);
```
```
...
...
googlemock/docs/cook_book.md
View file @
bf6df7ea
...
@@ -1037,7 +1037,7 @@ arguments as *one* single tuple to the predicate.
...
@@ -1037,7 +1037,7 @@ arguments as *one* single tuple to the predicate.
Have you noticed that a matcher is just a fancy predicate that also knows how to
Have you noticed that a matcher is just a fancy predicate that also knows how to
describe itself? Many existing algorithms take predicates as arguments (e.g.
describe itself? Many existing algorithms take predicates as arguments (e.g.
those defined in STL's
`<algorithm>`
header), and it would be a shame if gMock
those defined in STL's
`<algorithm>`
header), and it would be a shame if gMock
matchers
a
re not allowed to participate.
matchers
we
re not allowed to participate.
Luckily, you can use a matcher where a unary predicate functor is expected by
Luckily, you can use a matcher where a unary predicate functor is expected by
wrapping it inside the
`Matches()`
function. For example,
wrapping it inside the
`Matches()`
function. For example,
...
@@ -1242,7 +1242,7 @@ what if you want to make sure the value *pointed to* by the pointer, instead of
...
@@ -1242,7 +1242,7 @@ what if you want to make sure the value *pointed to* by the pointer, instead of
the pointer itself, has a certain property? Well, you can use the
`Pointee(m)`
the pointer itself, has a certain property? Well, you can use the
`Pointee(m)`
matcher.
matcher.
`Pointee(m)`
matches a pointer if
f
`m`
matches the value the pointer points to.
`Pointee(m)`
matches a pointer if
`m`
matches the value the pointer points to.
For example:
For example:
```
cpp
```
cpp
...
@@ -2596,7 +2596,7 @@ However, if the action has its own state, you may be surprised if you share the
...
@@ -2596,7 +2596,7 @@ However, if the action has its own state, you may be surprised if you share the
action object. Suppose you have an action factory
`IncrementCounter(init)`
which
action object. Suppose you have an action factory
`IncrementCounter(init)`
which
creates an action that increments and returns a counter whose initial value is
creates an action that increments and returns a counter whose initial value is
`init`
, using two actions created from the same expression and using a shared
`init`
, using two actions created from the same expression and using a shared
action will ex
i
hibit different behaviors. Example:
action will exhibit different behaviors. Example:
```
cpp
```
cpp
EXPECT_CALL
(
foo
,
DoThis
())
EXPECT_CALL
(
foo
,
DoThis
())
...
@@ -3539,7 +3539,7 @@ class MatcherInterface {
...
@@ -3539,7 +3539,7 @@ class MatcherInterface {
public:
public:
virtual ~MatcherInterface();
virtual ~MatcherInterface();
// Returns true if
f
the matcher matches x; also explains the match
// Returns true if the matcher matches x; also explains the match
// result to 'listener'.
// result to 'listener'.
virtual bool MatchAndExplain(T x, MatchResultListener* listener) const = 0;
virtual bool MatchAndExplain(T x, MatchResultListener* listener) const = 0;
...
@@ -3693,10 +3693,10 @@ class CardinalityInterface {
...
@@ -3693,10 +3693,10 @@ class CardinalityInterface {
public:
public:
virtual ~CardinalityInterface();
virtual ~CardinalityInterface();
// Returns true if
f
call_count calls will satisfy this cardinality.
// Returns true if call_count calls will satisfy this cardinality.
virtual bool IsSatisfiedByCallCount(int call_count) const = 0;
virtual bool IsSatisfiedByCallCount(int call_count) const = 0;
// Returns true if
f
call_count calls will saturate this cardinality.
// Returns true if call_count calls will saturate this cardinality.
virtual bool IsSaturatedByCallCount(int call_count) const = 0;
virtual bool IsSaturatedByCallCount(int call_count) const = 0;
// Describes self to an ostream.
// Describes self to an ostream.
...
...
googlemock/include/gmock/gmock-actions.h
View file @
bf6df7ea
...
@@ -99,7 +99,7 @@ struct BuiltInDefaultValueGetter<T, false> {
...
@@ -99,7 +99,7 @@ struct BuiltInDefaultValueGetter<T, false> {
template
<
typename
T
>
template
<
typename
T
>
class
BuiltInDefaultValue
{
class
BuiltInDefaultValue
{
public:
public:
// This function returns true if
f
type T has a built-in default value.
// This function returns true if type T has a built-in default value.
static
bool
Exists
()
{
static
bool
Exists
()
{
return
::
std
::
is_default_constructible
<
T
>::
value
;
return
::
std
::
is_default_constructible
<
T
>::
value
;
}
}
...
@@ -208,7 +208,7 @@ class DefaultValue {
...
@@ -208,7 +208,7 @@ class DefaultValue {
producer_
=
nullptr
;
producer_
=
nullptr
;
}
}
// Returns true if
f
the user has set the default value for type T.
// Returns true if the user has set the default value for type T.
static
bool
IsSet
()
{
return
producer_
!=
nullptr
;
}
static
bool
IsSet
()
{
return
producer_
!=
nullptr
;
}
// Returns true if T has a default return value set by the user or there
// Returns true if T has a default return value set by the user or there
...
@@ -269,7 +269,7 @@ class DefaultValue<T&> {
...
@@ -269,7 +269,7 @@ class DefaultValue<T&> {
// Unsets the default value for type T&.
// Unsets the default value for type T&.
static
void
Clear
()
{
address_
=
nullptr
;
}
static
void
Clear
()
{
address_
=
nullptr
;
}
// Returns true if
f
the user has set the default value for type T&.
// Returns true if the user has set the default value for type T&.
static
bool
IsSet
()
{
return
address_
!=
nullptr
;
}
static
bool
IsSet
()
{
return
address_
!=
nullptr
;
}
// Returns true if T has a default return value set by the user or there
// Returns true if T has a default return value set by the user or there
...
@@ -375,7 +375,7 @@ class Action {
...
@@ -375,7 +375,7 @@ class Action {
template
<
typename
Func
>
template
<
typename
Func
>
explicit
Action
(
const
Action
<
Func
>&
action
)
:
fun_
(
action
.
fun_
)
{}
explicit
Action
(
const
Action
<
Func
>&
action
)
:
fun_
(
action
.
fun_
)
{}
// Returns true if
f
this is the DoDefault() action.
// Returns true if this is the DoDefault() action.
bool
IsDoDefault
()
const
{
return
fun_
==
nullptr
;
}
bool
IsDoDefault
()
const
{
return
fun_
==
nullptr
;
}
// Performs the action. Note that this method is const even though
// Performs the action. Note that this method is const even though
...
@@ -395,7 +395,7 @@ class Action {
...
@@ -395,7 +395,7 @@ class Action {
template
<
typename
G
>
template
<
typename
G
>
friend
class
Action
;
friend
class
Action
;
// fun_ is an empty function if
f
this is the DoDefault() action.
// fun_ is an empty function if this is the DoDefault() action.
::
std
::
function
<
F
>
fun_
;
::
std
::
function
<
F
>
fun_
;
};
};
...
...
googlemock/include/gmock/gmock-cardinalities.h
View file @
bf6df7ea
...
@@ -70,10 +70,10 @@ class CardinalityInterface {
...
@@ -70,10 +70,10 @@ class CardinalityInterface {
virtual
int
ConservativeLowerBound
()
const
{
return
0
;
}
virtual
int
ConservativeLowerBound
()
const
{
return
0
;
}
virtual
int
ConservativeUpperBound
()
const
{
return
INT_MAX
;
}
virtual
int
ConservativeUpperBound
()
const
{
return
INT_MAX
;
}
// Returns true if
f
call_count calls will satisfy this cardinality.
// Returns true if call_count calls will satisfy this cardinality.
virtual
bool
IsSatisfiedByCallCount
(
int
call_count
)
const
=
0
;
virtual
bool
IsSatisfiedByCallCount
(
int
call_count
)
const
=
0
;
// Returns true if
f
call_count calls will saturate this cardinality.
// Returns true if call_count calls will saturate this cardinality.
virtual
bool
IsSaturatedByCallCount
(
int
call_count
)
const
=
0
;
virtual
bool
IsSaturatedByCallCount
(
int
call_count
)
const
=
0
;
// Describes self to an ostream.
// Describes self to an ostream.
...
@@ -98,17 +98,17 @@ class GTEST_API_ Cardinality {
...
@@ -98,17 +98,17 @@ class GTEST_API_ Cardinality {
int
ConservativeLowerBound
()
const
{
return
impl_
->
ConservativeLowerBound
();
}
int
ConservativeLowerBound
()
const
{
return
impl_
->
ConservativeLowerBound
();
}
int
ConservativeUpperBound
()
const
{
return
impl_
->
ConservativeUpperBound
();
}
int
ConservativeUpperBound
()
const
{
return
impl_
->
ConservativeUpperBound
();
}
// Returns true if
f
call_count calls will satisfy this cardinality.
// Returns true if call_count calls will satisfy this cardinality.
bool
IsSatisfiedByCallCount
(
int
call_count
)
const
{
bool
IsSatisfiedByCallCount
(
int
call_count
)
const
{
return
impl_
->
IsSatisfiedByCallCount
(
call_count
);
return
impl_
->
IsSatisfiedByCallCount
(
call_count
);
}
}
// Returns true if
f
call_count calls will saturate this cardinality.
// Returns true if call_count calls will saturate this cardinality.
bool
IsSaturatedByCallCount
(
int
call_count
)
const
{
bool
IsSaturatedByCallCount
(
int
call_count
)
const
{
return
impl_
->
IsSaturatedByCallCount
(
call_count
);
return
impl_
->
IsSaturatedByCallCount
(
call_count
);
}
}
// Returns true if
f
call_count calls will over-saturate this
// Returns true if call_count calls will over-saturate this
// cardinality, i.e. exceed the maximum number of allowed calls.
// cardinality, i.e. exceed the maximum number of allowed calls.
bool
IsOverSaturatedByCallCount
(
int
call_count
)
const
{
bool
IsOverSaturatedByCallCount
(
int
call_count
)
const
{
return
impl_
->
IsSaturatedByCallCount
(
call_count
)
&&
return
impl_
->
IsSaturatedByCallCount
(
call_count
)
&&
...
...
googlemock/include/gmock/gmock-matchers.h
View file @
bf6df7ea
...
@@ -361,7 +361,7 @@ template <size_t N>
...
@@ -361,7 +361,7 @@ template <size_t N>
class
TuplePrefix
{
class
TuplePrefix
{
public:
public:
// TuplePrefix<N>::Matches(matcher_tuple, value_tuple) returns true
// TuplePrefix<N>::Matches(matcher_tuple, value_tuple) returns true
// if
f
the first N fields of matcher_tuple matches the first N
// if the first N fields of matcher_tuple matches the first N
// fields of value_tuple, respectively.
// fields of value_tuple, respectively.
template
<
typename
MatcherTuple
,
typename
ValueTuple
>
template
<
typename
MatcherTuple
,
typename
ValueTuple
>
static
bool
Matches
(
const
MatcherTuple
&
matcher_tuple
,
static
bool
Matches
(
const
MatcherTuple
&
matcher_tuple
,
...
@@ -420,7 +420,7 @@ class TuplePrefix<0> {
...
@@ -420,7 +420,7 @@ class TuplePrefix<0> {
::
std
::
ostream
*
/* os */
)
{}
::
std
::
ostream
*
/* os */
)
{}
};
};
// TupleMatches(matcher_tuple, value_tuple) returns true if
f
all
// TupleMatches(matcher_tuple, value_tuple) returns true if all
// matchers in matcher_tuple match the corresponding fields in
// matchers in matcher_tuple match the corresponding fields in
// value_tuple. It is a compiler error if matcher_tuple and
// value_tuple. It is a compiler error if matcher_tuple and
// value_tuple have different number of fields or incompatible field
// value_tuple have different number of fields or incompatible field
...
@@ -2534,7 +2534,7 @@ class KeyMatcherImpl : public MatcherInterface<PairType> {
...
@@ -2534,7 +2534,7 @@ class KeyMatcherImpl : public MatcherInterface<PairType> {
testing
::
SafeMatcherCast
<
const
KeyType
&>
(
inner_matcher
))
{
testing
::
SafeMatcherCast
<
const
KeyType
&>
(
inner_matcher
))
{
}
}
// Returns true if
f
'key_value.first' (the key) matches the inner matcher.
// Returns true if 'key_value.first' (the key) matches the inner matcher.
bool
MatchAndExplain
(
PairType
key_value
,
bool
MatchAndExplain
(
PairType
key_value
,
MatchResultListener
*
listener
)
const
override
{
MatchResultListener
*
listener
)
const
override
{
StringMatchResultListener
inner_listener
;
StringMatchResultListener
inner_listener
;
...
@@ -2616,7 +2616,7 @@ class PairMatcherImpl : public MatcherInterface<PairType> {
...
@@ -2616,7 +2616,7 @@ class PairMatcherImpl : public MatcherInterface<PairType> {
second_matcher_
.
DescribeNegationTo
(
os
);
second_matcher_
.
DescribeNegationTo
(
os
);
}
}
// Returns true if
f
'a_pair.first' matches first_matcher and 'a_pair.second'
// Returns true if 'a_pair.first' matches first_matcher and 'a_pair.second'
// matches second_matcher.
// matches second_matcher.
bool
MatchAndExplain
(
PairType
a_pair
,
bool
MatchAndExplain
(
PairType
a_pair
,
MatchResultListener
*
listener
)
const
override
{
MatchResultListener
*
listener
)
const
override
{
...
@@ -3152,7 +3152,7 @@ class ElementsAreArrayMatcher {
...
@@ -3152,7 +3152,7 @@ class ElementsAreArrayMatcher {
// Given a 2-tuple matcher tm of type Tuple2Matcher and a value second
// Given a 2-tuple matcher tm of type Tuple2Matcher and a value second
// of type Second, BoundSecondMatcher<Tuple2Matcher, Second>(tm,
// of type Second, BoundSecondMatcher<Tuple2Matcher, Second>(tm,
// second) is a polymorphic matcher that matches a value x if
f
tm
// second) is a polymorphic matcher that matches a value x if tm
// matches tuple (x, second). Useful for implementing
// matches tuple (x, second). Useful for implementing
// UnorderedPointwise() in terms of UnorderedElementsAreArray().
// UnorderedPointwise() in terms of UnorderedElementsAreArray().
//
//
...
@@ -3217,7 +3217,7 @@ class BoundSecondMatcher {
...
@@ -3217,7 +3217,7 @@ class BoundSecondMatcher {
// Given a 2-tuple matcher tm and a value second,
// Given a 2-tuple matcher tm and a value second,
// MatcherBindSecond(tm, second) returns a matcher that matches a
// MatcherBindSecond(tm, second) returns a matcher that matches a
// value x if
f
tm matches tuple (x, second). Useful for implementing
// value x if tm matches tuple (x, second). Useful for implementing
// UnorderedPointwise() in terms of UnorderedElementsAreArray().
// UnorderedPointwise() in terms of UnorderedElementsAreArray().
template
<
typename
Tuple2Matcher
,
typename
Second
>
template
<
typename
Tuple2Matcher
,
typename
Second
>
BoundSecondMatcher
<
Tuple2Matcher
,
Second
>
MatcherBindSecond
(
BoundSecondMatcher
<
Tuple2Matcher
,
Second
>
MatcherBindSecond
(
...
@@ -3710,7 +3710,7 @@ WhenDynamicCastTo(const Matcher<To>& inner_matcher) {
...
@@ -3710,7 +3710,7 @@ WhenDynamicCastTo(const Matcher<To>& inner_matcher) {
// Creates a matcher that matches an object whose given field matches
// Creates a matcher that matches an object whose given field matches
// 'matcher'. For example,
// 'matcher'. For example,
// Field(&Foo::number, Ge(5))
// Field(&Foo::number, Ge(5))
// matches a Foo object x if
f
x.number >= 5.
// matches a Foo object x if x.number >= 5.
template
<
typename
Class
,
typename
FieldType
,
typename
FieldMatcher
>
template
<
typename
Class
,
typename
FieldType
,
typename
FieldMatcher
>
inline
PolymorphicMatcher
<
inline
PolymorphicMatcher
<
internal
::
FieldMatcher
<
Class
,
FieldType
>
>
Field
(
internal
::
FieldMatcher
<
Class
,
FieldType
>
>
Field
(
...
@@ -3737,7 +3737,7 @@ inline PolymorphicMatcher<internal::FieldMatcher<Class, FieldType> > Field(
...
@@ -3737,7 +3737,7 @@ inline PolymorphicMatcher<internal::FieldMatcher<Class, FieldType> > Field(
// Creates a matcher that matches an object whose given property
// Creates a matcher that matches an object whose given property
// matches 'matcher'. For example,
// matches 'matcher'. For example,
// Property(&Foo::str, StartsWith("hi"))
// Property(&Foo::str, StartsWith("hi"))
// matches a Foo object x if
f
x.str() starts with "hi".
// matches a Foo object x if x.str() starts with "hi".
template
<
typename
Class
,
typename
PropertyType
,
typename
PropertyMatcher
>
template
<
typename
Class
,
typename
PropertyType
,
typename
PropertyMatcher
>
inline
PolymorphicMatcher
<
internal
::
PropertyMatcher
<
inline
PolymorphicMatcher
<
internal
::
PropertyMatcher
<
Class
,
PropertyType
,
PropertyType
(
Class
::*
)()
const
>
>
Class
,
PropertyType
,
PropertyType
(
Class
::*
)()
const
>
>
...
@@ -3792,11 +3792,11 @@ Property(const std::string& property_name,
...
@@ -3792,11 +3792,11 @@ Property(const std::string& property_name,
property_name
,
property
,
MatcherCast
<
const
PropertyType
&>
(
matcher
)));
property_name
,
property
,
MatcherCast
<
const
PropertyType
&>
(
matcher
)));
}
}
// Creates a matcher that matches an object if
f
the result of applying
// Creates a matcher that matches an object if the result of applying
// a callable to x matches 'matcher'.
// a callable to x matches 'matcher'.
// For example,
// For example,
// ResultOf(f, StartsWith("hi"))
// ResultOf(f, StartsWith("hi"))
// matches a Foo object x if
f
f(x) starts with "hi".
// matches a Foo object x if f(x) starts with "hi".
// `callable` parameter can be a function, function pointer, or a functor. It is
// `callable` parameter can be a function, function pointer, or a functor. It is
// required to keep no state affecting the results of the calls on it and make
// required to keep no state affecting the results of the calls on it and make
// no assumptions about how many calls will be made. Any state it keeps must be
// no assumptions about how many calls will be made. Any state it keeps must be
...
@@ -4345,7 +4345,7 @@ inline internal::MatcherAsPredicate<M> Matches(M matcher) {
...
@@ -4345,7 +4345,7 @@ inline internal::MatcherAsPredicate<M> Matches(M matcher) {
return
internal
::
MatcherAsPredicate
<
M
>
(
matcher
);
return
internal
::
MatcherAsPredicate
<
M
>
(
matcher
);
}
}
// Returns true if
f
the value matches the matcher.
// Returns true if the value matches the matcher.
template
<
typename
T
,
typename
M
>
template
<
typename
T
,
typename
M
>
inline
bool
Value
(
const
T
&
value
,
M
matcher
)
{
inline
bool
Value
(
const
T
&
value
,
M
matcher
)
{
return
testing
::
Matches
(
matcher
)(
value
);
return
testing
::
Matches
(
matcher
)(
value
);
...
@@ -4551,7 +4551,7 @@ PolymorphicMatcher<internal::variant_matcher::VariantMatcher<T> > VariantWith(
...
@@ -4551,7 +4551,7 @@ PolymorphicMatcher<internal::variant_matcher::VariantMatcher<T> > VariantWith(
// These macros allow using matchers to check values in Google Test
// These macros allow using matchers to check values in Google Test
// tests. ASSERT_THAT(value, matcher) and EXPECT_THAT(value, matcher)
// tests. ASSERT_THAT(value, matcher) and EXPECT_THAT(value, matcher)
// succeed if
f
the value matches the matcher. If the assertion fails,
// succeed if the value matches the matcher. If the assertion fails,
// the value and the description of the matcher will be printed.
// the value and the description of the matcher will be printed.
#define ASSERT_THAT(value, matcher) ASSERT_PRED_FORMAT1(\
#define ASSERT_THAT(value, matcher) ASSERT_PRED_FORMAT1(\
::testing::internal::MakePredicateFormatterFromMatcher(matcher), value)
::testing::internal::MakePredicateFormatterFromMatcher(matcher), value)
...
...
googlemock/include/gmock/gmock-spec-builders.h
View file @
bf6df7ea
...
@@ -331,7 +331,7 @@ class OnCallSpec : public UntypedOnCallSpecBase {
...
@@ -331,7 +331,7 @@ class OnCallSpec : public UntypedOnCallSpecBase {
return
*
this
;
return
*
this
;
}
}
// Returns true if
f
the given arguments match the matchers.
// Returns true if the given arguments match the matchers.
bool
Matches
(
const
ArgumentTuple
&
args
)
const
{
bool
Matches
(
const
ArgumentTuple
&
args
)
const
{
return
TupleMatches
(
matchers_
,
args
)
&&
extra_matcher_
.
Matches
(
args
);
return
TupleMatches
(
matchers_
,
args
)
&&
extra_matcher_
.
Matches
(
args
);
}
}
...
@@ -389,7 +389,7 @@ class GTEST_API_ Mock {
...
@@ -389,7 +389,7 @@ class GTEST_API_ Mock {
GTEST_LOCK_EXCLUDED_
(
internal
::
g_gmock_mutex
);
GTEST_LOCK_EXCLUDED_
(
internal
::
g_gmock_mutex
);
// Verifies all expectations on the given mock object and clears its
// Verifies all expectations on the given mock object and clears its
// default actions and expectations. Returns true if
f
the
// default actions and expectations. Returns true if the
// verification was successful.
// verification was successful.
static
bool
VerifyAndClear
(
void
*
mock_obj
)
static
bool
VerifyAndClear
(
void
*
mock_obj
)
GTEST_LOCK_EXCLUDED_
(
internal
::
g_gmock_mutex
);
GTEST_LOCK_EXCLUDED_
(
internal
::
g_gmock_mutex
);
...
@@ -515,7 +515,7 @@ class GTEST_API_ Expectation {
...
@@ -515,7 +515,7 @@ class GTEST_API_ Expectation {
// The compiler-generated copy ctor and operator= work exactly as
// The compiler-generated copy ctor and operator= work exactly as
// intended, so we don't need to define our own.
// intended, so we don't need to define our own.
// Returns true if
f
rhs references the same expectation as this object does.
// Returns true if rhs references the same expectation as this object does.
bool
operator
==
(
const
Expectation
&
rhs
)
const
{
bool
operator
==
(
const
Expectation
&
rhs
)
const
{
return
expectation_base_
==
rhs
.
expectation_base_
;
return
expectation_base_
==
rhs
.
expectation_base_
;
}
}
...
@@ -597,7 +597,7 @@ class ExpectationSet {
...
@@ -597,7 +597,7 @@ class ExpectationSet {
// The compiler-generator ctor and operator= works exactly as
// The compiler-generator ctor and operator= works exactly as
// intended, so we don't need to define our own.
// intended, so we don't need to define our own.
// Returns true if
f
rhs contains the same set of Expectation objects
// Returns true if rhs contains the same set of Expectation objects
// as this does.
// as this does.
bool
operator
==
(
const
ExpectationSet
&
rhs
)
const
{
bool
operator
==
(
const
ExpectationSet
&
rhs
)
const
{
return
expectations_
==
rhs
.
expectations_
;
return
expectations_
==
rhs
.
expectations_
;
...
@@ -759,7 +759,7 @@ class GTEST_API_ ExpectationBase {
...
@@ -759,7 +759,7 @@ class GTEST_API_ ExpectationBase {
// by the subclasses to implement the .Times() clause.
// by the subclasses to implement the .Times() clause.
void
SpecifyCardinality
(
const
Cardinality
&
cardinality
);
void
SpecifyCardinality
(
const
Cardinality
&
cardinality
);
// Returns true if
f
the user specified the cardinality explicitly
// Returns true if the user specified the cardinality explicitly
// using a .Times().
// using a .Times().
bool
cardinality_specified
()
const
{
return
cardinality_specified_
;
}
bool
cardinality_specified
()
const
{
return
cardinality_specified_
;
}
...
@@ -776,7 +776,7 @@ class GTEST_API_ ExpectationBase {
...
@@ -776,7 +776,7 @@ class GTEST_API_ ExpectationBase {
void
RetireAllPreRequisites
()
void
RetireAllPreRequisites
()
GTEST_EXCLUSIVE_LOCK_REQUIRED_
(
g_gmock_mutex
);
GTEST_EXCLUSIVE_LOCK_REQUIRED_
(
g_gmock_mutex
);
// Returns true if
f
this expectation is retired.
// Returns true if this expectation is retired.
bool
is_retired
()
const
bool
is_retired
()
const
GTEST_EXCLUSIVE_LOCK_REQUIRED_
(
g_gmock_mutex
)
{
GTEST_EXCLUSIVE_LOCK_REQUIRED_
(
g_gmock_mutex
)
{
g_gmock_mutex
.
AssertHeld
();
g_gmock_mutex
.
AssertHeld
();
...
@@ -790,28 +790,28 @@ class GTEST_API_ ExpectationBase {
...
@@ -790,28 +790,28 @@ class GTEST_API_ ExpectationBase {
retired_
=
true
;
retired_
=
true
;
}
}
// Returns true if
f
this expectation is satisfied.
// Returns true if this expectation is satisfied.
bool
IsSatisfied
()
const
bool
IsSatisfied
()
const
GTEST_EXCLUSIVE_LOCK_REQUIRED_
(
g_gmock_mutex
)
{
GTEST_EXCLUSIVE_LOCK_REQUIRED_
(
g_gmock_mutex
)
{
g_gmock_mutex
.
AssertHeld
();
g_gmock_mutex
.
AssertHeld
();
return
cardinality
().
IsSatisfiedByCallCount
(
call_count_
);
return
cardinality
().
IsSatisfiedByCallCount
(
call_count_
);
}
}
// Returns true if
f
this expectation is saturated.
// Returns true if this expectation is saturated.
bool
IsSaturated
()
const
bool
IsSaturated
()
const
GTEST_EXCLUSIVE_LOCK_REQUIRED_
(
g_gmock_mutex
)
{
GTEST_EXCLUSIVE_LOCK_REQUIRED_
(
g_gmock_mutex
)
{
g_gmock_mutex
.
AssertHeld
();
g_gmock_mutex
.
AssertHeld
();
return
cardinality
().
IsSaturatedByCallCount
(
call_count_
);
return
cardinality
().
IsSaturatedByCallCount
(
call_count_
);
}
}
// Returns true if
f
this expectation is over-saturated.
// Returns true if this expectation is over-saturated.
bool
IsOverSaturated
()
const
bool
IsOverSaturated
()
const
GTEST_EXCLUSIVE_LOCK_REQUIRED_
(
g_gmock_mutex
)
{
GTEST_EXCLUSIVE_LOCK_REQUIRED_
(
g_gmock_mutex
)
{
g_gmock_mutex
.
AssertHeld
();
g_gmock_mutex
.
AssertHeld
();
return
cardinality
().
IsOverSaturatedByCallCount
(
call_count_
);
return
cardinality
().
IsOverSaturatedByCallCount
(
call_count_
);
}
}
// Returns true if
f
all pre-requisites of this expectation are satisfied.
// Returns true if all pre-requisites of this expectation are satisfied.
bool
AllPrerequisitesAreSatisfied
()
const
bool
AllPrerequisitesAreSatisfied
()
const
GTEST_EXCLUSIVE_LOCK_REQUIRED_
(
g_gmock_mutex
);
GTEST_EXCLUSIVE_LOCK_REQUIRED_
(
g_gmock_mutex
);
...
@@ -854,7 +854,7 @@ class GTEST_API_ ExpectationBase {
...
@@ -854,7 +854,7 @@ class GTEST_API_ ExpectationBase {
const
char
*
file_
;
// The file that contains the expectation.
const
char
*
file_
;
// The file that contains the expectation.
int
line_
;
// The line number of the expectation.
int
line_
;
// The line number of the expectation.
const
std
::
string
source_text_
;
// The EXPECT_CALL(...) source text.
const
std
::
string
source_text_
;
// The EXPECT_CALL(...) source text.
// True if
f
the cardinality is specified explicitly.
// True if the cardinality is specified explicitly.
bool
cardinality_specified_
;
bool
cardinality_specified_
;
Cardinality
cardinality_
;
// The cardinality of the expectation.
Cardinality
cardinality_
;
// The cardinality of the expectation.
// The immediate pre-requisites (i.e. expectations that must be
// The immediate pre-requisites (i.e. expectations that must be
...
@@ -868,7 +868,7 @@ class GTEST_API_ ExpectationBase {
...
@@ -868,7 +868,7 @@ class GTEST_API_ ExpectationBase {
// This group of fields are the current state of the expectation,
// This group of fields are the current state of the expectation,
// and can change as the mock function is called.
// and can change as the mock function is called.
int
call_count_
;
// How many times this expectation has been invoked.
int
call_count_
;
// How many times this expectation has been invoked.
bool
retired_
;
// True if
f
this expectation has retired.
bool
retired_
;
// True if this expectation has retired.
UntypedActions
untyped_actions_
;
UntypedActions
untyped_actions_
;
bool
extra_matcher_specified_
;
bool
extra_matcher_specified_
;
bool
repeated_action_specified_
;
// True if a WillRepeatedly() was specified.
bool
repeated_action_specified_
;
// True if a WillRepeatedly() was specified.
...
@@ -1086,14 +1086,14 @@ class TypedExpectation : public ExpectationBase {
...
@@ -1086,14 +1086,14 @@ class TypedExpectation : public ExpectationBase {
// statement finishes and when the current thread holds
// statement finishes and when the current thread holds
// g_gmock_mutex.
// g_gmock_mutex.
// Returns true if
f
this expectation matches the given arguments.
// Returns true if this expectation matches the given arguments.
bool
Matches
(
const
ArgumentTuple
&
args
)
const
bool
Matches
(
const
ArgumentTuple
&
args
)
const
GTEST_EXCLUSIVE_LOCK_REQUIRED_
(
g_gmock_mutex
)
{
GTEST_EXCLUSIVE_LOCK_REQUIRED_
(
g_gmock_mutex
)
{
g_gmock_mutex
.
AssertHeld
();
g_gmock_mutex
.
AssertHeld
();
return
TupleMatches
(
matchers_
,
args
)
&&
extra_matcher_
.
Matches
(
args
);
return
TupleMatches
(
matchers_
,
args
)
&&
extra_matcher_
.
Matches
(
args
);
}
}
// Returns true if
f
this expectation should handle the given arguments.
// Returns true if this expectation should handle the given arguments.
bool
ShouldHandleArguments
(
const
ArgumentTuple
&
args
)
const
bool
ShouldHandleArguments
(
const
ArgumentTuple
&
args
)
const
GTEST_EXCLUSIVE_LOCK_REQUIRED_
(
g_gmock_mutex
)
{
GTEST_EXCLUSIVE_LOCK_REQUIRED_
(
g_gmock_mutex
)
{
g_gmock_mutex
.
AssertHeld
();
g_gmock_mutex
.
AssertHeld
();
...
...
googlemock/include/gmock/internal/gmock-internal-utils.h
View file @
bf6df7ea
...
@@ -176,11 +176,11 @@ GMOCK_DECLARE_KIND_(long double, kFloatingPoint);
...
@@ -176,11 +176,11 @@ GMOCK_DECLARE_KIND_(long double, kFloatingPoint);
static_cast< ::testing::internal::TypeKind>( \
static_cast< ::testing::internal::TypeKind>( \
::testing::internal::KindOf<type>::value)
::testing::internal::KindOf<type>::value)
// Evaluates to true if
f
integer type T is signed.
// Evaluates to true if integer type T is signed.
#define GMOCK_IS_SIGNED_(T) (static_cast<T>(-1) < 0)
#define GMOCK_IS_SIGNED_(T) (static_cast<T>(-1) < 0)
// LosslessArithmeticConvertibleImpl<kFromKind, From, kToKind, To>::value
// LosslessArithmeticConvertibleImpl<kFromKind, From, kToKind, To>::value
// is true if
f
arithmetic type From can be losslessly converted to
// is true if arithmetic type From can be losslessly converted to
// arithmetic type To.
// arithmetic type To.
//
//
// It's the user's responsibility to ensure that both From and To are
// It's the user's responsibility to ensure that both From and To are
...
@@ -211,7 +211,7 @@ template <typename From>
...
@@ -211,7 +211,7 @@ template <typename From>
struct
LosslessArithmeticConvertibleImpl
<
kInteger
,
From
,
kBool
,
bool
>
struct
LosslessArithmeticConvertibleImpl
<
kInteger
,
From
,
kBool
,
bool
>
:
public
false_type
{};
// NOLINT
:
public
false_type
{};
// NOLINT
// Converting an integer to another non-bool integer is lossless if
f
// Converting an integer to another non-bool integer is lossless if
// the target type's range encloses the source type's range.
// the target type's range encloses the source type's range.
template
<
typename
From
,
typename
To
>
template
<
typename
From
,
typename
To
>
struct
LosslessArithmeticConvertibleImpl
<
kInteger
,
From
,
kInteger
,
To
>
struct
LosslessArithmeticConvertibleImpl
<
kInteger
,
From
,
kInteger
,
To
>
...
@@ -243,13 +243,13 @@ struct LosslessArithmeticConvertibleImpl<kFloatingPoint, From, kInteger, To>
...
@@ -243,13 +243,13 @@ struct LosslessArithmeticConvertibleImpl<kFloatingPoint, From, kInteger, To>
:
public
false_type
{};
// NOLINT
:
public
false_type
{};
// NOLINT
// Converting a floating-point to another floating-point is lossless
// Converting a floating-point to another floating-point is lossless
// if
f
the target type is at least as big as the source type.
// if the target type is at least as big as the source type.
template
<
typename
From
,
typename
To
>
template
<
typename
From
,
typename
To
>
struct
LosslessArithmeticConvertibleImpl
<
struct
LosslessArithmeticConvertibleImpl
<
kFloatingPoint
,
From
,
kFloatingPoint
,
To
>
kFloatingPoint
,
From
,
kFloatingPoint
,
To
>
:
public
bool_constant
<
sizeof
(
From
)
<=
sizeof
(
To
)
>
{};
// NOLINT
:
public
bool_constant
<
sizeof
(
From
)
<=
sizeof
(
To
)
>
{};
// NOLINT
// LosslessArithmeticConvertible<From, To>::value is true if
f
arithmetic
// LosslessArithmeticConvertible<From, To>::value is true if arithmetic
// type From can be losslessly converted to arithmetic type To.
// type From can be losslessly converted to arithmetic type To.
//
//
// It's the user's responsibility to ensure that both From and To are
// It's the user's responsibility to ensure that both From and To are
...
@@ -324,11 +324,11 @@ const char kWarningVerbosity[] = "warning";
...
@@ -324,11 +324,11 @@ const char kWarningVerbosity[] = "warning";
// No logs are printed.
// No logs are printed.
const
char
kErrorVerbosity
[]
=
"error"
;
const
char
kErrorVerbosity
[]
=
"error"
;
// Returns true if
f
a log with the given severity is visible according
// Returns true if a log with the given severity is visible according
// to the --gmock_verbose flag.
// to the --gmock_verbose flag.
GTEST_API_
bool
LogIsVisible
(
LogSeverity
severity
);
GTEST_API_
bool
LogIsVisible
(
LogSeverity
severity
);
// Prints the given message to stdout if
f
'severity' >= the level
// Prints the given message to stdout if 'severity' >= the level
// specified by the --gmock_verbose flag. If stack_frames_to_skip >=
// specified by the --gmock_verbose flag. If stack_frames_to_skip >=
// 0, also prints the stack trace excluding the top
// 0, also prints the stack trace excluding the top
// stack_frames_to_skip frames. In opt mode, any positive
// stack_frames_to_skip frames. In opt mode, any positive
...
@@ -355,11 +355,11 @@ GTEST_API_ WithoutMatchers GetWithoutMatchers();
...
@@ -355,11 +355,11 @@ GTEST_API_ WithoutMatchers GetWithoutMatchers();
// Type traits.
// Type traits.
// is_reference<T>::value is non-zero if
f
T is a reference type.
// is_reference<T>::value is non-zero if T is a reference type.
template
<
typename
T
>
struct
is_reference
:
public
false_type
{};
template
<
typename
T
>
struct
is_reference
:
public
false_type
{};
template
<
typename
T
>
struct
is_reference
<
T
&>
:
public
true_type
{};
template
<
typename
T
>
struct
is_reference
<
T
&>
:
public
true_type
{};
// type_equals<T1, T2>::value is non-zero if
f
T1 and T2 are the same type.
// type_equals<T1, T2>::value is non-zero if T1 and T2 are the same type.
template
<
typename
T1
,
typename
T2
>
struct
type_equals
:
public
false_type
{};
template
<
typename
T1
,
typename
T2
>
struct
type_equals
:
public
false_type
{};
template
<
typename
T
>
struct
type_equals
<
T
,
T
>
:
public
true_type
{};
template
<
typename
T
>
struct
type_equals
<
T
,
T
>
:
public
true_type
{};
...
...
googlemock/scripts/upload.py
View file @
bf6df7ea
...
@@ -631,7 +631,7 @@ class VersionControlSystem(object):
...
@@ -631,7 +631,7 @@ class VersionControlSystem(object):
new_content: For text files, this is empty. For binary files, this is
new_content: For text files, this is empty. For binary files, this is
the contents of the new file, since the diff output won't contain
the contents of the new file, since the diff output won't contain
information to reconstruct the current file.
information to reconstruct the current file.
is_binary: True if
f
the file is binary.
is_binary: True if the file is binary.
status: The status of the file.
status: The status of the file.
"""
"""
...
...
googlemock/src/gmock-internal-utils.cc
View file @
bf6df7ea
...
@@ -123,7 +123,7 @@ GTEST_API_ FailureReporterInterface* GetFailureReporter() {
...
@@ -123,7 +123,7 @@ GTEST_API_ FailureReporterInterface* GetFailureReporter() {
// Protects global resources (stdout in particular) used by Log().
// Protects global resources (stdout in particular) used by Log().
static
GTEST_DEFINE_STATIC_MUTEX_
(
g_log_mutex
);
static
GTEST_DEFINE_STATIC_MUTEX_
(
g_log_mutex
);
// Returns true if
f
a log with the given severity is visible according
// Returns true if a log with the given severity is visible according
// to the --gmock_verbose flag.
// to the --gmock_verbose flag.
GTEST_API_
bool
LogIsVisible
(
LogSeverity
severity
)
{
GTEST_API_
bool
LogIsVisible
(
LogSeverity
severity
)
{
if
(
GMOCK_FLAG
(
verbose
)
==
kInfoVerbosity
)
{
if
(
GMOCK_FLAG
(
verbose
)
==
kInfoVerbosity
)
{
...
@@ -139,7 +139,7 @@ GTEST_API_ bool LogIsVisible(LogSeverity severity) {
...
@@ -139,7 +139,7 @@ GTEST_API_ bool LogIsVisible(LogSeverity severity) {
}
}
}
}
// Prints the given message to stdout if
f
'severity' >= the level
// Prints the given message to stdout if 'severity' >= the level
// specified by the --gmock_verbose flag. If stack_frames_to_skip >=
// specified by the --gmock_verbose flag. If stack_frames_to_skip >=
// 0, also prints the stack trace excluding the top
// 0, also prints the stack trace excluding the top
// stack_frames_to_skip frames. In opt mode, any positive
// stack_frames_to_skip frames. In opt mode, any positive
...
...
googlemock/src/gmock-spec-builders.cc
View file @
bf6df7ea
...
@@ -126,7 +126,7 @@ void ExpectationBase::RetireAllPreRequisites()
...
@@ -126,7 +126,7 @@ void ExpectationBase::RetireAllPreRequisites()
}
}
}
}
// Returns true if
f
all pre-requisites of this expectation have been
// Returns true if all pre-requisites of this expectation have been
// satisfied.
// satisfied.
bool
ExpectationBase
::
AllPrerequisitesAreSatisfied
()
const
bool
ExpectationBase
::
AllPrerequisitesAreSatisfied
()
const
GTEST_EXCLUSIVE_LOCK_REQUIRED_
(
g_gmock_mutex
)
{
GTEST_EXCLUSIVE_LOCK_REQUIRED_
(
g_gmock_mutex
)
{
...
@@ -384,7 +384,7 @@ UntypedActionResultHolderBase* UntypedFunctionMockerBase::UntypedInvokeWith(
...
@@ -384,7 +384,7 @@ UntypedActionResultHolderBase* UntypedFunctionMockerBase::UntypedInvokeWith(
const
CallReaction
reaction
=
const
CallReaction
reaction
=
Mock
::
GetReactionOnUninterestingCalls
(
MockObject
());
Mock
::
GetReactionOnUninterestingCalls
(
MockObject
());
// True if
f
we need to print this call's arguments and return
// True if we need to print this call's arguments and return
// value. This definition must be kept in sync with
// value. This definition must be kept in sync with
// the behavior of ReportUninterestingCall().
// the behavior of ReportUninterestingCall().
const
bool
need_to_report_uninteresting_call
=
const
bool
need_to_report_uninteresting_call
=
...
@@ -435,7 +435,7 @@ UntypedActionResultHolderBase* UntypedFunctionMockerBase::UntypedInvokeWith(
...
@@ -435,7 +435,7 @@ UntypedActionResultHolderBase* UntypedFunctionMockerBase::UntypedInvokeWith(
&
ss
,
&
why
);
&
ss
,
&
why
);
const
bool
found
=
untyped_expectation
!=
nullptr
;
const
bool
found
=
untyped_expectation
!=
nullptr
;
// True if
f
we need to print the call's arguments and return value.
// True if we need to print the call's arguments and return value.
// This definition must be kept in sync with the uses of Expect()
// This definition must be kept in sync with the uses of Expect()
// and Log() in this function.
// and Log() in this function.
const
bool
need_to_report_call
=
const
bool
need_to_report_call
=
...
@@ -574,7 +574,7 @@ struct MockObjectState {
...
@@ -574,7 +574,7 @@ struct MockObjectState {
int
first_used_line
;
int
first_used_line
;
::
std
::
string
first_used_test_suite
;
::
std
::
string
first_used_test_suite
;
::
std
::
string
first_used_test
;
::
std
::
string
first_used_test
;
bool
leakable
;
// true if
f
it's OK to leak the object.
bool
leakable
;
// true if it's OK to leak the object.
FunctionMockers
function_mockers
;
// All registered methods of the object.
FunctionMockers
function_mockers
;
// All registered methods of the object.
};
};
...
@@ -718,7 +718,7 @@ bool Mock::VerifyAndClearExpectations(void* mock_obj)
...
@@ -718,7 +718,7 @@ bool Mock::VerifyAndClearExpectations(void* mock_obj)
}
}
// Verifies all expectations on the given mock object and clears its
// Verifies all expectations on the given mock object and clears its
// default actions and expectations. Returns true if
f
the
// default actions and expectations. Returns true if the
// verification was successful.
// verification was successful.
bool
Mock
::
VerifyAndClear
(
void
*
mock_obj
)
bool
Mock
::
VerifyAndClear
(
void
*
mock_obj
)
GTEST_LOCK_EXCLUDED_
(
internal
::
g_gmock_mutex
)
{
GTEST_LOCK_EXCLUDED_
(
internal
::
g_gmock_mutex
)
{
...
...
googlemock/src/gmock.cc
View file @
bf6df7ea
...
@@ -34,7 +34,7 @@
...
@@ -34,7 +34,7 @@
namespace
testing
{
namespace
testing
{
GMOCK_DEFINE_bool_
(
catch_leaked_mocks
,
true
,
GMOCK_DEFINE_bool_
(
catch_leaked_mocks
,
true
,
"true if
f
Google Mock should report leaked mock objects "
"true if Google Mock should report leaked mock objects "
"as failures."
);
"as failures."
);
GMOCK_DEFINE_string_
(
verbose
,
internal
::
kWarningVerbosity
,
GMOCK_DEFINE_string_
(
verbose
,
internal
::
kWarningVerbosity
,
...
...
googlemock/test/gmock-cardinalities_test.cc
View file @
bf6df7ea
...
@@ -395,12 +395,12 @@ TEST(ExactlyTest, HasCorrectBounds) {
...
@@ -395,12 +395,12 @@ TEST(ExactlyTest, HasCorrectBounds) {
class
EvenCardinality
:
public
CardinalityInterface
{
class
EvenCardinality
:
public
CardinalityInterface
{
public:
public:
// Returns true if
f
call_count calls will satisfy this cardinality.
// Returns true if call_count calls will satisfy this cardinality.
bool
IsSatisfiedByCallCount
(
int
call_count
)
const
override
{
bool
IsSatisfiedByCallCount
(
int
call_count
)
const
override
{
return
(
call_count
%
2
==
0
);
return
(
call_count
%
2
==
0
);
}
}
// Returns true if
f
call_count calls will saturate this cardinality.
// Returns true if call_count calls will saturate this cardinality.
bool
IsSaturatedByCallCount
(
int
/* call_count */
)
const
override
{
bool
IsSaturatedByCallCount
(
int
/* call_count */
)
const
override
{
return
false
;
return
false
;
}
}
...
...
googlemock/test/gmock-matchers_test.cc
View file @
bf6df7ea
...
@@ -956,7 +956,7 @@ TEST(TypedEqTest, CanDescribeSelf) {
...
@@ -956,7 +956,7 @@ TEST(TypedEqTest, CanDescribeSelf) {
// Tests that TypedEq<T>(v) has type Matcher<T>.
// Tests that TypedEq<T>(v) has type Matcher<T>.
// Type<T>::IsTypeOf(v) compiles if
f
the type of value v is T, where T
// Type<T>::IsTypeOf(v) compiles if the type of value v is T, where T
// is a "bare" type (i.e. not in the form of const U or U&). If v's
// is a "bare" type (i.e. not in the form of const U or U&). If v's
// type is not T, the compiler will generate a message about
// type is not T, the compiler will generate a message about
// "undefined reference".
// "undefined reference".
...
@@ -2640,7 +2640,7 @@ class IsGreaterThan {
...
@@ -2640,7 +2640,7 @@ class IsGreaterThan {
// For testing Truly().
// For testing Truly().
const
int
foo
=
0
;
const
int
foo
=
0
;
// This predicate returns true if
f
the argument references foo and has
// This predicate returns true if the argument references foo and has
// a zero value.
// a zero value.
bool
ReferencesFooAndIsZero
(
const
int
&
n
)
{
bool
ReferencesFooAndIsZero
(
const
int
&
n
)
{
return
(
&
n
==
&
foo
)
&&
(
n
==
0
);
return
(
&
n
==
&
foo
)
&&
(
n
==
0
);
...
@@ -3594,7 +3594,7 @@ class Uncopyable {
...
@@ -3594,7 +3594,7 @@ class Uncopyable {
GTEST_DISALLOW_COPY_AND_ASSIGN_
(
Uncopyable
);
GTEST_DISALLOW_COPY_AND_ASSIGN_
(
Uncopyable
);
};
};
// Returns true if
f
x.value() is positive.
// Returns true if x.value() is positive.
bool
ValueIsPositive
(
const
Uncopyable
&
x
)
{
return
x
.
value
()
>
0
;
}
bool
ValueIsPositive
(
const
Uncopyable
&
x
)
{
return
x
.
value
()
>
0
;
}
MATCHER_P
(
UncopyableIs
,
inner_matcher
,
""
)
{
MATCHER_P
(
UncopyableIs
,
inner_matcher
,
""
)
{
...
...
googlemock/test/gmock-spec-builders_test.cc
View file @
bf6df7ea
...
@@ -1952,12 +1952,12 @@ TEST(DeletingMockEarlyTest, Failure2) {
...
@@ -1952,12 +1952,12 @@ TEST(DeletingMockEarlyTest, Failure2) {
class
EvenNumberCardinality
:
public
CardinalityInterface
{
class
EvenNumberCardinality
:
public
CardinalityInterface
{
public:
public:
// Returns true if
f
call_count calls will satisfy this cardinality.
// Returns true if call_count calls will satisfy this cardinality.
bool
IsSatisfiedByCallCount
(
int
call_count
)
const
override
{
bool
IsSatisfiedByCallCount
(
int
call_count
)
const
override
{
return
call_count
%
2
==
0
;
return
call_count
%
2
==
0
;
}
}
// Returns true if
f
call_count calls will saturate this cardinality.
// Returns true if call_count calls will saturate this cardinality.
bool
IsSaturatedByCallCount
(
int
/* call_count */
)
const
override
{
bool
IsSaturatedByCallCount
(
int
/* call_count */
)
const
override
{
return
false
;
return
false
;
}
}
...
...
googletest/include/gtest/gtest-death-test.h
View file @
bf6df7ea
...
@@ -276,7 +276,7 @@ class GTEST_API_ KilledBySignal {
...
@@ -276,7 +276,7 @@ class GTEST_API_ KilledBySignal {
// This macro is used for implementing macros such as
// This macro is used for implementing macros such as
// EXPECT_DEATH_IF_SUPPORTED and ASSERT_DEATH_IF_SUPPORTED on systems where
// EXPECT_DEATH_IF_SUPPORTED and ASSERT_DEATH_IF_SUPPORTED on systems where
// death tests are not supported. Those macros must compile on such systems
// death tests are not supported. Those macros must compile on such systems
// if
f
EXPECT_DEATH and ASSERT_DEATH compile with the same parameters on
// if EXPECT_DEATH and ASSERT_DEATH compile with the same parameters on
// systems that support death tests. This allows one to write such a macro
// systems that support death tests. This allows one to write such a macro
// on a system that does not support death tests and be sure that it will
// on a system that does not support death tests and be sure that it will
// compile on a death-test supporting system. It is exposed publicly so that
// compile on a death-test supporting system. It is exposed publicly so that
...
@@ -289,7 +289,7 @@ class GTEST_API_ KilledBySignal {
...
@@ -289,7 +289,7 @@ class GTEST_API_ KilledBySignal {
// for program termination. This macro has to make sure this
// for program termination. This macro has to make sure this
// statement is compiled but not executed, to ensure that
// statement is compiled but not executed, to ensure that
// EXPECT_DEATH_IF_SUPPORTED compiles with a certain
// EXPECT_DEATH_IF_SUPPORTED compiles with a certain
// parameter if
f
EXPECT_DEATH compiles with it.
// parameter if EXPECT_DEATH compiles with it.
// regex - A regex that a macro such as EXPECT_DEATH would use to test
// regex - A regex that a macro such as EXPECT_DEATH would use to test
// the output of statement. This parameter has to be
// the output of statement. This parameter has to be
// compiled but not evaluated by this macro, to ensure that
// compiled but not evaluated by this macro, to ensure that
...
...
googletest/include/gtest/gtest-matchers.h
View file @
bf6df7ea
...
@@ -95,7 +95,7 @@ class MatchResultListener {
...
@@ -95,7 +95,7 @@ class MatchResultListener {
// Returns the underlying ostream.
// Returns the underlying ostream.
::
std
::
ostream
*
stream
()
{
return
stream_
;
}
::
std
::
ostream
*
stream
()
{
return
stream_
;
}
// Returns true if
f
the listener is interested in an explanation of
// Returns true if the listener is interested in an explanation of
// the match result. A matcher's MatchAndExplain() method can use
// the match result. A matcher's MatchAndExplain() method can use
// this information to avoid generating the explanation when no one
// this information to avoid generating the explanation when no one
// intends to hear it.
// intends to hear it.
...
@@ -140,7 +140,7 @@ class MatcherDescriberInterface {
...
@@ -140,7 +140,7 @@ class MatcherDescriberInterface {
template
<
typename
T
>
template
<
typename
T
>
class
MatcherInterface
:
public
MatcherDescriberInterface
{
class
MatcherInterface
:
public
MatcherDescriberInterface
{
public:
public:
// Returns true if
f
the matcher matches x; also explains the match
// Returns true if the matcher matches x; also explains the match
// result to 'listener' if necessary (see the next paragraph), in
// result to 'listener' if necessary (see the next paragraph), in
// the form of a non-restrictive relative clause ("which ...",
// the form of a non-restrictive relative clause ("which ...",
// "whose ...", etc) that describes x. For example, the
// "whose ...", etc) that describes x. For example, the
...
@@ -257,13 +257,13 @@ class StreamMatchResultListener : public MatchResultListener {
...
@@ -257,13 +257,13 @@ class StreamMatchResultListener : public MatchResultListener {
template
<
typename
T
>
template
<
typename
T
>
class
MatcherBase
{
class
MatcherBase
{
public:
public:
// Returns true if
f
the matcher matches x; also explains the match
// Returns true if the matcher matches x; also explains the match
// result to 'listener'.
// result to 'listener'.
bool
MatchAndExplain
(
const
T
&
x
,
MatchResultListener
*
listener
)
const
{
bool
MatchAndExplain
(
const
T
&
x
,
MatchResultListener
*
listener
)
const
{
return
impl_
->
MatchAndExplain
(
x
,
listener
);
return
impl_
->
MatchAndExplain
(
x
,
listener
);
}
}
// Returns true if
f
this matcher matches x.
// Returns true if this matcher matches x.
bool
Matches
(
const
T
&
x
)
const
{
bool
Matches
(
const
T
&
x
)
const
{
DummyMatchResultListener
dummy
;
DummyMatchResultListener
dummy
;
return
MatchAndExplain
(
x
,
&
dummy
);
return
MatchAndExplain
(
x
,
&
dummy
);
...
...
googletest/include/gtest/gtest-test-part.h
View file @
bf6df7ea
...
@@ -87,19 +87,19 @@ class GTEST_API_ TestPartResult {
...
@@ -87,19 +87,19 @@ class GTEST_API_ TestPartResult {
// Gets the message associated with the test part.
// Gets the message associated with the test part.
const
char
*
message
()
const
{
return
message_
.
c_str
();
}
const
char
*
message
()
const
{
return
message_
.
c_str
();
}
// Returns true if
f
the test part was skipped.
// Returns true if the test part was skipped.
bool
skipped
()
const
{
return
type_
==
kSkip
;
}
bool
skipped
()
const
{
return
type_
==
kSkip
;
}
// Returns true if
f
the test part passed.
// Returns true if the test part passed.
bool
passed
()
const
{
return
type_
==
kSuccess
;
}
bool
passed
()
const
{
return
type_
==
kSuccess
;
}
// Returns true if
f
the test part non-fatally failed.
// Returns true if the test part non-fatally failed.
bool
nonfatally_failed
()
const
{
return
type_
==
kNonFatalFailure
;
}
bool
nonfatally_failed
()
const
{
return
type_
==
kNonFatalFailure
;
}
// Returns true if
f
the test part fatally failed.
// Returns true if the test part fatally failed.
bool
fatally_failed
()
const
{
return
type_
==
kFatalFailure
;
}
bool
fatally_failed
()
const
{
return
type_
==
kFatalFailure
;
}
// Returns true if
f
the test part failed.
// Returns true if the test part failed.
bool
failed
()
const
{
return
fatally_failed
()
||
nonfatally_failed
();
}
bool
failed
()
const
{
return
fatally_failed
()
||
nonfatally_failed
();
}
private:
private:
...
...
googletest/include/gtest/gtest.h
View file @
bf6df7ea
...
@@ -308,7 +308,7 @@ class GTEST_API_ AssertionResult {
...
@@ -308,7 +308,7 @@ class GTEST_API_ AssertionResult {
return
*
this
;
return
*
this
;
}
}
// Returns true if
f
the assertion succeeded.
// Returns true if the assertion succeeded.
operator
bool
()
const
{
return
success_
;
}
// NOLINT
operator
bool
()
const
{
return
success_
;
}
// NOLINT
// Returns the assertion's negation. Used with EXPECT/ASSERT_FALSE.
// Returns the assertion's negation. Used with EXPECT/ASSERT_FALSE.
...
@@ -428,16 +428,16 @@ class GTEST_API_ Test {
...
@@ -428,16 +428,16 @@ class GTEST_API_ Test {
static
void
SetUpTestCase
()
{}
static
void
SetUpTestCase
()
{}
#endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_
#endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_
// Returns true if
f
the current test has a fatal failure.
// Returns true if the current test has a fatal failure.
static
bool
HasFatalFailure
();
static
bool
HasFatalFailure
();
// Returns true if
f
the current test has a non-fatal failure.
// Returns true if the current test has a non-fatal failure.
static
bool
HasNonfatalFailure
();
static
bool
HasNonfatalFailure
();
// Returns true if
f
the current test was skipped.
// Returns true if the current test was skipped.
static
bool
IsSkipped
();
static
bool
IsSkipped
();
// Returns true if
f
the current test has a (either fatal or
// Returns true if the current test has a (either fatal or
// non-fatal) failure.
// non-fatal) failure.
static
bool
HasFailure
()
{
return
HasFatalFailure
()
||
HasNonfatalFailure
();
}
static
bool
HasFailure
()
{
return
HasFatalFailure
()
||
HasNonfatalFailure
();
}
...
@@ -468,7 +468,7 @@ class GTEST_API_ Test {
...
@@ -468,7 +468,7 @@ class GTEST_API_ Test {
virtual
void
TearDown
();
virtual
void
TearDown
();
private:
private:
// Returns true if
f
the current test has the same fixture class as
// Returns true if the current test has the same fixture class as
// the first test in the current test suite.
// the first test in the current test suite.
static
bool
HasSameFixtureClass
();
static
bool
HasSameFixtureClass
();
...
@@ -570,19 +570,19 @@ class GTEST_API_ TestResult {
...
@@ -570,19 +570,19 @@ class GTEST_API_ TestResult {
// Returns the number of the test properties.
// Returns the number of the test properties.
int
test_property_count
()
const
;
int
test_property_count
()
const
;
// Returns true if
f
the test passed (i.e. no test part failed).
// Returns true if the test passed (i.e. no test part failed).
bool
Passed
()
const
{
return
!
Skipped
()
&&
!
Failed
();
}
bool
Passed
()
const
{
return
!
Skipped
()
&&
!
Failed
();
}
// Returns true if
f
the test was skipped.
// Returns true if the test was skipped.
bool
Skipped
()
const
;
bool
Skipped
()
const
;
// Returns true if
f
the test failed.
// Returns true if the test failed.
bool
Failed
()
const
;
bool
Failed
()
const
;
// Returns true if
f
the test fatally failed.
// Returns true if the test fatally failed.
bool
HasFatalFailure
()
const
;
bool
HasFatalFailure
()
const
;
// Returns true if
f
the test has a non-fatal failure.
// Returns true if the test has a non-fatal failure.
bool
HasNonfatalFailure
()
const
;
bool
HasNonfatalFailure
()
const
;
// Returns the elapsed time, in milliseconds.
// Returns the elapsed time, in milliseconds.
...
@@ -746,7 +746,7 @@ class GTEST_API_ TestInfo {
...
@@ -746,7 +746,7 @@ class GTEST_API_ TestInfo {
// contains the character 'A' or starts with "Foo.".
// contains the character 'A' or starts with "Foo.".
bool
should_run
()
const
{
return
should_run_
;
}
bool
should_run
()
const
{
return
should_run_
;
}
// Returns true if
f
this test will appear in the XML report.
// Returns true if this test will appear in the XML report.
bool
is_reportable
()
const
{
bool
is_reportable
()
const
{
// The XML report includes tests matching the filter, excluding those
// The XML report includes tests matching the filter, excluding those
// run in other shards.
// run in other shards.
...
@@ -805,8 +805,8 @@ class GTEST_API_ TestInfo {
...
@@ -805,8 +805,8 @@ class GTEST_API_ TestInfo {
const
std
::
unique_ptr
<
const
::
std
::
string
>
value_param_
;
const
std
::
unique_ptr
<
const
::
std
::
string
>
value_param_
;
internal
::
CodeLocation
location_
;
internal
::
CodeLocation
location_
;
const
internal
::
TypeId
fixture_class_id_
;
// ID of the test fixture class
const
internal
::
TypeId
fixture_class_id_
;
// ID of the test fixture class
bool
should_run_
;
// True if
f
this test should run
bool
should_run_
;
// True if this test should run
bool
is_disabled_
;
// True if
f
this test is disabled
bool
is_disabled_
;
// True if this test is disabled
bool
matches_filter_
;
// True if this test matches the
bool
matches_filter_
;
// True if this test matches the
// user-specified filter.
// user-specified filter.
bool
is_in_another_shard_
;
// Will be run in another shard.
bool
is_in_another_shard_
;
// Will be run in another shard.
...
@@ -881,10 +881,10 @@ class GTEST_API_ TestSuite {
...
@@ -881,10 +881,10 @@ class GTEST_API_ TestSuite {
// Gets the number of all tests in this test suite.
// Gets the number of all tests in this test suite.
int
total_test_count
()
const
;
int
total_test_count
()
const
;
// Returns true if
f
the test suite passed.
// Returns true if the test suite passed.
bool
Passed
()
const
{
return
!
Failed
();
}
bool
Passed
()
const
{
return
!
Failed
();
}
// Returns true if
f
the test suite failed.
// Returns true if the test suite failed.
bool
Failed
()
const
{
return
failed_test_count
()
>
0
;
}
bool
Failed
()
const
{
return
failed_test_count
()
>
0
;
}
// Returns the elapsed time, in milliseconds.
// Returns the elapsed time, in milliseconds.
...
@@ -952,33 +952,33 @@ class GTEST_API_ TestSuite {
...
@@ -952,33 +952,33 @@ class GTEST_API_ TestSuite {
}
}
}
}
// Returns true if
f
test passed.
// Returns true if test passed.
static
bool
TestPassed
(
const
TestInfo
*
test_info
)
{
static
bool
TestPassed
(
const
TestInfo
*
test_info
)
{
return
test_info
->
should_run
()
&&
test_info
->
result
()
->
Passed
();
return
test_info
->
should_run
()
&&
test_info
->
result
()
->
Passed
();
}
}
// Returns true if
f
test skipped.
// Returns true if test skipped.
static
bool
TestSkipped
(
const
TestInfo
*
test_info
)
{
static
bool
TestSkipped
(
const
TestInfo
*
test_info
)
{
return
test_info
->
should_run
()
&&
test_info
->
result
()
->
Skipped
();
return
test_info
->
should_run
()
&&
test_info
->
result
()
->
Skipped
();
}
}
// Returns true if
f
test failed.
// Returns true if test failed.
static
bool
TestFailed
(
const
TestInfo
*
test_info
)
{
static
bool
TestFailed
(
const
TestInfo
*
test_info
)
{
return
test_info
->
should_run
()
&&
test_info
->
result
()
->
Failed
();
return
test_info
->
should_run
()
&&
test_info
->
result
()
->
Failed
();
}
}
// Returns true if
f
the test is disabled and will be reported in the XML
// Returns true if the test is disabled and will be reported in the XML
// report.
// report.
static
bool
TestReportableDisabled
(
const
TestInfo
*
test_info
)
{
static
bool
TestReportableDisabled
(
const
TestInfo
*
test_info
)
{
return
test_info
->
is_reportable
()
&&
test_info
->
is_disabled_
;
return
test_info
->
is_reportable
()
&&
test_info
->
is_disabled_
;
}
}
// Returns true if
f
test is disabled.
// Returns true if test is disabled.
static
bool
TestDisabled
(
const
TestInfo
*
test_info
)
{
static
bool
TestDisabled
(
const
TestInfo
*
test_info
)
{
return
test_info
->
is_disabled_
;
return
test_info
->
is_disabled_
;
}
}
// Returns true if
f
this test will appear in the XML report.
// Returns true if this test will appear in the XML report.
static
bool
TestReportable
(
const
TestInfo
*
test_info
)
{
static
bool
TestReportable
(
const
TestInfo
*
test_info
)
{
return
test_info
->
is_reportable
();
return
test_info
->
is_reportable
();
}
}
...
@@ -1010,7 +1010,7 @@ class GTEST_API_ TestSuite {
...
@@ -1010,7 +1010,7 @@ class GTEST_API_ TestSuite {
internal
::
SetUpTestSuiteFunc
set_up_tc_
;
internal
::
SetUpTestSuiteFunc
set_up_tc_
;
// Pointer to the function that tears down the test suite.
// Pointer to the function that tears down the test suite.
internal
::
TearDownTestSuiteFunc
tear_down_tc_
;
internal
::
TearDownTestSuiteFunc
tear_down_tc_
;
// True if
f
any test in this test suite should run.
// True if any test in this test suite should run.
bool
should_run_
;
bool
should_run_
;
// The start time, in milliseconds since UNIX Epoch.
// The start time, in milliseconds since UNIX Epoch.
TimeInMillis
start_timestamp_
;
TimeInMillis
start_timestamp_
;
...
@@ -1345,10 +1345,10 @@ class GTEST_API_ UnitTest {
...
@@ -1345,10 +1345,10 @@ class GTEST_API_ UnitTest {
// Gets the elapsed time, in milliseconds.
// Gets the elapsed time, in milliseconds.
TimeInMillis
elapsed_time
()
const
;
TimeInMillis
elapsed_time
()
const
;
// Returns true if
f
the unit test passed (i.e. all test suites passed).
// Returns true if the unit test passed (i.e. all test suites passed).
bool
Passed
()
const
;
bool
Passed
()
const
;
// Returns true if
f
the unit test failed (i.e. some test suite failed
// Returns true if the unit test failed (i.e. some test suite failed
// or something outside of all tests failed).
// or something outside of all tests failed).
bool
Failed
()
const
;
bool
Failed
()
const
;
...
@@ -2263,7 +2263,7 @@ class GTEST_API_ ScopedTrace {
...
@@ -2263,7 +2263,7 @@ class GTEST_API_ ScopedTrace {
// Compile-time assertion for type equality.
// Compile-time assertion for type equality.
// StaticAssertTypeEq<type1, type2>() compiles if
f
type1 and type2 are
// StaticAssertTypeEq<type1, type2>() compiles if type1 and type2 are
// the same type. The value it returns is not interesting.
// the same type. The value it returns is not interesting.
//
//
// Instead of making StaticAssertTypeEq a class template, we make it a
// Instead of making StaticAssertTypeEq a class template, we make it a
...
...
googletest/include/gtest/internal/gtest-filepath.h
View file @
bf6df7ea
...
@@ -110,7 +110,7 @@ class GTEST_API_ FilePath {
...
@@ -110,7 +110,7 @@ class GTEST_API_ FilePath {
const
FilePath
&
base_name
,
const
FilePath
&
base_name
,
const
char
*
extension
);
const
char
*
extension
);
// Returns true if
f
the path is "".
// Returns true if the path is "".
bool
IsEmpty
()
const
{
return
pathname_
.
empty
();
}
bool
IsEmpty
()
const
{
return
pathname_
.
empty
();
}
// If input name has a trailing separator character, removes it and returns
// If input name has a trailing separator character, removes it and returns
...
...
Prev
1
2
3
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