| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/metrics/sample_map.h" | 5 #include "base/metrics/sample_map.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/test/gtest_util.h" | 9 #include "base/test/gtest_util.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 TEST(SampleMapIteratorDeathTest, IterateDoneTest) { | 148 TEST(SampleMapIteratorDeathTest, IterateDoneTest) { |
| 149 SampleMap samples(1); | 149 SampleMap samples(1); |
| 150 | 150 |
| 151 std::unique_ptr<SampleCountIterator> it = samples.Iterator(); | 151 std::unique_ptr<SampleCountIterator> it = samples.Iterator(); |
| 152 | 152 |
| 153 EXPECT_TRUE(it->Done()); | 153 EXPECT_TRUE(it->Done()); |
| 154 | 154 |
| 155 HistogramBase::Sample min; | 155 HistogramBase::Sample min; |
| 156 HistogramBase::Sample max; | 156 HistogramBase::Sample max; |
| 157 HistogramBase::Count count; | 157 HistogramBase::Count count; |
| 158 EXPECT_DCHECK_DEATH(it->Get(&min, &max, &count), ""); | 158 EXPECT_DCHECK_DEATH(it->Get(&min, &max, &count)); |
| 159 | 159 |
| 160 EXPECT_DCHECK_DEATH(it->Next(), ""); | 160 EXPECT_DCHECK_DEATH(it->Next()); |
| 161 | 161 |
| 162 samples.Accumulate(1, 100); | 162 samples.Accumulate(1, 100); |
| 163 it = samples.Iterator(); | 163 it = samples.Iterator(); |
| 164 EXPECT_FALSE(it->Done()); | 164 EXPECT_FALSE(it->Done()); |
| 165 } | 165 } |
| 166 | 166 |
| 167 } // namespace | 167 } // namespace |
| 168 } // namespace base | 168 } // namespace base |
| OLD | NEW |