Merge branch 'master' into master
This commit is contained in:
commit
3c4f437c24
|
@ -128,13 +128,13 @@ if(INSTALL_GMOCK)
|
||||||
# configure and install pkgconfig files
|
# configure and install pkgconfig files
|
||||||
configure_file(
|
configure_file(
|
||||||
cmake/gmock.pc.in
|
cmake/gmock.pc.in
|
||||||
"${CMAKE_BINARY_DIR}/gmock.pc"
|
"${gmock_BINARY_DIR}/gmock.pc"
|
||||||
@ONLY)
|
@ONLY)
|
||||||
configure_file(
|
configure_file(
|
||||||
cmake/gmock_main.pc.in
|
cmake/gmock_main.pc.in
|
||||||
"${CMAKE_BINARY_DIR}/gmock_main.pc"
|
"${gmock_BINARY_DIR}/gmock_main.pc"
|
||||||
@ONLY)
|
@ONLY)
|
||||||
install(FILES "${CMAKE_BINARY_DIR}/gmock.pc" "${CMAKE_BINARY_DIR}/gmock_main.pc"
|
install(FILES "${gmock_BINARY_DIR}/gmock.pc" "${gmock_BINARY_DIR}/gmock_main.pc"
|
||||||
DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
|
DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
|
@ -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.
|
||||||
//
|
//
|
||||||
|
|
|
@ -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.
|
||||||
//
|
//
|
||||||
|
|
|
@ -30,8 +30,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.
|
||||||
//
|
//
|
||||||
|
@ -215,8 +214,7 @@ class InvokeHelper<R, ::testing::tuple<A1, A2, A3, A4, A5, A6> > {
|
||||||
get<2>(args), get<3>(args), get<4>(args), get<5>(args));
|
get<2>(args), get<3>(args), get<4>(args), get<5>(args));
|
||||||
}
|
}
|
||||||
|
|
||||||
// There is no InvokeCallback() for 6-tuples, as google3 callbacks
|
// There is no InvokeCallback() for 6-tuples
|
||||||
// support 5 arguments at most.
|
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename R, typename A1, typename A2, typename A3, typename A4,
|
template <typename R, typename A1, typename A2, typename A3, typename A4,
|
||||||
|
@ -240,8 +238,7 @@ class InvokeHelper<R, ::testing::tuple<A1, A2, A3, A4, A5, A6, A7> > {
|
||||||
get<6>(args));
|
get<6>(args));
|
||||||
}
|
}
|
||||||
|
|
||||||
// There is no InvokeCallback() for 7-tuples, as google3 callbacks
|
// There is no InvokeCallback() for 7-tuples
|
||||||
// support 5 arguments at most.
|
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename R, typename A1, typename A2, typename A3, typename A4,
|
template <typename R, typename A1, typename A2, typename A3, typename A4,
|
||||||
|
@ -266,8 +263,7 @@ class InvokeHelper<R, ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8> > {
|
||||||
get<6>(args), get<7>(args));
|
get<6>(args), get<7>(args));
|
||||||
}
|
}
|
||||||
|
|
||||||
// There is no InvokeCallback() for 8-tuples, as google3 callbacks
|
// There is no InvokeCallback() for 8-tuples
|
||||||
// support 5 arguments at most.
|
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename R, typename A1, typename A2, typename A3, typename A4,
|
template <typename R, typename A1, typename A2, typename A3, typename A4,
|
||||||
|
@ -292,8 +288,7 @@ class InvokeHelper<R, ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9> > {
|
||||||
get<6>(args), get<7>(args), get<8>(args));
|
get<6>(args), get<7>(args), get<8>(args));
|
||||||
}
|
}
|
||||||
|
|
||||||
// There is no InvokeCallback() for 9-tuples, as google3 callbacks
|
// There is no InvokeCallback() for 9-tuples
|
||||||
// support 5 arguments at most.
|
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename R, typename A1, typename A2, typename A3, typename A4,
|
template <typename R, typename A1, typename A2, typename A3, typename A4,
|
||||||
|
@ -320,8 +315,7 @@ class InvokeHelper<R, ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9,
|
||||||
get<6>(args), get<7>(args), get<8>(args), get<9>(args));
|
get<6>(args), get<7>(args), get<8>(args), get<9>(args));
|
||||||
}
|
}
|
||||||
|
|
||||||
// There is no InvokeCallback() for 10-tuples, as google3 callbacks
|
// There is no InvokeCallback() for 10-tuples
|
||||||
// support 5 arguments at most.
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Implements the Invoke(callback) action.
|
// Implements the Invoke(callback) action.
|
||||||
|
|
|
@ -32,8 +32,7 @@ $$}} This meta comment fixes auto-indentation in editors.
|
||||||
// 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.
|
||||||
//
|
//
|
||||||
|
@ -88,8 +87,7 @@ $if i <= max_callback_arity [[
|
||||||
return callback->Run($gets);
|
return callback->Run($gets);
|
||||||
}
|
}
|
||||||
]] $else [[
|
]] $else [[
|
||||||
// There is no InvokeCallback() for $i-tuples, as google3 callbacks
|
// There is no InvokeCallback() for $i-tuples
|
||||||
// support $max_callback_arity arguments at most.
|
|
||||||
]]
|
]]
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -30,8 +30,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.
|
||||||
//
|
//
|
||||||
|
|
|
@ -31,8 +31,7 @@ $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.
|
||||||
//
|
//
|
||||||
|
|
|
@ -30,8 +30,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)
|
|
||||||
|
|
||||||
// Implements class templates NiceMock, NaggyMock, and StrictMock.
|
// Implements class templates NiceMock, NaggyMock, and StrictMock.
|
||||||
//
|
//
|
||||||
|
|
|
@ -31,8 +31,7 @@ $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)
|
|
||||||
|
|
||||||
// Implements class templates NiceMock, NaggyMock, and StrictMock.
|
// Implements class templates NiceMock, NaggyMock, and StrictMock.
|
||||||
//
|
//
|
||||||
|
|
|
@ -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.
|
||||||
//
|
//
|
||||||
|
@ -74,7 +73,7 @@ namespace testing {
|
||||||
// MatchResultListener is an abstract class. Its << operator can be
|
// MatchResultListener is an abstract class. Its << operator can be
|
||||||
// used by a matcher to explain why a value matches or doesn't match.
|
// used by a matcher to explain why a value matches or doesn't match.
|
||||||
//
|
//
|
||||||
// TODO(wan@google.com): add method
|
// FIXME: add method
|
||||||
// bool InterestedInWhy(bool result) const;
|
// bool InterestedInWhy(bool result) const;
|
||||||
// to indicate whether the listener is interested in why the match
|
// to indicate whether the listener is interested in why the match
|
||||||
// result is 'result'.
|
// result is 'result'.
|
||||||
|
@ -923,7 +922,7 @@ class TuplePrefix {
|
||||||
GTEST_REFERENCE_TO_CONST_(Value) value = get<N - 1>(values);
|
GTEST_REFERENCE_TO_CONST_(Value) value = get<N - 1>(values);
|
||||||
StringMatchResultListener listener;
|
StringMatchResultListener listener;
|
||||||
if (!matcher.MatchAndExplain(value, &listener)) {
|
if (!matcher.MatchAndExplain(value, &listener)) {
|
||||||
// TODO(wan): include in the message the name of the parameter
|
// FIXME: include in the message the name of the parameter
|
||||||
// as used in MOCK_METHOD*() when possible.
|
// as used in MOCK_METHOD*() when possible.
|
||||||
*os << " Expected arg #" << N - 1 << ": ";
|
*os << " Expected arg #" << N - 1 << ": ";
|
||||||
get<N - 1>(matchers).DescribeTo(os);
|
get<N - 1>(matchers).DescribeTo(os);
|
||||||
|
@ -2421,7 +2420,7 @@ class WhenDynamicCastToMatcher : public WhenDynamicCastToMatcherBase<To> {
|
||||||
|
|
||||||
template <typename From>
|
template <typename From>
|
||||||
bool MatchAndExplain(From from, MatchResultListener* listener) const {
|
bool MatchAndExplain(From from, MatchResultListener* listener) const {
|
||||||
// TODO(sbenza): Add more detail on failures. ie did the dyn_cast fail?
|
// FIXME: Add more detail on failures. ie did the dyn_cast fail?
|
||||||
To to = dynamic_cast<To>(from);
|
To to = dynamic_cast<To>(from);
|
||||||
return MatchPrintAndExplain(to, this->matcher_, listener);
|
return MatchPrintAndExplain(to, this->matcher_, listener);
|
||||||
}
|
}
|
||||||
|
|
|
@ -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.
|
||||||
//
|
//
|
||||||
|
|
|
@ -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.
|
||||||
//
|
//
|
||||||
|
|
|
@ -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.
|
||||||
//
|
//
|
||||||
|
@ -185,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);
|
||||||
|
|
||||||
|
@ -1208,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;
|
||||||
|
|
|
@ -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.
|
||||||
//
|
//
|
||||||
|
|
16
googlemock/include/gmock/internal/custom/README.md
Normal file
16
googlemock/include/gmock/internal/custom/README.md
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
# 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)`
|
|
@ -27,9 +27,7 @@
|
||||||
// (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.
|
|
||||||
// ============================================================
|
|
||||||
//
|
//
|
||||||
// GOOGLETEST_CM0002 DO NOT DELETE
|
// GOOGLETEST_CM0002 DO NOT DELETE
|
||||||
|
|
||||||
|
|
|
@ -27,16 +27,7 @@
|
||||||
// (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 **
|
||||||
|
|
||||||
|
|
|
@ -30,8 +30,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.
|
||||||
//
|
//
|
||||||
|
|
|
@ -31,8 +31,7 @@ $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.
|
||||||
//
|
//
|
||||||
|
|
|
@ -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.
|
||||||
//
|
//
|
||||||
|
@ -361,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.
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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)
|
||||||
//
|
//
|
||||||
|
|
|
@ -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.
|
||||||
//
|
//
|
||||||
|
|
|
@ -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.
|
||||||
//
|
//
|
||||||
|
|
|
@ -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.
|
||||||
//
|
//
|
||||||
|
|
|
@ -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 {
|
||||||
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,
|
||||||
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();
|
||||||
|
|
|
@ -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,
|
||||||
|
|
|
@ -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"
|
||||||
|
|
|
@ -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.
|
||||||
//
|
//
|
||||||
|
@ -1344,7 +1343,7 @@ TEST(FunctorActionTest, UnusedArguments) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Test that basic built-in actions work with move-only arguments.
|
// Test that basic built-in actions work with move-only arguments.
|
||||||
// TODO(rburny): Currently, almost all ActionInterface-based actions will not
|
// FIXME: Currently, almost all ActionInterface-based actions will not
|
||||||
// work, even if they only try to use other, copyable arguments. Implement them
|
// work, even if they only try to use other, copyable arguments. Implement them
|
||||||
// if necessary (but note that DoAll cannot work on non-copyable types anyway -
|
// if necessary (but note that DoAll cannot work on non-copyable types anyway -
|
||||||
// so maybe it's better to make users use lambdas instead.
|
// so maybe it's better to make users use lambdas instead.
|
||||||
|
|
|
@ -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.
|
||||||
//
|
//
|
||||||
|
|
|
@ -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.
|
||||||
//
|
//
|
||||||
|
|
|
@ -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.
|
||||||
//
|
//
|
||||||
|
|
|
@ -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.
|
||||||
//
|
//
|
||||||
|
|
|
@ -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.
|
||||||
//
|
//
|
||||||
|
|
|
@ -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.
|
||||||
//
|
//
|
||||||
|
|
|
@ -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.
|
||||||
//
|
//
|
||||||
|
|
|
@ -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 "gmock/gmock-generated-nice-strict.h"
|
#include "gmock/gmock-generated-nice-strict.h"
|
||||||
|
|
||||||
|
|
|
@ -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: vladl@google.com (Vlad Losev)
|
|
||||||
|
|
||||||
// Google Mock - a framework for writing C++ mock classes.
|
// Google Mock - a framework for writing C++ mock classes.
|
||||||
//
|
//
|
||||||
|
|
|
@ -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.
|
||||||
//
|
//
|
||||||
|
@ -1176,7 +1175,7 @@ TEST(UnexpectedCallTest, UnsatisifiedPrerequisites) {
|
||||||
TEST(UndefinedReturnValueTest,
|
TEST(UndefinedReturnValueTest,
|
||||||
ReturnValueIsMandatoryWhenNotDefaultConstructible) {
|
ReturnValueIsMandatoryWhenNotDefaultConstructible) {
|
||||||
MockA a;
|
MockA a;
|
||||||
// TODO(wan@google.com): We should really verify the output message,
|
// FIXME: We should really verify the output message,
|
||||||
// but we cannot yet due to that EXPECT_DEATH only captures stderr
|
// but we cannot yet due to that EXPECT_DEATH only captures stderr
|
||||||
// while Google Mock logs to stdout.
|
// while Google Mock logs to stdout.
|
||||||
#if GTEST_HAS_EXCEPTIONS
|
#if GTEST_HAS_EXCEPTIONS
|
||||||
|
|
|
@ -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)
|
|
||||||
//
|
//
|
||||||
// Tests for Google C++ Mocking Framework (Google Mock)
|
// Tests for Google C++ Mocking Framework (Google Mock)
|
||||||
//
|
//
|
||||||
|
|
|
@ -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)
|
|
||||||
|
|
||||||
// Tests Google Mock's functionality that depends on exceptions.
|
// Tests Google Mock's functionality that depends on exceptions.
|
||||||
|
|
||||||
|
|
|
@ -31,8 +31,6 @@
|
||||||
|
|
||||||
"""Tests that leaked mock objects can be caught be Google Mock."""
|
"""Tests that leaked mock objects can be caught be Google Mock."""
|
||||||
|
|
||||||
__author__ = 'wan@google.com (Zhanyong Wan)'
|
|
||||||
|
|
||||||
import gmock_test_utils
|
import gmock_test_utils
|
||||||
|
|
||||||
PROGRAM_PATH = gmock_test_utils.GetTestExecutablePath('gmock_leak_test_')
|
PROGRAM_PATH = gmock_test_utils.GetTestExecutablePath('gmock_leak_test_')
|
||||||
|
|
|
@ -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.
|
||||||
//
|
//
|
||||||
|
|
|
@ -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), vladl@google.com (Vlad Losev)
|
|
||||||
|
|
||||||
// Google Mock - a framework for writing C++ mock classes.
|
// Google Mock - a framework for writing C++ mock classes.
|
||||||
//
|
//
|
||||||
|
|
|
@ -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), vladl@google.com (Vlad Losev)
|
|
||||||
|
|
||||||
// Google Mock - a framework for writing C++ mock classes.
|
// Google Mock - a framework for writing C++ mock classes.
|
||||||
//
|
//
|
||||||
|
|
|
@ -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: vladl@google.com (Vlad Losev)
|
|
||||||
|
|
||||||
// Google Mock - a framework for writing C++ mock classes.
|
// Google Mock - a framework for writing C++ mock classes.
|
||||||
//
|
//
|
||||||
|
|
|
@ -39,8 +39,6 @@ gmock_output_test.py
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
__author__ = 'wan@google.com (Zhanyong Wan)'
|
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import sys
|
import sys
|
||||||
|
|
|
@ -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)
|
|
||||||
|
|
||||||
// Tests Google Mock's output in various scenarios. This ensures that
|
// Tests Google Mock's output in various scenarios. This ensures that
|
||||||
// Google Mock's messages are readable and useful.
|
// Google Mock's messages are readable and useful.
|
||||||
|
|
|
@ -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)
|
|
||||||
|
|
||||||
// Tests that Google Mock constructs can be used in a large number of
|
// Tests that Google Mock constructs can be used in a large number of
|
||||||
// threads concurrently.
|
// threads concurrently.
|
||||||
|
|
|
@ -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.
|
||||||
//
|
//
|
||||||
|
|
|
@ -29,8 +29,6 @@
|
||||||
|
|
||||||
"""Unit test utilities for Google C++ Mocking Framework."""
|
"""Unit test utilities for Google C++ Mocking Framework."""
|
||||||
|
|
||||||
__author__ = 'wan@google.com (Zhanyong Wan)'
|
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
|
|
@ -121,13 +121,13 @@ if(INSTALL_GTEST)
|
||||||
# configure and install pkgconfig files
|
# configure and install pkgconfig files
|
||||||
configure_file(
|
configure_file(
|
||||||
cmake/gtest.pc.in
|
cmake/gtest.pc.in
|
||||||
"${CMAKE_BINARY_DIR}/gtest.pc"
|
"${gtest_BINARY_DIR}/gtest.pc"
|
||||||
@ONLY)
|
@ONLY)
|
||||||
configure_file(
|
configure_file(
|
||||||
cmake/gtest_main.pc.in
|
cmake/gtest_main.pc.in
|
||||||
"${CMAKE_BINARY_DIR}/gtest_main.pc"
|
"${gtest_BINARY_DIR}/gtest_main.pc"
|
||||||
@ONLY)
|
@ONLY)
|
||||||
install(FILES "${CMAKE_BINARY_DIR}/gtest.pc" "${CMAKE_BINARY_DIR}/gtest_main.pc"
|
install(FILES "${gtest_BINARY_DIR}/gtest.pc" "${gtest_BINARY_DIR}/gtest_main.pc"
|
||||||
DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
|
DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
|
@ -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)
|
|
||||||
//
|
//
|
||||||
// The Google C++ Testing and Mocking Framework (Google Test)
|
// The Google C++ Testing and Mocking Framework (Google Test)
|
||||||
//
|
//
|
||||||
|
@ -162,7 +161,7 @@ GTEST_API_ bool InDeathTestChild();
|
||||||
// is rarely a problem as people usually don't put the test binary
|
// is rarely a problem as people usually don't put the test binary
|
||||||
// directory in PATH.
|
// directory in PATH.
|
||||||
//
|
//
|
||||||
// TODO(wan@google.com): make thread-safe death tests search the PATH.
|
// FIXME: make thread-safe death tests search the PATH.
|
||||||
|
|
||||||
// Asserts that a given statement causes the program to exit, with an
|
// Asserts that a given statement causes the program to exit, with an
|
||||||
// integer exit status that satisfies predicate, and emitting error output
|
// integer exit status that satisfies predicate, and emitting error output
|
||||||
|
|
|
@ -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)
|
|
||||||
//
|
//
|
||||||
// The Google C++ Testing and Mocking Framework (Google Test)
|
// The Google C++ Testing and Mocking Framework (Google Test)
|
||||||
//
|
//
|
||||||
|
|
|
@ -31,8 +31,6 @@
|
||||||
// (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.
|
||||||
//
|
//
|
||||||
// Authors: vladl@google.com (Vlad Losev)
|
|
||||||
//
|
|
||||||
// Macros and functions for implementing parameterized tests
|
// Macros and functions for implementing parameterized tests
|
||||||
// in Google C++ Testing and Mocking Framework (Google Test)
|
// in Google C++ Testing and Mocking Framework (Google Test)
|
||||||
//
|
//
|
||||||
|
|
|
@ -30,8 +30,6 @@ $var maxtuple = 10 $$ Maximum number of Combine arguments we want to support.
|
||||||
// (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.
|
||||||
//
|
//
|
||||||
// Authors: vladl@google.com (Vlad Losev)
|
|
||||||
//
|
|
||||||
// Macros and functions for implementing parameterized tests
|
// Macros and functions for implementing parameterized tests
|
||||||
// in Google C++ Testing and Mocking Framework (Google Test)
|
// in Google C++ Testing and Mocking Framework (Google Test)
|
||||||
//
|
//
|
||||||
|
|
|
@ -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 Test - The Google C++ Testing and Mocking Framework
|
// Google Test - The Google C++ Testing and Mocking Framework
|
||||||
//
|
//
|
||||||
|
@ -827,7 +826,7 @@ void UniversalPrintArray(const T* begin, size_t len, ::std::ostream* os) {
|
||||||
// If the array has more than kThreshold elements, we'll have to
|
// If the array has more than kThreshold elements, we'll have to
|
||||||
// omit some details by printing only the first and the last
|
// omit some details by printing only the first and the last
|
||||||
// kChunkSize elements.
|
// kChunkSize elements.
|
||||||
// TODO(wan@google.com): let the user control the threshold using a flag.
|
// FIXME: let the user control the threshold using a flag.
|
||||||
if (len <= kThreshold) {
|
if (len <= kThreshold) {
|
||||||
PrintRawArrayTo(begin, len, os);
|
PrintRawArrayTo(begin, len, os);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -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)
|
|
||||||
//
|
//
|
||||||
// Utilities for testing Google Test itself and code that uses Google Test
|
// Utilities for testing Google Test itself and code that uses Google Test
|
||||||
// (e.g. frameworks built on top of Google Test).
|
// (e.g. frameworks built on top of Google Test).
|
||||||
|
|
|
@ -27,9 +27,6 @@
|
||||||
// (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: mheule@google.com (Markus Heule)
|
|
||||||
//
|
|
||||||
|
|
||||||
// GOOGLETEST_CM0001 DO NOT DELETE
|
// GOOGLETEST_CM0001 DO NOT DELETE
|
||||||
|
|
||||||
#ifndef GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_
|
#ifndef GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_
|
||||||
|
|
|
@ -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)
|
|
||||||
|
|
||||||
// GOOGLETEST_CM0001 DO NOT DELETE
|
// GOOGLETEST_CM0001 DO NOT DELETE
|
||||||
|
|
||||||
|
|
|
@ -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)
|
|
||||||
//
|
//
|
||||||
// The Google C++ Testing and Mocking Framework (Google Test)
|
// The Google C++ Testing and Mocking Framework (Google Test)
|
||||||
//
|
//
|
||||||
|
@ -316,7 +315,7 @@ class GTEST_API_ AssertionResult {
|
||||||
const char* message() const {
|
const char* message() const {
|
||||||
return message_.get() != NULL ? message_->c_str() : "";
|
return message_.get() != NULL ? message_->c_str() : "";
|
||||||
}
|
}
|
||||||
// TODO(vladl@google.com): Remove this after making sure no clients use it.
|
// FIXME: Remove this after making sure no clients use it.
|
||||||
// Deprecated; please use message() instead.
|
// Deprecated; please use message() instead.
|
||||||
const char* failure_message() const { return message(); }
|
const char* failure_message() const { return message(); }
|
||||||
|
|
||||||
|
@ -622,7 +621,7 @@ class GTEST_API_ TestResult {
|
||||||
|
|
||||||
// Adds a failure if the key is a reserved attribute of Google Test
|
// Adds a failure if the key is a reserved attribute of Google Test
|
||||||
// testcase tags. Returns true if the property is valid.
|
// testcase tags. Returns true if the property is valid.
|
||||||
// TODO(russr): Validate attribute names are legal and human readable.
|
// FIXME: Validate attribute names are legal and human readable.
|
||||||
static bool ValidateTestProperty(const std::string& xml_element,
|
static bool ValidateTestProperty(const std::string& xml_element,
|
||||||
const TestProperty& test_property);
|
const TestProperty& test_property);
|
||||||
|
|
||||||
|
|
|
@ -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++ Testing and Mocking Framework definitions useful in production code.
|
// Google C++ Testing and Mocking Framework definitions useful in production code.
|
||||||
// GOOGLETEST_CM0003 DO NOT DELETE
|
// GOOGLETEST_CM0003 DO NOT DELETE
|
||||||
|
|
56
googletest/include/gtest/internal/custom/README.md
Normal file
56
googletest/include/gtest/internal/custom/README.md
Normal file
|
@ -0,0 +1,56 @@
|
||||||
|
# Customization Points
|
||||||
|
|
||||||
|
The custom directory is an injection point for custom user configurations.
|
||||||
|
|
||||||
|
## Header `gtest.h`
|
||||||
|
|
||||||
|
### The following macros can be defined:
|
||||||
|
|
||||||
|
* `GTEST_OS_STACK_TRACE_GETTER_` - The name of an implementation of
|
||||||
|
`OsStackTraceGetterInterface`.
|
||||||
|
* `GTEST_CUSTOM_TEMPDIR_FUNCTION_` - An override for `testing::TempDir()`. See
|
||||||
|
`testing::TempDir` for semantics and signature.
|
||||||
|
|
||||||
|
## Header `gtest-port.h`
|
||||||
|
|
||||||
|
The following macros can be defined:
|
||||||
|
|
||||||
|
### Flag related macros:
|
||||||
|
|
||||||
|
* `GTEST_FLAG(flag_name)`
|
||||||
|
* `GTEST_USE_OWN_FLAGFILE_FLAG_` - Define to 0 when the system provides its
|
||||||
|
own flagfile flag parsing.
|
||||||
|
* `GTEST_DECLARE_bool_(name)`
|
||||||
|
* `GTEST_DECLARE_int32_(name)`
|
||||||
|
* `GTEST_DECLARE_string_(name)`
|
||||||
|
* `GTEST_DEFINE_bool_(name, default_val, doc)`
|
||||||
|
* `GTEST_DEFINE_int32_(name, default_val, doc)`
|
||||||
|
* `GTEST_DEFINE_string_(name, default_val, doc)`
|
||||||
|
|
||||||
|
### Logging:
|
||||||
|
|
||||||
|
* `GTEST_LOG_(severity)`
|
||||||
|
* `GTEST_CHECK_(condition)`
|
||||||
|
* Functions `LogToStderr()` and `FlushInfoLog()` have to be provided too.
|
||||||
|
|
||||||
|
### Threading:
|
||||||
|
|
||||||
|
* `GTEST_HAS_NOTIFICATION_` - Enabled if Notification is already provided.
|
||||||
|
* `GTEST_HAS_MUTEX_AND_THREAD_LOCAL_` - Enabled if `Mutex` and `ThreadLocal`
|
||||||
|
are already provided. Must also provide `GTEST_DECLARE_STATIC_MUTEX_(mutex)`
|
||||||
|
and `GTEST_DEFINE_STATIC_MUTEX_(mutex)`
|
||||||
|
* `GTEST_EXCLUSIVE_LOCK_REQUIRED_(locks)`
|
||||||
|
* `GTEST_LOCK_EXCLUDED_(locks)`
|
||||||
|
|
||||||
|
### Underlying library support features
|
||||||
|
|
||||||
|
* `GTEST_HAS_CXXABI_H_`
|
||||||
|
|
||||||
|
### Exporting API symbols:
|
||||||
|
|
||||||
|
* `GTEST_API_` - Specifier for exported symbols.
|
||||||
|
|
||||||
|
## Header `gtest-printers.h`
|
||||||
|
|
||||||
|
* See documentation at `gtest/gtest-printers.h` for details on how to define a
|
||||||
|
custom printer.
|
|
@ -27,40 +27,7 @@
|
||||||
// (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:
|
|
||||||
// GTEST_FLAG(flag_name)
|
|
||||||
// GTEST_USE_OWN_FLAGFILE_FLAG_ - Define to 0 when the system provides its
|
|
||||||
// own flagfile flag parsing.
|
|
||||||
// GTEST_DECLARE_bool_(name)
|
|
||||||
// GTEST_DECLARE_int32_(name)
|
|
||||||
// GTEST_DECLARE_string_(name)
|
|
||||||
// GTEST_DEFINE_bool_(name, default_val, doc)
|
|
||||||
// GTEST_DEFINE_int32_(name, default_val, doc)
|
|
||||||
// GTEST_DEFINE_string_(name, default_val, doc)
|
|
||||||
//
|
|
||||||
// Logging:
|
|
||||||
// GTEST_LOG_(severity)
|
|
||||||
// GTEST_CHECK_(condition)
|
|
||||||
// Functions LogToStderr() and FlushInfoLog() have to be provided too.
|
|
||||||
//
|
|
||||||
// Threading:
|
|
||||||
// GTEST_HAS_NOTIFICATION_ - Enabled if Notification is already provided.
|
|
||||||
// GTEST_HAS_MUTEX_AND_THREAD_LOCAL_ - Enabled if Mutex and ThreadLocal are
|
|
||||||
// already provided.
|
|
||||||
// Must also provide GTEST_DECLARE_STATIC_MUTEX_(mutex) and
|
|
||||||
// GTEST_DEFINE_STATIC_MUTEX_(mutex)
|
|
||||||
//
|
|
||||||
// GTEST_EXCLUSIVE_LOCK_REQUIRED_(locks)
|
|
||||||
// GTEST_LOCK_EXCLUDED_(locks)
|
|
||||||
//
|
|
||||||
// Underlying library support features:
|
|
||||||
// GTEST_HAS_CXXABI_H_
|
|
||||||
//
|
|
||||||
// Exporting API symbols:
|
|
||||||
// GTEST_API_ - Specifier for exported symbols.
|
|
||||||
//
|
//
|
||||||
// ** Custom implementation starts here **
|
// ** Custom implementation starts here **
|
||||||
|
|
||||||
|
|
|
@ -31,8 +31,8 @@
|
||||||
// installation of gTest.
|
// installation of gTest.
|
||||||
// It will be included from gtest-printers.h and the overrides in this file
|
// It will be included from gtest-printers.h and the overrides in this file
|
||||||
// will be visible to everyone.
|
// will be visible to everyone.
|
||||||
// See documentation at gtest/gtest-printers.h for details on how to define a
|
//
|
||||||
// custom printer.
|
// Injection point for custom user configurations. See README for details
|
||||||
//
|
//
|
||||||
// ** Custom implementation starts here **
|
// ** Custom implementation starts here **
|
||||||
|
|
||||||
|
|
|
@ -27,15 +27,7 @@
|
||||||
// (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:
|
|
||||||
//
|
|
||||||
// GTEST_OS_STACK_TRACE_GETTER_ - The name of an implementation of
|
|
||||||
// OsStackTraceGetterInterface.
|
|
||||||
//
|
|
||||||
// GTEST_CUSTOM_TEMPDIR_FUNCTION_ - An override for testing::TempDir().
|
|
||||||
// See testing::TempDir for semantics and
|
|
||||||
// signature.
|
|
||||||
//
|
//
|
||||||
// ** Custom implementation starts here **
|
// ** Custom implementation starts here **
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,6 @@
|
||||||
// (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.
|
||||||
//
|
//
|
||||||
//
|
|
||||||
// The Google C++ Testing and Mocking Framework (Google Test)
|
// The Google C++ Testing and Mocking Framework (Google Test)
|
||||||
//
|
//
|
||||||
// This header file defines internal utilities needed for implementing
|
// This header file defines internal utilities needed for implementing
|
||||||
|
|
|
@ -27,7 +27,6 @@
|
||||||
// (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.
|
||||||
//
|
//
|
||||||
//
|
|
||||||
// Google Test filepath utilities
|
// Google Test filepath utilities
|
||||||
//
|
//
|
||||||
// This header file declares classes and functions used internally by
|
// This header file declares classes and functions used internally by
|
||||||
|
|
|
@ -27,7 +27,6 @@
|
||||||
// (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.
|
||||||
//
|
//
|
||||||
//
|
|
||||||
// The Google C++ Testing and Mocking Framework (Google Test)
|
// The Google C++ Testing and Mocking Framework (Google Test)
|
||||||
//
|
//
|
||||||
// This header file declares functions and macros used internally by
|
// This header file declares functions and macros used internally by
|
||||||
|
|
|
@ -27,8 +27,6 @@
|
||||||
// (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.
|
||||||
//
|
//
|
||||||
// Authors: Dan Egnor (egnor@google.com)
|
|
||||||
//
|
|
||||||
// A "smart" pointer type with reference tracking. Every pointer to a
|
// A "smart" pointer type with reference tracking. Every pointer to a
|
||||||
// particular object is kept on a circular linked list. When the last pointer
|
// particular object is kept on a circular linked list. When the last pointer
|
||||||
// to an object is destroyed or reassigned, the object is deleted.
|
// to an object is destroyed or reassigned, the object is deleted.
|
||||||
|
@ -62,7 +60,7 @@
|
||||||
// raw pointer (e.g. via get()) concurrently, and
|
// raw pointer (e.g. via get()) concurrently, and
|
||||||
// - it's safe to write to two linked_ptrs that point to the same
|
// - it's safe to write to two linked_ptrs that point to the same
|
||||||
// shared object concurrently.
|
// shared object concurrently.
|
||||||
// TODO(wan@google.com): rename this to safe_linked_ptr to avoid
|
// FIXME: rename this to safe_linked_ptr to avoid
|
||||||
// confusion with normal linked_ptr.
|
// confusion with normal linked_ptr.
|
||||||
|
|
||||||
// GOOGLETEST_CM0001 DO NOT DELETE
|
// GOOGLETEST_CM0001 DO NOT DELETE
|
||||||
|
|
|
@ -30,8 +30,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: vladl@google.com (Vlad Losev)
|
|
||||||
|
|
||||||
// Type and function utilities for implementing parameterized tests.
|
// Type and function utilities for implementing parameterized tests.
|
||||||
// This file is generated by a SCRIPT. DO NOT EDIT BY HAND!
|
// This file is generated by a SCRIPT. DO NOT EDIT BY HAND!
|
||||||
|
|
|
@ -29,8 +29,7 @@ $var maxtuple = 10 $$ Maximum number of Combine arguments we want to 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: vladl@google.com (Vlad Losev)
|
|
||||||
|
|
||||||
// Type and function utilities for implementing parameterized tests.
|
// Type and function utilities for implementing parameterized tests.
|
||||||
// This file is generated by a SCRIPT. DO NOT EDIT BY HAND!
|
// This file is generated by a SCRIPT. DO NOT EDIT BY HAND!
|
||||||
|
|
|
@ -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: vladl@google.com (Vlad Losev)
|
|
||||||
|
|
||||||
// Type and function utilities for implementing parameterized tests.
|
// Type and function utilities for implementing parameterized tests.
|
||||||
|
|
||||||
|
|
|
@ -27,8 +27,6 @@
|
||||||
// (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.
|
||||||
//
|
//
|
||||||
// Authors: wan@google.com (Zhanyong Wan)
|
|
||||||
//
|
|
||||||
// Low-level types and utilities for porting Google Test to various
|
// Low-level types and utilities for porting Google Test to various
|
||||||
// platforms. All macros ending with _ and symbols defined in an
|
// platforms. All macros ending with _ and symbols defined in an
|
||||||
// internal namespace are subject to change without notice. Code
|
// internal namespace are subject to change without notice. Code
|
||||||
|
@ -329,6 +327,22 @@
|
||||||
# define GTEST_DISABLE_MSC_WARNINGS_POP_()
|
# define GTEST_DISABLE_MSC_WARNINGS_POP_()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// Clang on Windows does not understand MSVC's pragma warning.
|
||||||
|
// We need clang-specific way to disable function deprecation warning.
|
||||||
|
#ifdef __clang__
|
||||||
|
# define GTEST_DISABLE_MSC_DEPRECATED_PUSH_() \
|
||||||
|
_Pragma("clang diagnostic push") \
|
||||||
|
_Pragma("clang diagnostic ignored \"-Wdeprecated-declarations\"") \
|
||||||
|
_Pragma("clang diagnostic ignored \"-Wdeprecated-implementations\"")
|
||||||
|
#define GTEST_DISABLE_MSC_DEPRECATED_POP_() \
|
||||||
|
_Pragma("clang diagnostic pop")
|
||||||
|
#else
|
||||||
|
# define GTEST_DISABLE_MSC_DEPRECATED_PUSH_() \
|
||||||
|
GTEST_DISABLE_MSC_WARNINGS_PUSH_(4996)
|
||||||
|
# define GTEST_DISABLE_MSC_DEPRECATED_POP_() \
|
||||||
|
GTEST_DISABLE_MSC_WARNINGS_POP_()
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef GTEST_LANG_CXX11
|
#ifndef GTEST_LANG_CXX11
|
||||||
// gcc and clang define __GXX_EXPERIMENTAL_CXX0X__ when
|
// gcc and clang define __GXX_EXPERIMENTAL_CXX0X__ when
|
||||||
// -std={c,gnu}++{0x,11} is passed. The C++11 standard specifies a
|
// -std={c,gnu}++{0x,11} is passed. The C++11 standard specifies a
|
||||||
|
@ -533,7 +547,7 @@ typedef struct _RTL_CRITICAL_SECTION GTEST_CRITICAL_SECTION;
|
||||||
#ifndef GTEST_HAS_STD_WSTRING
|
#ifndef GTEST_HAS_STD_WSTRING
|
||||||
// The user didn't tell us whether ::std::wstring is available, so we need
|
// The user didn't tell us whether ::std::wstring is available, so we need
|
||||||
// to figure it out.
|
// to figure it out.
|
||||||
// TODO(wan@google.com): uses autoconf to detect whether ::std::wstring
|
// FIXME: uses autoconf to detect whether ::std::wstring
|
||||||
// is available.
|
// is available.
|
||||||
|
|
||||||
// Cygwin 1.7 and below doesn't support ::std::wstring.
|
// Cygwin 1.7 and below doesn't support ::std::wstring.
|
||||||
|
@ -745,7 +759,7 @@ typedef struct _RTL_CRITICAL_SECTION GTEST_CRITICAL_SECTION;
|
||||||
// Until version 4.3.2, gcc has a bug that causes <tr1/functional>,
|
// Until version 4.3.2, gcc has a bug that causes <tr1/functional>,
|
||||||
// which is #included by <tr1/tuple>, to not compile when RTTI is
|
// which is #included by <tr1/tuple>, to not compile when RTTI is
|
||||||
// disabled. _TR1_FUNCTIONAL is the header guard for
|
// disabled. _TR1_FUNCTIONAL is the header guard for
|
||||||
// <tr1/functional>. Hence the following #define is a hack to prevent
|
// <tr1/functional>. Hence the following #define is used to prevent
|
||||||
// <tr1/functional> from being included.
|
// <tr1/functional> from being included.
|
||||||
# define _TR1_FUNCTIONAL 1
|
# define _TR1_FUNCTIONAL 1
|
||||||
# include <tr1/tuple>
|
# include <tr1/tuple>
|
||||||
|
@ -1250,7 +1264,7 @@ class GTEST_API_ RE {
|
||||||
// PartialMatch(str, re) returns true iff regular expression re
|
// PartialMatch(str, re) returns true iff regular expression re
|
||||||
// matches a substring of str (including str itself).
|
// matches a substring of str (including str itself).
|
||||||
//
|
//
|
||||||
// TODO(wan@google.com): make FullMatch() and PartialMatch() work
|
// FIXME: make FullMatch() and PartialMatch() work
|
||||||
// when str contains NUL characters.
|
// when str contains NUL characters.
|
||||||
static bool FullMatch(const ::std::string& str, const RE& re) {
|
static bool FullMatch(const ::std::string& str, const RE& re) {
|
||||||
return FullMatch(str.c_str(), re);
|
return FullMatch(str.c_str(), re);
|
||||||
|
@ -1277,7 +1291,7 @@ class GTEST_API_ RE {
|
||||||
void Init(const char* regex);
|
void Init(const char* regex);
|
||||||
|
|
||||||
// We use a const char* instead of an std::string, as Google Test used to be
|
// We use a const char* instead of an std::string, as Google Test used to be
|
||||||
// used where std::string is not available. TODO(wan@google.com): change to
|
// used where std::string is not available. FIXME: change to
|
||||||
// std::string.
|
// std::string.
|
||||||
const char* pattern_;
|
const char* pattern_;
|
||||||
bool is_valid_;
|
bool is_valid_;
|
||||||
|
@ -2484,7 +2498,7 @@ inline bool IsDir(const StatStruct& st) { return S_ISDIR(st.st_mode); }
|
||||||
|
|
||||||
// Functions deprecated by MSVC 8.0.
|
// Functions deprecated by MSVC 8.0.
|
||||||
|
|
||||||
GTEST_DISABLE_MSC_WARNINGS_PUSH_(4996 /* deprecated function */)
|
GTEST_DISABLE_MSC_DEPRECATED_PUSH_()
|
||||||
|
|
||||||
inline const char* StrNCpy(char* dest, const char* src, size_t n) {
|
inline const char* StrNCpy(char* dest, const char* src, size_t n) {
|
||||||
return strncpy(dest, src, n);
|
return strncpy(dest, src, n);
|
||||||
|
@ -2532,7 +2546,7 @@ inline const char* GetEnv(const char* name) {
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
GTEST_DISABLE_MSC_WARNINGS_POP_()
|
GTEST_DISABLE_MSC_DEPRECATED_POP_()
|
||||||
|
|
||||||
#if GTEST_OS_WINDOWS_MOBILE
|
#if GTEST_OS_WINDOWS_MOBILE
|
||||||
// Windows CE has no C library. The abort() function is used in
|
// Windows CE has no C library. The abort() function is used in
|
||||||
|
@ -2670,7 +2684,7 @@ typedef TypeWithSize<8>::Int TimeInMillis; // Represents time in milliseconds.
|
||||||
// Parses 'str' for a 32-bit signed integer. If successful, writes the result
|
// Parses 'str' for a 32-bit signed integer. If successful, writes the result
|
||||||
// to *value and returns true; otherwise leaves *value unchanged and returns
|
// to *value and returns true; otherwise leaves *value unchanged and returns
|
||||||
// false.
|
// false.
|
||||||
// TODO(chandlerc): Find a better way to refactor flag and environment parsing
|
// FIXME: Find a better way to refactor flag and environment parsing
|
||||||
// out of both gtest-port.cc and gtest.cc to avoid exporting this utility
|
// out of both gtest-port.cc and gtest.cc to avoid exporting this utility
|
||||||
// function.
|
// function.
|
||||||
bool ParseInt32(const Message& src_text, const char* str, Int32* value);
|
bool ParseInt32(const Message& src_text, const char* str, Int32* value);
|
||||||
|
|
|
@ -27,7 +27,6 @@
|
||||||
// (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.
|
||||||
//
|
//
|
||||||
//
|
|
||||||
// The Google C++ Testing and Mocking Framework (Google Test)
|
// The Google C++ Testing and Mocking Framework (Google Test)
|
||||||
//
|
//
|
||||||
// This header file declares the String class and functions used internally by
|
// This header file declares the String class and functions used internally by
|
||||||
|
|
|
@ -30,8 +30,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)
|
|
||||||
|
|
||||||
// Implements a subset of TR1 tuple needed by Google Test and Google Mock.
|
// Implements a subset of TR1 tuple needed by Google Test and Google Mock.
|
||||||
|
|
||||||
|
@ -44,7 +43,7 @@
|
||||||
|
|
||||||
// The compiler used in Symbian has a bug that prevents us from declaring the
|
// The compiler used in Symbian has a bug that prevents us from declaring the
|
||||||
// tuple template as a friend (it complains that tuple is redefined). This
|
// tuple template as a friend (it complains that tuple is redefined). This
|
||||||
// hack bypasses the bug by declaring the members that should otherwise be
|
// bypasses the bug by declaring the members that should otherwise be
|
||||||
// private as public.
|
// private as public.
|
||||||
// Sun Studio versions < 12 also have the above bug.
|
// Sun Studio versions < 12 also have the above bug.
|
||||||
#if defined(__SYMBIAN32__) || (defined(__SUNPRO_CC) && __SUNPRO_CC < 0x590)
|
#if defined(__SYMBIAN32__) || (defined(__SUNPRO_CC) && __SUNPRO_CC < 0x590)
|
||||||
|
|
|
@ -29,8 +29,7 @@ $$ This meta comment fixes auto-indentation in Emacs. }}
|
||||||
// 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)
|
|
||||||
|
|
||||||
// Implements a subset of TR1 tuple needed by Google Test and Google Mock.
|
// Implements a subset of TR1 tuple needed by Google Test and Google Mock.
|
||||||
|
|
||||||
|
@ -43,7 +42,7 @@ $$ This meta comment fixes auto-indentation in Emacs. }}
|
||||||
|
|
||||||
// The compiler used in Symbian has a bug that prevents us from declaring the
|
// The compiler used in Symbian has a bug that prevents us from declaring the
|
||||||
// tuple template as a friend (it complains that tuple is redefined). This
|
// tuple template as a friend (it complains that tuple is redefined). This
|
||||||
// hack bypasses the bug by declaring the members that should otherwise be
|
// bypasses the bug by declaring the members that should otherwise be
|
||||||
// private as public.
|
// private as public.
|
||||||
// Sun Studio versions < 12 also have the above bug.
|
// Sun Studio versions < 12 also have the above bug.
|
||||||
#if defined(__SYMBIAN32__) || (defined(__SUNPRO_CC) && __SUNPRO_CC < 0x590)
|
#if defined(__SYMBIAN32__) || (defined(__SUNPRO_CC) && __SUNPRO_CC < 0x590)
|
||||||
|
|
|
@ -30,8 +30,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)
|
|
||||||
|
|
||||||
// Type utilities needed for implementing typed and type-parameterized
|
// Type utilities needed for implementing typed and type-parameterized
|
||||||
// tests. This file is generated by a SCRIPT. DO NOT EDIT BY HAND!
|
// tests. This file is generated by a SCRIPT. DO NOT EDIT BY HAND!
|
||||||
|
|
|
@ -28,8 +28,7 @@ $var n = 50 $$ Maximum length of type lists we want to 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)
|
|
||||||
|
|
||||||
// Type utilities needed for implementing typed and type-parameterized
|
// Type utilities needed for implementing typed and type-parameterized
|
||||||
// tests. This file is generated by a SCRIPT. DO NOT EDIT BY HAND!
|
// tests. This file is generated by a SCRIPT. DO NOT EDIT BY HAND!
|
||||||
|
|
|
@ -26,9 +26,8 @@
|
||||||
// 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)
|
|
||||||
// Author: vladl@google.com (Vlad Losev)
|
|
||||||
|
|
||||||
// This provides interface PrimeTable that determines whether a number is a
|
// This provides interface PrimeTable that determines whether a number is a
|
||||||
// prime and determines a next prime number. This interface is used
|
// prime and determines a next prime number. This interface is used
|
||||||
|
|
|
@ -28,8 +28,6 @@
|
||||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
// A sample program demonstrating using Google C++ testing framework.
|
// A sample program demonstrating using Google C++ testing framework.
|
||||||
//
|
|
||||||
// Author: wan@google.com (Zhanyong Wan)
|
|
||||||
|
|
||||||
#include "sample1.h"
|
#include "sample1.h"
|
||||||
|
|
||||||
|
|
|
@ -28,8 +28,6 @@
|
||||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
// A sample program demonstrating using Google C++ testing framework.
|
// A sample program demonstrating using Google C++ testing framework.
|
||||||
//
|
|
||||||
// Author: wan@google.com (Zhanyong Wan)
|
|
||||||
|
|
||||||
#ifndef GTEST_SAMPLES_SAMPLE1_H_
|
#ifndef GTEST_SAMPLES_SAMPLE1_H_
|
||||||
#define GTEST_SAMPLES_SAMPLE1_H_
|
#define GTEST_SAMPLES_SAMPLE1_H_
|
||||||
|
|
|
@ -25,8 +25,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: vladl@google.com (Vlad Losev)
|
|
||||||
|
|
||||||
// This sample shows how to use Google Test listener API to implement
|
// This sample shows how to use Google Test listener API to implement
|
||||||
// a primitive leak checker.
|
// a primitive leak checker.
|
||||||
|
|
|
@ -28,9 +28,6 @@
|
||||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
// A sample program demonstrating using Google C++ testing framework.
|
// A sample program demonstrating using Google C++ testing framework.
|
||||||
//
|
|
||||||
// Author: wan@google.com (Zhanyong Wan)
|
|
||||||
|
|
||||||
|
|
||||||
// This sample shows how to write a simple unit test for a function,
|
// This sample shows how to write a simple unit test for a function,
|
||||||
// using Google C++ testing framework.
|
// using Google C++ testing framework.
|
||||||
|
|
|
@ -28,8 +28,6 @@
|
||||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
// A sample program demonstrating using Google C++ testing framework.
|
// A sample program demonstrating using Google C++ testing framework.
|
||||||
//
|
|
||||||
// Author: wan@google.com (Zhanyong Wan)
|
|
||||||
|
|
||||||
#include "sample2.h"
|
#include "sample2.h"
|
||||||
|
|
||||||
|
|
|
@ -28,8 +28,6 @@
|
||||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
// A sample program demonstrating using Google C++ testing framework.
|
// A sample program demonstrating using Google C++ testing framework.
|
||||||
//
|
|
||||||
// Author: wan@google.com (Zhanyong Wan)
|
|
||||||
|
|
||||||
#ifndef GTEST_SAMPLES_SAMPLE2_H_
|
#ifndef GTEST_SAMPLES_SAMPLE2_H_
|
||||||
#define GTEST_SAMPLES_SAMPLE2_H_
|
#define GTEST_SAMPLES_SAMPLE2_H_
|
||||||
|
|
|
@ -28,9 +28,6 @@
|
||||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
// A sample program demonstrating using Google C++ testing framework.
|
// A sample program demonstrating using Google C++ testing framework.
|
||||||
//
|
|
||||||
// Author: wan@google.com (Zhanyong Wan)
|
|
||||||
|
|
||||||
|
|
||||||
// This sample shows how to write a more complex unit test for a class
|
// This sample shows how to write a more complex unit test for a class
|
||||||
// that has multiple member functions.
|
// that has multiple member functions.
|
||||||
|
|
|
@ -28,8 +28,6 @@
|
||||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
// A sample program demonstrating using Google C++ testing framework.
|
// A sample program demonstrating using Google C++ testing framework.
|
||||||
//
|
|
||||||
// Author: wan@google.com (Zhanyong Wan)
|
|
||||||
|
|
||||||
#ifndef GTEST_SAMPLES_SAMPLE3_INL_H_
|
#ifndef GTEST_SAMPLES_SAMPLE3_INL_H_
|
||||||
#define GTEST_SAMPLES_SAMPLE3_INL_H_
|
#define GTEST_SAMPLES_SAMPLE3_INL_H_
|
||||||
|
|
|
@ -28,9 +28,6 @@
|
||||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
// A sample program demonstrating using Google C++ testing framework.
|
// A sample program demonstrating using Google C++ testing framework.
|
||||||
//
|
|
||||||
// Author: wan@google.com (Zhanyong Wan)
|
|
||||||
|
|
||||||
|
|
||||||
// In this example, we use a more advanced feature of Google Test called
|
// In this example, we use a more advanced feature of Google Test called
|
||||||
// test fixture.
|
// test fixture.
|
||||||
|
|
|
@ -28,8 +28,6 @@
|
||||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
// A sample program demonstrating using Google C++ testing framework.
|
// A sample program demonstrating using Google C++ testing framework.
|
||||||
//
|
|
||||||
// Author: wan@google.com (Zhanyong Wan)
|
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
|
|
@ -28,9 +28,6 @@
|
||||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
// A sample program demonstrating using Google C++ testing framework.
|
// A sample program demonstrating using Google C++ testing framework.
|
||||||
//
|
|
||||||
// Author: wan@google.com (Zhanyong Wan)
|
|
||||||
|
|
||||||
#ifndef GTEST_SAMPLES_SAMPLE4_H_
|
#ifndef GTEST_SAMPLES_SAMPLE4_H_
|
||||||
#define GTEST_SAMPLES_SAMPLE4_H_
|
#define GTEST_SAMPLES_SAMPLE4_H_
|
||||||
|
|
||||||
|
|
|
@ -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 "sample4.h"
|
#include "sample4.h"
|
||||||
#include "gtest/gtest.h"
|
#include "gtest/gtest.h"
|
||||||
|
|
|
@ -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)
|
|
||||||
|
|
||||||
// This sample teaches how to reuse a test fixture in multiple test
|
// This sample teaches how to reuse a test fixture in multiple test
|
||||||
// cases by deriving sub-fixtures from it.
|
// cases by deriving sub-fixtures from it.
|
||||||
|
|
|
@ -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)
|
|
||||||
|
|
||||||
// This sample shows how to test common properties of multiple
|
// This sample shows how to test common properties of multiple
|
||||||
// implementations of the same interface (aka interface tests).
|
// implementations of the same interface (aka interface tests).
|
||||||
|
|
|
@ -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: vladl@google.com (Vlad Losev)
|
|
||||||
|
|
||||||
// This sample shows how to test common properties of multiple
|
// This sample shows how to test common properties of multiple
|
||||||
// implementations of an interface (aka interface tests) using
|
// implementations of an interface (aka interface tests) using
|
||||||
|
|
|
@ -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: vladl@google.com (Vlad Losev)
|
|
||||||
|
|
||||||
// This sample shows how to test code relying on some global flag variables.
|
// This sample shows how to test code relying on some global flag variables.
|
||||||
// Combine() helps with generating all possible combinations of such flags,
|
// Combine() helps with generating all possible combinations of such flags,
|
||||||
|
|
|
@ -25,8 +25,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: vladl@google.com (Vlad Losev)
|
|
||||||
|
|
||||||
// This sample shows how to use Google Test listener API to implement
|
// This sample shows how to use Google Test listener API to implement
|
||||||
// an alternative console output and how to use the UnitTest reflection API
|
// an alternative console output and how to use the UnitTest reflection API
|
||||||
|
|
|
@ -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: mheule@google.com (Markus Heule)
|
|
||||||
//
|
//
|
||||||
// Google C++ Testing and Mocking Framework (Google Test)
|
// Google C++ Testing and Mocking Framework (Google Test)
|
||||||
//
|
//
|
||||||
|
|
|
@ -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), vladl@google.com (Vlad Losev)
|
|
||||||
//
|
//
|
||||||
// This file implements death tests.
|
// This file implements death tests.
|
||||||
|
|
||||||
|
@ -267,7 +266,7 @@ static const int kFuchsiaReadPipeFd = 3;
|
||||||
// statement, which is not allowed; THREW means that the test statement
|
// statement, which is not allowed; THREW means that the test statement
|
||||||
// returned control by throwing an exception. IN_PROGRESS means the test
|
// returned control by throwing an exception. IN_PROGRESS means the test
|
||||||
// has not yet concluded.
|
// has not yet concluded.
|
||||||
// TODO(vladl@google.com): Unify names and possibly values for
|
// FIXME: Unify names and possibly values for
|
||||||
// AbortReason, DeathTestOutcome, and flag characters above.
|
// AbortReason, DeathTestOutcome, and flag characters above.
|
||||||
enum DeathTestOutcome { IN_PROGRESS, DIED, LIVED, RETURNED, THREW };
|
enum DeathTestOutcome { IN_PROGRESS, DIED, LIVED, RETURNED, THREW };
|
||||||
|
|
||||||
|
@ -582,7 +581,6 @@ bool DeathTestImpl::Passed(bool status_ok) {
|
||||||
if (status_ok) {
|
if (status_ok) {
|
||||||
# if GTEST_USES_PCRE
|
# if GTEST_USES_PCRE
|
||||||
// PCRE regexes support embedded NULs.
|
// PCRE regexes support embedded NULs.
|
||||||
// GTEST_USES_PCRE is defined only in google3 mode
|
|
||||||
const bool matched = RE::PartialMatch(error_message, *regex());
|
const bool matched = RE::PartialMatch(error_message, *regex());
|
||||||
# else
|
# else
|
||||||
const bool matched = RE::PartialMatch(error_message.c_str(), *regex());
|
const bool matched = RE::PartialMatch(error_message.c_str(), *regex());
|
||||||
|
@ -1460,7 +1458,7 @@ static int GetStatusFileDescriptor(unsigned int parent_process_id,
|
||||||
StreamableToString(parent_process_id));
|
StreamableToString(parent_process_id));
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO(vladl@google.com): Replace the following check with a
|
// FIXME: Replace the following check with a
|
||||||
// compile-time assertion when available.
|
// compile-time assertion when available.
|
||||||
GTEST_CHECK_(sizeof(HANDLE) <= sizeof(size_t));
|
GTEST_CHECK_(sizeof(HANDLE) <= sizeof(size_t));
|
||||||
|
|
||||||
|
|
|
@ -250,7 +250,7 @@ bool FilePath::DirectoryExists() const {
|
||||||
// root directory per disk drive.)
|
// root directory per disk drive.)
|
||||||
bool FilePath::IsRootDirectory() const {
|
bool FilePath::IsRootDirectory() const {
|
||||||
#if GTEST_OS_WINDOWS
|
#if GTEST_OS_WINDOWS
|
||||||
// TODO(wan@google.com): on Windows a network share like
|
// FIXME: on Windows a network share like
|
||||||
// \\server\share can be a root directory, although it cannot be the
|
// \\server\share can be a root directory, although it cannot be the
|
||||||
// current directory. Handle this properly.
|
// current directory. Handle this properly.
|
||||||
return pathname_.length() == 3 && IsAbsolutePath();
|
return pathname_.length() == 3 && IsAbsolutePath();
|
||||||
|
@ -350,7 +350,7 @@ FilePath FilePath::RemoveTrailingPathSeparator() const {
|
||||||
// Removes any redundant separators that might be in the pathname.
|
// Removes any redundant separators that might be in the pathname.
|
||||||
// For example, "bar///foo" becomes "bar/foo". Does not eliminate other
|
// For example, "bar///foo" becomes "bar/foo". Does not eliminate other
|
||||||
// redundancies that might be in a pathname involving "." or "..".
|
// redundancies that might be in a pathname involving "." or "..".
|
||||||
// TODO(wan@google.com): handle Windows network shares (e.g. \\server\share).
|
// FIXME: handle Windows network shares (e.g. \\server\share).
|
||||||
void FilePath::Normalize() {
|
void FilePath::Normalize() {
|
||||||
if (pathname_.c_str() == NULL) {
|
if (pathname_.c_str() == NULL) {
|
||||||
pathname_ = "";
|
pathname_ = "";
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user