diff options
Diffstat (limited to 'googlemock/test/gmock-internal-utils_test.cc')
-rw-r--r-- | googlemock/test/gmock-internal-utils_test.cc | 43 |
1 files changed, 37 insertions, 6 deletions
diff --git a/googlemock/test/gmock-internal-utils_test.cc b/googlemock/test/gmock-internal-utils_test.cc index 7df4078e..75dd8088 100644 --- a/googlemock/test/gmock-internal-utils_test.cc +++ b/googlemock/test/gmock-internal-utils_test.cc @@ -33,20 +33,16 @@ // This file tests the internal utilities. #include "gmock/internal/gmock-internal-utils.h" - #include <stdlib.h> - #include <map> #include <memory> -#include <sstream> #include <string> -#include <type_traits> +#include <sstream> #include <vector> - #include "gmock/gmock.h" #include "gmock/internal/gmock-port.h" -#include "gtest/gtest-spi.h" #include "gtest/gtest.h" +#include "gtest/gtest-spi.h" // Indicates that this translation unit is part of Google Test's // implementation. It must come before gtest-internal-inl.h is @@ -61,6 +57,8 @@ # include <sys/types.h> // For ssize_t. NOLINT #endif +class ProtocolMessage; + namespace proto2 { class Message; } // namespace proto2 @@ -506,6 +504,39 @@ TEST(LogTest, OnlyWarningsArePrintedWhenVerbosityIsInvalid) { TestLogWithSeverity("invalid", kWarning, true); } +#endif // GTEST_HAS_STREAM_REDIRECTION + +TEST(TypeTraitsTest, true_type) { + EXPECT_TRUE(true_type::value); +} + +TEST(TypeTraitsTest, false_type) { + EXPECT_FALSE(false_type::value); +} + +TEST(TypeTraitsTest, is_reference) { + EXPECT_FALSE(is_reference<int>::value); + EXPECT_FALSE(is_reference<char*>::value); + EXPECT_TRUE(is_reference<const int&>::value); +} + +TEST(TypeTraitsTest, type_equals) { + EXPECT_FALSE((type_equals<int, const int>::value)); + EXPECT_FALSE((type_equals<int, int&>::value)); + EXPECT_FALSE((type_equals<int, double>::value)); + EXPECT_TRUE((type_equals<char, char>::value)); +} + +TEST(TypeTraitsTest, remove_reference) { + EXPECT_TRUE((type_equals<char, remove_reference<char&>::type>::value)); + EXPECT_TRUE((type_equals<const int, + remove_reference<const int&>::type>::value)); + EXPECT_TRUE((type_equals<int, remove_reference<int>::type>::value)); + EXPECT_TRUE((type_equals<double*, remove_reference<double*>::type>::value)); +} + +#if GTEST_HAS_STREAM_REDIRECTION + // Verifies that Log() behaves correctly for the given verbosity level // and log severity. std::string GrabOutput(void(*logger)(), const char* verbosity) { |