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
7e7e3a6f
Unverified
Commit
7e7e3a6f
authored
Aug 15, 2018
by
Gennadiy Civil
Committed by
GitHub
Aug 15, 2018
Browse files
Merge branch 'master' into patch-1
parents
b50b2f77
997d343d
Changes
204
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
85 additions
and
73 deletions
+85
-73
googlemock/include/gmock/gmock-more-matchers.h
googlemock/include/gmock/gmock-more-matchers.h
+3
-2
googlemock/include/gmock/gmock-spec-builders.h
googlemock/include/gmock/gmock-spec-builders.h
+23
-22
googlemock/include/gmock/gmock.h
googlemock/include/gmock/gmock.h
+3
-2
googlemock/include/gmock/internal/custom/README.md
googlemock/include/gmock/internal/custom/README.md
+16
-0
googlemock/include/gmock/internal/custom/gmock-generated-actions.h
...k/include/gmock/internal/custom/gmock-generated-actions.h
+2
-0
googlemock/include/gmock/internal/custom/gmock-generated-actions.h.pump
...lude/gmock/internal/custom/gmock-generated-actions.h.pump
+2
-0
googlemock/include/gmock/internal/custom/gmock-matchers.h
googlemock/include/gmock/internal/custom/gmock-matchers.h
+3
-5
googlemock/include/gmock/internal/custom/gmock-port.h
googlemock/include/gmock/internal/custom/gmock-port.h
+3
-10
googlemock/include/gmock/internal/gmock-generated-internal-utils.h
...k/include/gmock/internal/gmock-generated-internal-utils.h
+3
-2
googlemock/include/gmock/internal/gmock-generated-internal-utils.h.pump
...lude/gmock/internal/gmock-generated-internal-utils.h.pump
+3
-2
googlemock/include/gmock/internal/gmock-internal-utils.h
googlemock/include/gmock/internal/gmock-internal-utils.h
+5
-4
googlemock/include/gmock/internal/gmock-port.h
googlemock/include/gmock/internal/gmock-port.h
+3
-2
googlemock/scripts/upload.py
googlemock/scripts/upload.py
+4
-4
googlemock/src/gmock-all.cc
googlemock/src/gmock-all.cc
+1
-2
googlemock/src/gmock-cardinalities.cc
googlemock/src/gmock-cardinalities.cc
+1
-2
googlemock/src/gmock-internal-utils.cc
googlemock/src/gmock-internal-utils.cc
+1
-2
googlemock/src/gmock-matchers.cc
googlemock/src/gmock-matchers.cc
+1
-2
googlemock/src/gmock-spec-builders.cc
googlemock/src/gmock-spec-builders.cc
+3
-4
googlemock/src/gmock.cc
googlemock/src/gmock.cc
+2
-3
googlemock/src/gmock_main.cc
googlemock/src/gmock_main.cc
+3
-3
No files found.
googlemock/include/gmock/gmock-more-matchers.h
View file @
7e7e3a6f
...
@@ -26,8 +26,7 @@
...
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Author: marcus.boerger@google.com (Marcus Boerger)
// Google Mock - a framework for writing C++ mock classes.
// Google Mock - a framework for writing C++ mock classes.
//
//
...
@@ -36,6 +35,8 @@
...
@@ -36,6 +35,8 @@
// Note that tests are implemented in gmock-matchers_test.cc rather than
// Note that tests are implemented in gmock-matchers_test.cc rather than
// gmock-more-matchers-test.cc.
// gmock-more-matchers-test.cc.
// GOOGLETEST_CM0002 DO NOT DELETE
#ifndef GMOCK_GMOCK_MORE_MATCHERS_H_
#ifndef GMOCK_GMOCK_MORE_MATCHERS_H_
#define GMOCK_GMOCK_MORE_MATCHERS_H_
#define GMOCK_GMOCK_MORE_MATCHERS_H_
...
...
googlemock/include/gmock/gmock-spec-builders.h
View file @
7e7e3a6f
...
@@ -26,8 +26,7 @@
...
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Author: wan@google.com (Zhanyong Wan)
// Google Mock - a framework for writing C++ mock classes.
// Google Mock - a framework for writing C++ mock classes.
//
//
...
@@ -57,6 +56,8 @@
...
@@ -57,6 +56,8 @@
// where all clauses are optional, and .InSequence()/.After()/
// where all clauses are optional, and .InSequence()/.After()/
// .WillOnce() can appear any number of times.
// .WillOnce() can appear any number of times.
// GOOGLETEST_CM0002 DO NOT DELETE
#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_SPEC_BUILDERS_H_
#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_SPEC_BUILDERS_H_
#define GMOCK_INCLUDE_GMOCK_GMOCK_SPEC_BUILDERS_H_
#define GMOCK_INCLUDE_GMOCK_GMOCK_SPEC_BUILDERS_H_
...
@@ -183,7 +184,7 @@ class GTEST_API_ UntypedFunctionMockerBase {
...
@@ -183,7 +184,7 @@ class GTEST_API_ UntypedFunctionMockerBase {
// this information in the global mock registry. Will be called
// this information in the global mock registry. Will be called
// whenever an EXPECT_CALL() or ON_CALL() is executed on this mock
// whenever an EXPECT_CALL() or ON_CALL() is executed on this mock
// method.
// method.
//
TODO(wan@google.com)
: rename to SetAndRegisterOwner().
//
FIXME
: rename to SetAndRegisterOwner().
void
RegisterOwner
(
const
void
*
mock_obj
)
void
RegisterOwner
(
const
void
*
mock_obj
)
GTEST_LOCK_EXCLUDED_
(
g_gmock_mutex
);
GTEST_LOCK_EXCLUDED_
(
g_gmock_mutex
);
...
@@ -1206,7 +1207,7 @@ class TypedExpectation : public ExpectationBase {
...
@@ -1206,7 +1207,7 @@ class TypedExpectation : public ExpectationBase {
mocker
->
DescribeDefaultActionTo
(
args
,
what
);
mocker
->
DescribeDefaultActionTo
(
args
,
what
);
DescribeCallCountTo
(
why
);
DescribeCallCountTo
(
why
);
//
TODO(wan@google.com)
: allow the user to control whether
//
FIXME
: allow the user to control whether
// unexpected calls should fail immediately or continue using a
// unexpected calls should fail immediately or continue using a
// flag --gmock_unexpected_calls_are_fatal.
// flag --gmock_unexpected_calls_are_fatal.
return
NULL
;
return
NULL
;
...
@@ -1854,22 +1855,22 @@ inline Expectation::Expectation(internal::ExpectationBase& exp) // NOLINT
...
@@ -1854,22 +1855,22 @@ inline Expectation::Expectation(internal::ExpectationBase& exp) // NOLINT
// parameter. This technique may only be used for non-overloaded methods.
// parameter. This technique may only be used for non-overloaded methods.
//
//
// // These are the same:
// // These are the same:
// ON_CALL(mock, NoArgsMethod()).WillByDefault(
…
);
// ON_CALL(mock, NoArgsMethod()).WillByDefault(
...
);
// ON_CALL(mock, NoArgsMethod).WillByDefault(
…
);
// ON_CALL(mock, NoArgsMethod).WillByDefault(
...
);
//
//
// // As are these:
// // As are these:
// ON_CALL(mock, TwoArgsMethod(_, _)).WillByDefault(
…
);
// ON_CALL(mock, TwoArgsMethod(_, _)).WillByDefault(
...
);
// ON_CALL(mock, TwoArgsMethod).WillByDefault(
…
);
// ON_CALL(mock, TwoArgsMethod).WillByDefault(
...
);
//
//
// // Can also specify args if you want, of course:
// // Can also specify args if you want, of course:
// ON_CALL(mock, TwoArgsMethod(_, 45)).WillByDefault(
…
);
// ON_CALL(mock, TwoArgsMethod(_, 45)).WillByDefault(
...
);
//
//
// // Overloads work as long as you specify parameters:
// // Overloads work as long as you specify parameters:
// ON_CALL(mock, OverloadedMethod(_)).WillByDefault(
…
);
// ON_CALL(mock, OverloadedMethod(_)).WillByDefault(
...
);
// ON_CALL(mock, OverloadedMethod(_, _)).WillByDefault(
…
);
// ON_CALL(mock, OverloadedMethod(_, _)).WillByDefault(
...
);
//
//
// // Oops! Which overload did you want?
// // Oops! Which overload did you want?
// ON_CALL(mock, OverloadedMethod).WillByDefault(
…
);
// ON_CALL(mock, OverloadedMethod).WillByDefault(
...
);
// => ERROR: call to member function 'gmock_OverloadedMethod' is ambiguous
// => ERROR: call to member function 'gmock_OverloadedMethod' is ambiguous
//
//
// How this works: The mock class uses two overloads of the gmock_Method
// How this works: The mock class uses two overloads of the gmock_Method
...
@@ -1877,28 +1878,28 @@ inline Expectation::Expectation(internal::ExpectationBase& exp) // NOLINT
...
@@ -1877,28 +1878,28 @@ inline Expectation::Expectation(internal::ExpectationBase& exp) // NOLINT
// In the matcher list form, the macro expands to:
// In the matcher list form, the macro expands to:
//
//
// // This statement:
// // This statement:
// ON_CALL(mock, TwoArgsMethod(_, 45))
…
// ON_CALL(mock, TwoArgsMethod(_, 45))
...
//
//
// //
…
expands to:
// //
...
expands to:
// mock.gmock_TwoArgsMethod(_, 45)(WithoutMatchers(), nullptr)
…
// mock.gmock_TwoArgsMethod(_, 45)(WithoutMatchers(), nullptr)
...
// |-------------v---------------||------------v-------------|
// |-------------v---------------||------------v-------------|
// invokes first overload swallowed by operator()
// invokes first overload swallowed by operator()
//
//
// //
…
which is essentially:
// //
...
which is essentially:
// mock.gmock_TwoArgsMethod(_, 45)
…
// mock.gmock_TwoArgsMethod(_, 45)
...
//
//
// Whereas the form without a matcher list:
// Whereas the form without a matcher list:
//
//
// // This statement:
// // This statement:
// ON_CALL(mock, TwoArgsMethod)
…
// ON_CALL(mock, TwoArgsMethod)
...
//
//
// //
…
expands to:
// //
...
expands to:
// mock.gmock_TwoArgsMethod(WithoutMatchers(), nullptr)
…
// mock.gmock_TwoArgsMethod(WithoutMatchers(), nullptr)
...
// |-----------------------v--------------------------|
// |-----------------------v--------------------------|
// invokes second overload
// invokes second overload
//
//
// //
…
which is essentially:
// //
...
which is essentially:
// mock.gmock_TwoArgsMethod(_, _)
…
// mock.gmock_TwoArgsMethod(_, _)
...
//
//
// The WithoutMatchers() argument is used to disambiguate overloads and to
// The WithoutMatchers() argument is used to disambiguate overloads and to
// block the caller from accidentally invoking the second overload directly. The
// block the caller from accidentally invoking the second overload directly. The
...
...
googlemock/include/gmock/gmock.h
View file @
7e7e3a6f
...
@@ -26,13 +26,14 @@
...
@@ -26,13 +26,14 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Author: wan@google.com (Zhanyong Wan)
// Google Mock - a framework for writing C++ mock classes.
// Google Mock - a framework for writing C++ mock classes.
//
//
// This is the main header file a user should include.
// This is the main header file a user should include.
// GOOGLETEST_CM0002 DO NOT DELETE
#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_H_
#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_H_
#define GMOCK_INCLUDE_GMOCK_GMOCK_H_
#define GMOCK_INCLUDE_GMOCK_GMOCK_H_
...
...
googlemock/include/gmock/internal/custom/README.md
0 → 100644
View file @
7e7e3a6f
# Customization Points
The custom directory is an injection point for custom user configurations.
## Header `gmock-port.h`
The following macros can be defined:
### Flag related macros:
*
`GMOCK_DECLARE_bool_(name)`
*
`GMOCK_DECLARE_int32_(name)`
*
`GMOCK_DECLARE_string_(name)`
*
`GMOCK_DEFINE_bool_(name, default_val, doc)`
*
`GMOCK_DEFINE_int32_(name, default_val, doc)`
*
`GMOCK_DEFINE_string_(name, default_val, doc)`
googlemock/include/gmock/internal/custom/gmock-generated-actions.h
View file @
7e7e3a6f
...
@@ -2,6 +2,8 @@
...
@@ -2,6 +2,8 @@
// pump.py gmock-generated-actions.h.pump
// pump.py gmock-generated-actions.h.pump
// DO NOT EDIT BY HAND!!!
// DO NOT EDIT BY HAND!!!
// GOOGLETEST_CM0002 DO NOT DELETE
#ifndef GMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_GENERATED_ACTIONS_H_
#ifndef GMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_GENERATED_ACTIONS_H_
#define GMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_GENERATED_ACTIONS_H_
#define GMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_GENERATED_ACTIONS_H_
...
...
googlemock/include/gmock/internal/custom/gmock-generated-actions.h.pump
View file @
7e7e3a6f
...
@@ -4,6 +4,8 @@ $$ it to callback-actions.h.
...
@@ -4,6 +4,8 @@ $$ it to callback-actions.h.
$$
$$
$
var
max_callback_arity
=
5
$
var
max_callback_arity
=
5
$$}}
This
meta
comment
fixes
auto
-
indentation
in
editors
.
$$}}
This
meta
comment
fixes
auto
-
indentation
in
editors
.
// GOOGLETEST_CM0002 DO NOT DELETE
#ifndef GMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_GENERATED_ACTIONS_H_
#ifndef GMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_GENERATED_ACTIONS_H_
#define GMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_GENERATED_ACTIONS_H_
#define GMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_GENERATED_ACTIONS_H_
...
...
googlemock/include/gmock/internal/custom/gmock-matchers.h
View file @
7e7e3a6f
...
@@ -27,12 +27,10 @@
...
@@ -27,12 +27,10 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
//
// ============================================================
// Injection point for custom user configurations. See README for details
// An installation-specific extension point for gmock-matchers.h.
// ============================================================
//
// Adds google3 callback support to CallableTraits.
//
//
// GOOGLETEST_CM0002 DO NOT DELETE
#ifndef GMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_MATCHERS_H_
#ifndef GMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_MATCHERS_H_
#define GMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_MATCHERS_H_
#define GMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_MATCHERS_H_
#endif // GMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_MATCHERS_H_
#endif // GMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_MATCHERS_H_
googlemock/include/gmock/internal/custom/gmock-port.h
View file @
7e7e3a6f
...
@@ -27,19 +27,12 @@
...
@@ -27,19 +27,12 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
//
// Injection point for custom user configurations.
// Injection point for custom user configurations. See README for details
// The following macros can be defined:
//
// Flag related macros:
// GMOCK_DECLARE_bool_(name)
// GMOCK_DECLARE_int32_(name)
// GMOCK_DECLARE_string_(name)
// GMOCK_DEFINE_bool_(name, default_val, doc)
// GMOCK_DEFINE_int32_(name, default_val, doc)
// GMOCK_DEFINE_string_(name, default_val, doc)
//
//
// ** Custom implementation starts here **
// ** Custom implementation starts here **
// GOOGLETEST_CM0002 DO NOT DELETE
#ifndef GMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_PORT_H_
#ifndef GMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_PORT_H_
#define GMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_PORT_H_
#define GMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_PORT_H_
...
...
googlemock/include/gmock/internal/gmock-generated-internal-utils.h
View file @
7e7e3a6f
...
@@ -30,14 +30,15 @@
...
@@ -30,14 +30,15 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Author: wan@google.com (Zhanyong Wan)
// Google Mock - a framework for writing C++ mock classes.
// Google Mock - a framework for writing C++ mock classes.
//
//
// This file contains template meta-programming utility classes needed
// This file contains template meta-programming utility classes needed
// for implementing Google Mock.
// for implementing Google Mock.
// GOOGLETEST_CM0002 DO NOT DELETE
#ifndef GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_GENERATED_INTERNAL_UTILS_H_
#ifndef GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_GENERATED_INTERNAL_UTILS_H_
#define GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_GENERATED_INTERNAL_UTILS_H_
#define GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_GENERATED_INTERNAL_UTILS_H_
...
...
googlemock/include/gmock/internal/gmock-generated-internal-utils.h.pump
View file @
7e7e3a6f
...
@@ -31,14 +31,15 @@ $var n = 10 $$ The maximum arity we support.
...
@@ -31,14 +31,15 @@ $var n = 10 $$ The maximum arity we support.
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Author: wan@google.com (Zhanyong Wan)
// Google Mock - a framework for writing C++ mock classes.
// Google Mock - a framework for writing C++ mock classes.
//
//
// This file contains template meta-programming utility classes needed
// This file contains template meta-programming utility classes needed
// for implementing Google Mock.
// for implementing Google Mock.
// GOOGLETEST_CM0002 DO NOT DELETE
#ifndef GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_GENERATED_INTERNAL_UTILS_H_
#ifndef GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_GENERATED_INTERNAL_UTILS_H_
#define GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_GENERATED_INTERNAL_UTILS_H_
#define GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_GENERATED_INTERNAL_UTILS_H_
...
...
googlemock/include/gmock/internal/gmock-internal-utils.h
View file @
7e7e3a6f
...
@@ -26,8 +26,7 @@
...
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Author: wan@google.com (Zhanyong Wan)
// Google Mock - a framework for writing C++ mock classes.
// Google Mock - a framework for writing C++ mock classes.
//
//
...
@@ -35,6 +34,8 @@
...
@@ -35,6 +34,8 @@
// Mock. They are subject to change without notice, so please DO NOT
// Mock. They are subject to change without notice, so please DO NOT
// USE THEM IN USER CODE.
// USE THEM IN USER CODE.
// GOOGLETEST_CM0002 DO NOT DELETE
#ifndef GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_INTERNAL_UTILS_H_
#ifndef GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_INTERNAL_UTILS_H_
#define GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_INTERNAL_UTILS_H_
#define GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_INTERNAL_UTILS_H_
...
@@ -348,7 +349,7 @@ GTEST_API_ void Log(LogSeverity severity, const std::string& message,
...
@@ -348,7 +349,7 @@ GTEST_API_ void Log(LogSeverity severity, const std::string& message,
// correct overload. This must not be instantiable, to prevent client code from
// correct overload. This must not be instantiable, to prevent client code from
// accidentally resolving to the overload; for example:
// accidentally resolving to the overload; for example:
//
//
// ON_CALL(mock, Method({}, nullptr))
…
// ON_CALL(mock, Method({}, nullptr))
...
//
//
class
WithoutMatchers
{
class
WithoutMatchers
{
private:
private:
...
@@ -359,7 +360,7 @@ class WithoutMatchers {
...
@@ -359,7 +360,7 @@ class WithoutMatchers {
// Internal use only: access the singleton instance of WithoutMatchers.
// Internal use only: access the singleton instance of WithoutMatchers.
GTEST_API_
WithoutMatchers
GetWithoutMatchers
();
GTEST_API_
WithoutMatchers
GetWithoutMatchers
();
//
TODO(wan@google.com)
: group all type utilities together.
//
FIXME
: group all type utilities together.
// Type traits.
// Type traits.
...
...
googlemock/include/gmock/internal/gmock-port.h
View file @
7e7e3a6f
...
@@ -26,8 +26,7 @@
...
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Author: vadimb@google.com (Vadim Berman)
//
//
// Low-level types and utilities for porting Google Mock to various
// Low-level types and utilities for porting Google Mock to various
// platforms. All macros ending with _ and symbols defined in an
// platforms. All macros ending with _ and symbols defined in an
...
@@ -36,6 +35,8 @@
...
@@ -36,6 +35,8 @@
// end with _ are part of Google Mock's public API and can be used by
// end with _ are part of Google Mock's public API and can be used by
// code outside Google Mock.
// code outside Google Mock.
// GOOGLETEST_CM0002 DO NOT DELETE
#ifndef GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_PORT_H_
#ifndef GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_PORT_H_
#define GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_PORT_H_
#define GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_PORT_H_
...
...
googlemock/scripts/upload.py
View file @
7e7e3a6f
...
@@ -242,7 +242,7 @@ class AbstractRpcServer(object):
...
@@ -242,7 +242,7 @@ class AbstractRpcServer(object):
The authentication process works as follows:
The authentication process works as follows:
1) We get a username and password from the user
1) We get a username and password from the user
2) We use ClientLogin to obtain an AUTH token for the user
2) We use ClientLogin to obtain an AUTH token for the user
(see http://
co
de.google.com/
apis/account
s/AuthForInstalledApps
.html
).
(see http
s
://de
velopers
.google.com/
identity/protocol
s/AuthForInstalledApps).
3) We pass the auth token to /_ah/login on the server to obtain an
3) We pass the auth token to /_ah/login on the server to obtain an
authentication cookie. If login was successful, it tries to redirect
authentication cookie. If login was successful, it tries to redirect
us to the URL we provided.
us to the URL we provided.
...
@@ -506,7 +506,7 @@ def EncodeMultipartFormData(fields, files):
...
@@ -506,7 +506,7 @@ def EncodeMultipartFormData(fields, files):
(content_type, body) ready for httplib.HTTP instance.
(content_type, body) ready for httplib.HTTP instance.
Source:
Source:
http://
aspn.activestate.com/ASPN/Cookbook/Python/R
ecipe/146306
http
s
://
web.archive.org/web/20160116052001/code.activestate.com/r
ecipe
s
/146306
"""
"""
BOUNDARY
=
'-M-A-G-I-C---B-O-U-N-D-A-R-Y-'
BOUNDARY
=
'-M-A-G-I-C---B-O-U-N-D-A-R-Y-'
CRLF
=
'
\r\n
'
CRLF
=
'
\r\n
'
...
@@ -807,7 +807,7 @@ class SubversionVCS(VersionControlSystem):
...
@@ -807,7 +807,7 @@ class SubversionVCS(VersionControlSystem):
# svn cat translates keywords but svn diff doesn't. As a result of this
# svn cat translates keywords but svn diff doesn't. As a result of this
# behavior patching.PatchChunks() fails with a chunk mismatch error.
# behavior patching.PatchChunks() fails with a chunk mismatch error.
# This part was originally written by the Review Board development team
# This part was originally written by the Review Board development team
# who had the same problem (http://reviews.review
-
board.org/r/276/).
# who had the same problem (http
s
://reviews.reviewboard.org/r/276/).
# Mapping of keywords to known aliases
# Mapping of keywords to known aliases
svn_keywords
=
{
svn_keywords
=
{
# Standard keywords
# Standard keywords
...
@@ -860,7 +860,7 @@ class SubversionVCS(VersionControlSystem):
...
@@ -860,7 +860,7 @@ class SubversionVCS(VersionControlSystem):
status_lines
=
status
.
splitlines
()
status_lines
=
status
.
splitlines
()
# If file is in a cl, the output will begin with
# If file is in a cl, the output will begin with
# "\n--- Changelist 'cl_name':\n". See
# "\n--- Changelist 'cl_name':\n". See
# http://svn.collab.net/repos/svn/trunk/notes/changelist-design.txt
# http
s
://
web.archive.org/web/20090918234815/
svn.collab.net/repos/svn/trunk/notes/changelist-design.txt
if
(
len
(
status_lines
)
==
3
and
if
(
len
(
status_lines
)
==
3
and
not
status_lines
[
0
]
and
not
status_lines
[
0
]
and
status_lines
[
1
].
startswith
(
"--- Changelist"
)):
status_lines
[
1
].
startswith
(
"--- Changelist"
)):
...
...
googlemock/src/gmock-all.cc
View file @
7e7e3a6f
...
@@ -26,8 +26,7 @@
...
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Author: wan@google.com (Zhanyong Wan)
//
//
// Google C++ Mocking Framework (Google Mock)
// Google C++ Mocking Framework (Google Mock)
//
//
...
...
googlemock/src/gmock-cardinalities.cc
View file @
7e7e3a6f
...
@@ -26,8 +26,7 @@
...
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Author: wan@google.com (Zhanyong Wan)
// Google Mock - a framework for writing C++ mock classes.
// Google Mock - a framework for writing C++ mock classes.
//
//
...
...
googlemock/src/gmock-internal-utils.cc
View file @
7e7e3a6f
...
@@ -26,8 +26,7 @@
...
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Author: wan@google.com (Zhanyong Wan)
// Google Mock - a framework for writing C++ mock classes.
// Google Mock - a framework for writing C++ mock classes.
//
//
...
...
googlemock/src/gmock-matchers.cc
View file @
7e7e3a6f
...
@@ -26,8 +26,7 @@
...
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Author: wan@google.com (Zhanyong Wan)
// Google Mock - a framework for writing C++ mock classes.
// Google Mock - a framework for writing C++ mock classes.
//
//
...
...
googlemock/src/gmock-spec-builders.cc
View file @
7e7e3a6f
...
@@ -26,8 +26,7 @@
...
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Author: wan@google.com (Zhanyong Wan)
// Google Mock - a framework for writing C++ mock classes.
// Google Mock - a framework for writing C++ mock classes.
//
//
...
@@ -607,7 +606,7 @@ class MockObjectRegistry {
...
@@ -607,7 +606,7 @@ class MockObjectRegistry {
if
(
it
->
second
.
leakable
)
// The user said it's fine to leak this object.
if
(
it
->
second
.
leakable
)
// The user said it's fine to leak this object.
continue
;
continue
;
//
TODO(wan@google.com)
: Print the type of the leaked object.
//
FIXME
: Print the type of the leaked object.
// This can help the user identify the leaked object.
// This can help the user identify the leaked object.
std
::
cout
<<
"
\n
"
;
std
::
cout
<<
"
\n
"
;
const
MockObjectState
&
state
=
it
->
second
;
const
MockObjectState
&
state
=
it
->
second
;
...
@@ -783,7 +782,7 @@ void Mock::RegisterUseByOnCallOrExpectCall(const void* mock_obj,
...
@@ -783,7 +782,7 @@ void Mock::RegisterUseByOnCallOrExpectCall(const void* mock_obj,
const
TestInfo
*
const
test_info
=
const
TestInfo
*
const
test_info
=
UnitTest
::
GetInstance
()
->
current_test_info
();
UnitTest
::
GetInstance
()
->
current_test_info
();
if
(
test_info
!=
NULL
)
{
if
(
test_info
!=
NULL
)
{
//
TODO(wan@google.com)
: record the test case name when the
//
FIXME
: record the test case name when the
// ON_CALL or EXPECT_CALL is invoked from SetUpTestCase() or
// ON_CALL or EXPECT_CALL is invoked from SetUpTestCase() or
// TearDownTestCase().
// TearDownTestCase().
state
.
first_used_test_case
=
test_info
->
test_case_name
();
state
.
first_used_test_case
=
test_info
->
test_case_name
();
...
...
googlemock/src/gmock.cc
View file @
7e7e3a6f
...
@@ -26,15 +26,14 @@
...
@@ -26,15 +26,14 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Author: wan@google.com (Zhanyong Wan)
#include "gmock/gmock.h"
#include "gmock/gmock.h"
#include "gmock/internal/gmock-port.h"
#include "gmock/internal/gmock-port.h"
namespace
testing
{
namespace
testing
{
//
TODO(wan@google.com)
: support using environment variables to
//
FIXME
: support using environment variables to
// control the flag values, like what Google Test does.
// control the flag values, like what Google Test does.
GMOCK_DEFINE_bool_
(
catch_leaked_mocks
,
true
,
GMOCK_DEFINE_bool_
(
catch_leaked_mocks
,
true
,
...
...
googlemock/src/gmock_main.cc
View file @
7e7e3a6f
...
@@ -26,8 +26,7 @@
...
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Author: wan@google.com (Zhanyong Wan)
#include <iostream>
#include <iostream>
#include "gmock/gmock.h"
#include "gmock/gmock.h"
...
@@ -37,7 +36,8 @@
...
@@ -37,7 +36,8 @@
// causes a link error when _tmain is defined in a static library and UNICODE
// causes a link error when _tmain is defined in a static library and UNICODE
// is enabled. For this reason instead of _tmain, main function is used on
// is enabled. For this reason instead of _tmain, main function is used on
// Windows. See the following link to track the current status of this bug:
// Windows. See the following link to track the current status of this bug:
// http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=394464 // NOLINT
// https://web.archive.org/web/20170912203238/connect.microsoft.com/VisualStudio/feedback/details/394464/wmain-link-error-in-the-static-library
// // NOLINT
#if GTEST_OS_WINDOWS_MOBILE
#if GTEST_OS_WINDOWS_MOBILE
# include <tchar.h> // NOLINT
# include <tchar.h> // NOLINT
...
...
Prev
1
2
3
4
5
6
…
11
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