Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(138)

Side by Side Diff: base/metrics/histogram_unittest.cc

Issue 2213933003: Change EXPECT/ASSERT_DCHECK_DEATH macro to not expose the |regex| parameter. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@b2b0_simplethreadJoinable
Patch Set: Disabling a death test which crashed instead of DCHECKing : http://crbug.com/634552 Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « base/metrics/field_trial_unittest.cc ('k') | base/metrics/persistent_sample_map_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/histogram.h" 5 #include "base/metrics/histogram.h"
6 6
7 #include <limits.h> 7 #include <limits.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 719 matching lines...) Expand 10 before | Expand all | Expand 10 after
730 const BucketRanges* ranges = custom_histogram->bucket_ranges(); 730 const BucketRanges* ranges = custom_histogram->bucket_ranges();
731 ASSERT_EQ(3u, ranges->size()); 731 ASSERT_EQ(3u, ranges->size());
732 EXPECT_EQ(0, ranges->range(0)); 732 EXPECT_EQ(0, ranges->range(0));
733 EXPECT_EQ(5, ranges->range(1)); 733 EXPECT_EQ(5, ranges->range(1));
734 EXPECT_EQ(HistogramBase::kSampleType_MAX, ranges->range(2)); 734 EXPECT_EQ(HistogramBase::kSampleType_MAX, ranges->range(2));
735 735
736 // CustomHistogram does not accepts kSampleType_MAX as range. 736 // CustomHistogram does not accepts kSampleType_MAX as range.
737 custom_ranges.push_back(HistogramBase::kSampleType_MAX); 737 custom_ranges.push_back(HistogramBase::kSampleType_MAX);
738 EXPECT_DCHECK_DEATH( 738 EXPECT_DCHECK_DEATH(
739 CustomHistogram::FactoryGet("BadRangesCustom2", custom_ranges, 739 CustomHistogram::FactoryGet("BadRangesCustom2", custom_ranges,
740 HistogramBase::kNoFlags), 740 HistogramBase::kNoFlags));
741 "");
742 741
743 // CustomHistogram needs at least 1 valid range. 742 // CustomHistogram needs at least 1 valid range.
744 custom_ranges.clear(); 743 custom_ranges.clear();
745 custom_ranges.push_back(0); 744 custom_ranges.push_back(0);
746 EXPECT_DCHECK_DEATH( 745 EXPECT_DCHECK_DEATH(
747 CustomHistogram::FactoryGet("BadRangesCustom3", custom_ranges, 746 CustomHistogram::FactoryGet("BadRangesCustom3", custom_ranges,
748 HistogramBase::kNoFlags), 747 HistogramBase::kNoFlags));
749 "");
750 } 748 }
751 749
752 } // namespace base 750 } // namespace base
OLDNEW
« no previous file with comments | « base/metrics/field_trial_unittest.cc ('k') | base/metrics/persistent_sample_map_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698