Commit Graph

148 Commits

Author SHA1 Message Date
kosak
6e1087218b Rename custom/callback-actions.h[.pump] =>
custom/gmock-generated-actions.h[.pump].
2015-07-28 00:53:13 +00:00
kosak
58a4bb42c8 Add an injection point for customizing GMOCK_DECLARE_bool and the like. 2015-07-28 00:02:21 +00:00
kosak
6702b97d5e Inject customization point for gmock-matchers.h 2015-07-27 23:05:57 +00:00
kosak
a6e32f0a2c Explicitly specify return value for lambda in AsStdFunction() to ensure it
works properly where return type is a reference.
2015-07-24 20:05:26 +00:00
kosak
67c377d3b1 Move Callback-related generated actions to a custom/ file. 2015-07-19 20:39:47 +00:00
kosak
d86a723ed9 Mark the default constructor of Matcher<> explicit.
This prevents implicitly constructing a matcher from {}.
2015-07-13 21:19:43 +00:00
kosak
9b1a944ec4 Fix EXPECT_THAT() to support literal strings as a second argument. 2015-04-28 23:06:58 +00:00
kosak
6305ff5a92 Change IsNull and NotNull to use ==/!= nullptr in C++11.
Also update gmock_doctor due to Clang wording change.
2015-04-28 22:36:31 +00:00
kosak
d478a1f46d In C++11 and above, makes a mock method whose return type is default
constructible return a default-constructed value by default.
2015-02-14 02:45:40 +00:00
kosak
02d6479259 This change adds an explicit invocation of std::move to workaround a problem
in VC++'s /analyze compiler that was causing build errors in Chrome:

https://code.google.com/p/googlemock/issues/detail?id=172
2015-02-14 02:22:21 +00:00
kosak
53d49dc43e Make ReturnNull() support unique_ptr and shared_ptr. 2015-01-08 03:03:09 +00:00
kosak
6b81780310 Makes DoubleNear() print the diff between the actual and the expected value when the match fails.
Also fix bogus MSVC warning about "alignment of a member was sensitive to packing".
Also bring in gtest 701.
2015-01-08 02:38:14 +00:00
kosak
7123d83132 Fix gmock Action behaviour when return type is Wrapper 2014-11-17 02:04:46 +00:00
kosak
506340a66b Generate relational matchers (Eq,Lt, etc) with CRTP instead of macro. 2014-11-17 01:47:54 +00:00
kosak
d370f85b02 Call move() by qualified name (::testing::internal::move() or just internal::move()).
Pull in gtest 696.
2014-11-17 01:14:16 +00:00
kosak
389bad61e2 Silence a signedness-comparison warning in gmock-actions_test.
include <functional> when using std::function in gmock.
2014-11-17 01:08:51 +00:00
kosak
3d1c78b2bf Add ByMove() modifier for the Return() action. Pull in gtest 695. 2014-11-17 00:56:52 +00:00
kosak
5b9cbbb16d Distinguish between C++11 language and library support for std::function, std::begin, std::end, and std::move in gtest and gmock.
Bring in gtest 694.
2014-11-17 00:28:55 +00:00
kosak
2336e9c171 Defines the UnorderedPointwise(m, container) matcher, which is like Pointwise(m, container) but ignores the order of the elements. 2014-07-28 22:57:30 +00:00
kosak
06678924fa Allows {Unordered,}ElementsAreArray() to accept any STL-style container as the parameter. 2014-07-28 20:01:28 +00:00
kosak
a9e02a9178 Add MockFunction::AsStdFunction(). Also pull in gtest 688. 2014-06-17 23:19:54 +00:00
billydonahue
1f5fdea417 Push several shanges:
Make single argument constructors explicit in macros.

    Remove NOMINMAX macro.

    Add macros for disabling Microsoft Visual C++ warnings.

    Add WhenDynamicCastTo<T> matcher.
    A matcher that matches a pointer that matches inner_matcher when
    dynamic_cast<T> is applied.

    Add IWYU export pragmas to the tuple include lines.

    Fix NativeArray to not require a copy constructor unless we ask for one.
    This allows ElementsAre() to support non-copyable types.

    Examine WINAPI_FAMILY_PARTITION macros to better distinguish windows platforms.
    Author: martin@martin.st
    From: https://codereview.appspot.com/57220043/
2014-05-19 17:54:51 +00:00
kosak
bd0188320d Export tuple and friends in the ::testing namespace. 2014-04-02 20:30:00 +00:00
kosak
b6a348862b Introduce a BeginEndDistanceIs matcher for containers such as std::forward_list
which lack a size() member.

Also pull in gtest 678.
2014-03-12 21:06:46 +00:00
kosak
b5c81098a8 Support mocking methods with move-only return types. 2014-01-29 06:41:44 +00:00
kosak
b93d0f10d5 Make Google Mock build cleanly on Visual Studio 2010, 2012, 2013. 2014-01-13 22:28:01 +00:00
kosak
04ce8521f4 Adds a note in the "uninteresting mock method call" warning to advise people how to handle the warning.
Clarifies the purpose of utilities in gmock-port.h and adds guidance w.r.t. gmock-port.h vs gtest-port.h.
Pulls in gtest r674.
2014-01-12 23:42:34 +00:00
kosak
18489fa4f8 Distinguish between C++11 language and library support for <initializer_list>.
Fix spelling: repositary -> repository.
Pull in gtest 671.
2013-12-04 23:49:07 +00:00
kosak
5f2a6ca4fd Don't copy the argument in SafeMatcherCast because it's not safe. 2013-12-03 01:43:07 +00:00
zhanyong.wan
1cc1d4bcec Makes some container matchers accept initializer lists in C++11 mode and work with stream-like containers that don't have size() or empty(); exposes StringMatchResultListener for defining composite matchers. 2013-08-08 18:41:51 +00:00
zhanyong.wan
5579c1a8b1 Makes UnorderedElementsAre*() work with containers that don't have size() or empty(). 2013-07-30 06:16:21 +00:00
zhanyong.wan
fb25d53911 Adds matchers UnorderedElementsAre[Array]() (by Billy Donahue); pulls in
gtest r660.
2013-07-28 08:24:00 +00:00
zhanyong.wan
2989703ed8 Fixes uses of pair to std::pair; pulls in gtest r655. 2013-06-20 18:59:15 +00:00
zhanyong.wan
616180e684 New floating-point matchers: DoubleNear() and friends;
AllOf() and AnyOf() can accept any number of arguments now in C++11 mode.
2013-06-18 18:49:51 +00:00
zhanyong.wan
f4274520da Makes EXPECT_THAT typesafe; updates CHANGES for 1.7.0; pulls in gtest r653 2013-04-24 02:49:43 +00:00
zhanyong.wan
a9a59e06dd Makes WhenSorted() support associative containers (by billydonahue@google.com). 2013-03-27 16:14:55 +00:00
zhanyong.wan
1f122a06e6 Adds special support for matching StringPiece. Pulls in gtest r646. 2013-03-25 16:27:03 +00:00
zhanyong.wan
2eab17b76d Removes an unnecessary semi-colon, which causes a warning in GCC's pedantic mode. 2013-03-08 17:53:24 +00:00
zhanyong.wan
c896504e41 Improves the tests for nice, naggy, and strict mocks. 2013-03-01 07:10:07 +00:00
zhanyong.wan
20d1a235bc Allows the return type of a mock method to contain unprotected commas. 2013-03-01 06:58:38 +00:00
zhanyong.wan
844fa94976 Implements NaggyMock. 2013-03-01 01:54:22 +00:00
zhanyong.wan
a31d9ce290 Implements matcher SizeIs(). 2013-03-01 01:50:17 +00:00
zhanyong.wan
83f6b08b5f Clarifies how to implement MatcherInterface. 2013-03-01 01:47:35 +00:00
zhanyong.wan
320814aca0 Implements matcher IsEmpty(); also pulls in gtest r643. 2013-03-01 00:20:30 +00:00
zhanyong.wan
edd4ab4945 Makes googlemock throw a runtime_error instead of abort when a mock
method with no default value is invoked (if exceptions are enabled).
2013-02-28 22:58:51 +00:00
jgm
38513a8bb1 Unfortunately, the svn repo is a bit out of date. This commit contains 8
changes that haven't made it to svn. The descriptions of each change are listed
below.

- Fixes some python shebang lines.

- Add ElementsAreArray overloads to gmock. ElementsAreArray now makes a copy of
  its input elements before the conversion to a Matcher. ElementsAreArray can
  now take a vector as input. ElementsAreArray can now take an iterator pair as
  input.

- Templatize MatchAndExplain to allow independent string types for the matcher
  and matchee. I also templatized the ConstCharPointer version of
  MatchAndExplain to avoid calls with "char*" from using the new templated
  MatchAndExplain.

- Fixes the bug where the constructor of the return type of ElementsAre() saves
  a reference instead of a copy of the arguments.

- Extends ElementsAre() to accept arrays whose sizes aren't known.

- Switches gTest's internal FilePath class from testing::internal::String to
  std::string. testing::internal::String was introduced when gTest couldn't
  depend on std::string.  It's now deprecated.

- Switches gTest & gMock from using testing::internal::String objects to
  std::string. Some static methods of String are still in use.  We may be able
  to remove some but not all of them.  In particular, String::Format() should
  eventually be removed as it truncates the result at 4096 characters, often
  causing problems.
2012-11-15 15:50:36 +00:00
vladlosev
ada23475e2 Makes gmock's Pointee() work for optional<T> (by Jeffrey Yasskin). 2012-08-14 15:38:49 +00:00
zhanyong.wan
2fd619edd3 Pulls in gtest r615.
Renames internal enums to the kFoo naming style.

Fixes gmock doctor to work with newer versions of Clang.
2012-05-31 20:40:56 +00:00
jgm
79a367eb21 Reduced template instantiation depth for the AllOf and AnyOf matchers. Also some formatting changes. 2012-04-10 16:02:11 +00:00
vladlosev
9bcb5f9146 Fixes a lock reentrancy when destroying a mock causes destruction of another mock (issue 79) (by Aaron Jacobs). 2011-10-24 23:41:07 +00:00