Distinguish between C++11 language and library support for std::function, std::begin, std::end, and std::move in gtest and gmock.
Bring in gtest 694.
This commit is contained in:
@@ -264,7 +264,7 @@ TEST(DefaultValueDeathTest, GetReturnsBuiltInDefaultValueWhenUnset) {
|
||||
}, "");
|
||||
}
|
||||
|
||||
#if GTEST_LANG_CXX11
|
||||
#if GTEST_HAS_STD_UNIQUE_PTR_
|
||||
TEST(DefaultValueDeathTest, GetWorksForMoveOnlyIfSet) {
|
||||
EXPECT_FALSE(DefaultValue<std::unique_ptr<int>>::Exists());
|
||||
EXPECT_DEATH_IF_SUPPORTED({
|
||||
@@ -277,7 +277,7 @@ TEST(DefaultValueDeathTest, GetWorksForMoveOnlyIfSet) {
|
||||
std::unique_ptr<int> i = DefaultValue<std::unique_ptr<int>>::Get();
|
||||
EXPECT_EQ(42, *i);
|
||||
}
|
||||
#endif // GTEST_LANG_CXX11
|
||||
#endif // GTEST_HAS_STD_UNIQUE_PTR_
|
||||
|
||||
// Tests that DefaultValue<void>::Get() returns void.
|
||||
TEST(DefaultValueTest, GetWorksForVoid) {
|
||||
@@ -636,7 +636,7 @@ class MockClass {
|
||||
|
||||
MOCK_METHOD1(IntFunc, int(bool flag)); // NOLINT
|
||||
MOCK_METHOD0(Foo, MyClass());
|
||||
#if GTEST_LANG_CXX11
|
||||
#if GTEST_HAS_STD_UNIQUE_PTR_
|
||||
MOCK_METHOD0(MakeUnique, std::unique_ptr<int>());
|
||||
MOCK_METHOD0(MakeVectorUnique, std::vector<std::unique_ptr<int>>());
|
||||
#endif
|
||||
@@ -1273,7 +1273,7 @@ TEST(ByRefTest, PrintsCorrectly) {
|
||||
EXPECT_EQ(expected.str(), actual.str());
|
||||
}
|
||||
|
||||
#if GTEST_LANG_CXX11
|
||||
#if GTEST_HAS_STD_UNIQUE_PTR_
|
||||
|
||||
std::unique_ptr<int> UniquePtrSource() {
|
||||
return std::unique_ptr<int>(new int(19));
|
||||
@@ -1310,6 +1310,6 @@ TEST(MockMethodTest, CanReturnMoveOnlyValue) {
|
||||
EXPECT_EQ(7, *vresult[0]);
|
||||
}
|
||||
|
||||
#endif // GTEST_LANG_CXX11
|
||||
#endif // GTEST_HAS_STD_UNIQUE_PTR_
|
||||
|
||||
} // Unnamed namespace
|
||||
|
||||
@@ -595,7 +595,7 @@ TEST(MockFunctionTest, WorksFor10Arguments) {
|
||||
EXPECT_EQ(2, foo.Call(true, 'a', 0, 0, 0, 0, 0, 'b', 1, false));
|
||||
}
|
||||
|
||||
#if GTEST_LANG_CXX11
|
||||
#if GTEST_HAS_STD_FUNCTION_
|
||||
TEST(MockFunctionTest, AsStdFunction) {
|
||||
MockFunction<int(int)> foo;
|
||||
auto call = [](const std::function<int(int)> &f, int i) {
|
||||
@@ -606,7 +606,7 @@ TEST(MockFunctionTest, AsStdFunction) {
|
||||
EXPECT_EQ(-1, call(foo.AsStdFunction(), 1));
|
||||
EXPECT_EQ(-2, call(foo.AsStdFunction(), 2));
|
||||
}
|
||||
#endif // GTEST_LANG_CXX11
|
||||
#endif // GTEST_HAS_STD_FUNCTION_
|
||||
|
||||
} // namespace gmock_generated_function_mockers_test
|
||||
} // namespace testing
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
#include "gtest/gtest.h"
|
||||
#include "gtest/gtest-spi.h"
|
||||
|
||||
#if GTEST_LANG_CXX11
|
||||
#if GTEST_HAS_STD_FORWARD_LIST_
|
||||
# include <forward_list> // NOLINT
|
||||
#endif
|
||||
|
||||
@@ -4545,7 +4545,7 @@ TEST(StreamlikeTest, Iteration) {
|
||||
}
|
||||
}
|
||||
|
||||
#if GTEST_LANG_CXX11
|
||||
#if GTEST_HAS_STD_FORWARD_LIST_
|
||||
TEST(BeginEndDistanceIsTest, WorksWithForwardList) {
|
||||
std::forward_list<int> container;
|
||||
EXPECT_THAT(container, BeginEndDistanceIs(0));
|
||||
@@ -4557,7 +4557,7 @@ TEST(BeginEndDistanceIsTest, WorksWithForwardList) {
|
||||
EXPECT_THAT(container, Not(BeginEndDistanceIs(0)));
|
||||
EXPECT_THAT(container, BeginEndDistanceIs(2));
|
||||
}
|
||||
#endif // GTEST_LANG_CXX11
|
||||
#endif // GTEST_HAS_STD_FORWARD_LIST_
|
||||
|
||||
TEST(BeginEndDistanceIsTest, WorksWithNonStdList) {
|
||||
const int a[5] = {1, 2, 3, 4, 5};
|
||||
|
||||
Reference in New Issue
Block a user