OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "debug.h" | 5 #include "debug.h" |
6 | 6 |
7 #include <sstream> | 7 #include <sstream> |
8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "gtest/gtest.h" |
9 | 9 |
10 namespace relocation_packer { | 10 namespace relocation_packer { |
11 | 11 |
12 TEST(Debug, Log) { | 12 TEST(Debug, Log) { |
13 Logger::Reset(); | 13 Logger::Reset(); |
14 std::ostringstream info; | 14 std::ostringstream info; |
15 std::ostringstream error; | 15 std::ostringstream error; |
16 Logger::SetStreams(&info, &error); | 16 Logger::SetStreams(&info, &error); |
17 | 17 |
18 LOG(INFO) << "INFO log message"; | 18 LOG(INFO) << "INFO log message"; |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 EXPECT_DEATH(CHECK(0 == 1), "FATAL: .*:.*: .*: CHECK '0 == 1' failed"); | 113 EXPECT_DEATH(CHECK(0 == 1), "FATAL: .*:.*: .*: CHECK '0 == 1' failed"); |
114 } | 114 } |
115 | 115 |
116 TEST(DebugDeathTest, NotReached) { | 116 TEST(DebugDeathTest, NotReached) { |
117 ::testing::FLAGS_gtest_death_test_style = "threadsafe"; | 117 ::testing::FLAGS_gtest_death_test_style = "threadsafe"; |
118 Logger::Reset(); | 118 Logger::Reset(); |
119 EXPECT_DEATH(NOTREACHED(), "FATAL: .*:.*: .*: NOTREACHED\\(\\) hit"); | 119 EXPECT_DEATH(NOTREACHED(), "FATAL: .*:.*: .*: NOTREACHED\\(\\) hit"); |
120 } | 120 } |
121 | 121 |
122 } // namespace relocation_packer | 122 } // namespace relocation_packer |
OLD | NEW |