Googletest export
Removing checks for C++11 from unit tests PiperOrigin-RevId: 212990514
This commit is contained in:
parent
28c2989eea
commit
bc9df6ad46
@ -63,9 +63,7 @@ TEST(CommandLineFlagsTest, CanBeAccessedInCodeOnceGTestHIsIncluded) {
|
|||||||
#include <map>
|
#include <map>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <ostream>
|
#include <ostream>
|
||||||
#if GTEST_LANG_CXX11
|
|
||||||
#include <unordered_set>
|
#include <unordered_set>
|
||||||
#endif // GTEST_LANG_CXX11
|
|
||||||
|
|
||||||
#include "gtest/gtest-spi.h"
|
#include "gtest/gtest-spi.h"
|
||||||
#include "src/gtest-internal-inl.h"
|
#include "src/gtest-internal-inl.h"
|
||||||
@ -5156,8 +5154,7 @@ TEST(AssertionResultTest, CanStreamOstreamManipulators) {
|
|||||||
EXPECT_STREQ("Data\n\\0Will be visible", r.message());
|
EXPECT_STREQ("Data\n\\0Will be visible", r.message());
|
||||||
}
|
}
|
||||||
|
|
||||||
// The next test uses explicit conversion operators -- a C++11 feature.
|
// The next test uses explicit conversion operators
|
||||||
#if GTEST_LANG_CXX11
|
|
||||||
|
|
||||||
TEST(AssertionResultTest, ConstructibleFromContextuallyConvertibleToBool) {
|
TEST(AssertionResultTest, ConstructibleFromContextuallyConvertibleToBool) {
|
||||||
struct ExplicitlyConvertibleToBool {
|
struct ExplicitlyConvertibleToBool {
|
||||||
@ -5170,8 +5167,6 @@ TEST(AssertionResultTest, ConstructibleFromContextuallyConvertibleToBool) {
|
|||||||
EXPECT_TRUE(v2);
|
EXPECT_TRUE(v2);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // GTEST_LANG_CXX11
|
|
||||||
|
|
||||||
struct ConvertibleToAssertionResult {
|
struct ConvertibleToAssertionResult {
|
||||||
operator AssertionResult() const { return AssertionResult(true); }
|
operator AssertionResult() const { return AssertionResult(true); }
|
||||||
};
|
};
|
||||||
@ -7555,7 +7550,6 @@ TEST(IsContainerTestTest, WorksForContainer) {
|
|||||||
sizeof(IsContainerTest<std::map<int, double> >(0)));
|
sizeof(IsContainerTest<std::map<int, double> >(0)));
|
||||||
}
|
}
|
||||||
|
|
||||||
#if GTEST_LANG_CXX11
|
|
||||||
struct ConstOnlyContainerWithPointerIterator {
|
struct ConstOnlyContainerWithPointerIterator {
|
||||||
using const_iterator = int*;
|
using const_iterator = int*;
|
||||||
const_iterator begin() const;
|
const_iterator begin() const;
|
||||||
@ -7577,7 +7571,6 @@ TEST(IsContainerTestTest, ConstOnlyContainer) {
|
|||||||
EXPECT_EQ(sizeof(IsContainer),
|
EXPECT_EQ(sizeof(IsContainer),
|
||||||
sizeof(IsContainerTest<ConstOnlyContainerWithClassIterator>(0)));
|
sizeof(IsContainerTest<ConstOnlyContainerWithClassIterator>(0)));
|
||||||
}
|
}
|
||||||
#endif // GTEST_LANG_CXX11
|
|
||||||
|
|
||||||
// Tests IsHashTable.
|
// Tests IsHashTable.
|
||||||
struct AHashTable {
|
struct AHashTable {
|
||||||
@ -7590,10 +7583,8 @@ struct NotReallyAHashTable {
|
|||||||
TEST(IsHashTable, Basic) {
|
TEST(IsHashTable, Basic) {
|
||||||
EXPECT_TRUE(testing::internal::IsHashTable<AHashTable>::value);
|
EXPECT_TRUE(testing::internal::IsHashTable<AHashTable>::value);
|
||||||
EXPECT_FALSE(testing::internal::IsHashTable<NotReallyAHashTable>::value);
|
EXPECT_FALSE(testing::internal::IsHashTable<NotReallyAHashTable>::value);
|
||||||
#if GTEST_LANG_CXX11
|
|
||||||
EXPECT_FALSE(testing::internal::IsHashTable<std::vector<int>>::value);
|
EXPECT_FALSE(testing::internal::IsHashTable<std::vector<int>>::value);
|
||||||
EXPECT_TRUE(testing::internal::IsHashTable<std::unordered_set<int>>::value);
|
EXPECT_TRUE(testing::internal::IsHashTable<std::unordered_set<int>>::value);
|
||||||
#endif // GTEST_LANG_CXX11
|
|
||||||
#if GTEST_HAS_HASH_SET_
|
#if GTEST_HAS_HASH_SET_
|
||||||
EXPECT_TRUE(testing::internal::IsHashTable<__gnu_cxx::hash_set<int>>::value);
|
EXPECT_TRUE(testing::internal::IsHashTable<__gnu_cxx::hash_set<int>>::value);
|
||||||
#endif // GTEST_HAS_HASH_SET_
|
#endif // GTEST_HAS_HASH_SET_
|
||||||
|
Loading…
x
Reference in New Issue
Block a user