Commit a8ce8d27 authored by xiabo's avatar xiabo
Browse files

修改googletest版本

parent 0a21fff9
...@@ -45,7 +45,6 @@ ...@@ -45,7 +45,6 @@
// stand-alone regression test. // stand-alone regression test.
#include <iostream> #include <iostream>
#include <ostream>
#include "gtest/gtest-spi.h" #include "gtest/gtest-spi.h"
#include "gtest/gtest.h" #include "gtest/gtest.h"
......
...@@ -61,7 +61,6 @@ TEST(CommandLineFlagsTest, CanBeAccessedInCodeOnceGTestHIsIncluded) { ...@@ -61,7 +61,6 @@ TEST(CommandLineFlagsTest, CanBeAccessedInCodeOnceGTestHIsIncluded) {
#include <cstdint> #include <cstdint>
#include <map> #include <map>
#include <ostream> #include <ostream>
#include <set>
#include <string> #include <string>
#include <type_traits> #include <type_traits>
#include <unordered_set> #include <unordered_set>
...@@ -3455,10 +3454,10 @@ TEST_F(NoFatalFailureTest, MessageIsStreamable) { ...@@ -3455,10 +3454,10 @@ TEST_F(NoFatalFailureTest, MessageIsStreamable) {
TestPartResultArray gtest_failures; TestPartResultArray gtest_failures;
{ {
ScopedFakeTestPartResultReporter gtest_reporter(&gtest_failures); ScopedFakeTestPartResultReporter gtest_reporter(&gtest_failures);
EXPECT_NO_FATAL_FAILURE([] { FAIL() << "foo"; }()) << "my message"; EXPECT_NO_FATAL_FAILURE(FAIL() << "foo") << "my message";
} }
ASSERT_EQ(2, gtest_failures.size()); ASSERT_EQ(2, gtest_failures.size());
EXPECT_EQ(TestPartResult::kFatalFailure, EXPECT_EQ(TestPartResult::kNonFatalFailure,
gtest_failures.GetTestPartResult(0).type()); gtest_failures.GetTestPartResult(0).type());
EXPECT_EQ(TestPartResult::kNonFatalFailure, EXPECT_EQ(TestPartResult::kNonFatalFailure,
gtest_failures.GetTestPartResult(1).type()); gtest_failures.GetTestPartResult(1).type());
...@@ -6637,9 +6636,6 @@ TEST(ColoredOutputTest, UsesColorsWhenTermSupportsColors) { ...@@ -6637,9 +6636,6 @@ TEST(ColoredOutputTest, UsesColorsWhenTermSupportsColors) {
SetEnv("TERM", "xterm-color"); // TERM supports colors. SetEnv("TERM", "xterm-color"); // TERM supports colors.
EXPECT_TRUE(ShouldUseColor(true)); // Stdout is a TTY. EXPECT_TRUE(ShouldUseColor(true)); // Stdout is a TTY.
SetEnv("TERM", "xterm-kitty"); // TERM supports colors.
EXPECT_TRUE(ShouldUseColor(true)); // Stdout is a TTY.
SetEnv("TERM", "xterm-256color"); // TERM supports colors. SetEnv("TERM", "xterm-256color"); // TERM supports colors.
EXPECT_TRUE(ShouldUseColor(true)); // Stdout is a TTY. EXPECT_TRUE(ShouldUseColor(true)); // Stdout is a TTY.
...@@ -7707,7 +7703,7 @@ auto* dynamic_test = testing::RegisterTest( ...@@ -7707,7 +7703,7 @@ auto* dynamic_test = testing::RegisterTest(
__LINE__, []() -> DynamicUnitTestFixture* { return new DynamicTest; }); __LINE__, []() -> DynamicUnitTestFixture* { return new DynamicTest; });
TEST(RegisterTest, WasRegistered) { TEST(RegisterTest, WasRegistered) {
const auto& unittest = testing::UnitTest::GetInstance(); auto* unittest = testing::UnitTest::GetInstance();
for (int i = 0; i < unittest->total_test_suite_count(); ++i) { for (int i = 0; i < unittest->total_test_suite_count(); ++i) {
auto* tests = unittest->GetTestSuite(i); auto* tests = unittest->GetTestSuite(i);
if (tests->name() != std::string("DynamicUnitTestFixture")) continue; if (tests->name() != std::string("DynamicUnitTestFixture")) continue;
......
...@@ -39,7 +39,5 @@ class PropertyTwo : public testing::Test { ...@@ -39,7 +39,5 @@ class PropertyTwo : public testing::Test {
}; };
TEST_F(PropertyTwo, TestSomeProperties) { TEST_F(PropertyTwo, TestSomeProperties) {
// Validate we can write an unsigned size_t as a property RecordProperty("TestSomeProperty", 2);
size_t prop_two = 2;
RecordProperty("TestSomeProperty", prop_two);
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment