diff options
author | darin@google.com <darin@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-19 18:36:23 +0000 |
---|---|---|
committer | darin@google.com <darin@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-19 18:36:23 +0000 |
commit | b16ef312cb28582a1d324d20e4328afeef2c7538 (patch) | |
tree | bcbc40bbe3950501c888eab655f5070619ad1ac7 /base/histogram_test.cc | |
parent | 4880adb3346faa91feea9d8ecfecc4ef499bf7fc (diff) | |
download | chromium_src-b16ef312cb28582a1d324d20e4328afeef2c7538.zip chromium_src-b16ef312cb28582a1d324d20e4328afeef2c7538.tar.gz chromium_src-b16ef312cb28582a1d324d20e4328afeef2c7538.tar.bz2 |
Define MessagePumpDefault and use it to implement MessageLoop on non-Windows
platforms. This is actually just a first-step toward the real fix which is to
use MessagePumpDefault on all platforms on non-UI and non-IO threads.
This CL also fixes some GCC compilation errors. I renamed MessageLoopOwnable
to TaskBase, which seems more appropriate since a MessageLoopOwnable has a
next Task pointer and clearly is only meaningful in the context of Task. (I
wonder why it is even a separate class, but that is another issue.) I had to
make the next_task / set_next_task methods public since they are used by an
inner class of MessageLoop. Perhaps those inner classes should be made into
top-level classes, but that seemed like too much to change at this time.
R=jar,mmentovai
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1045 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/histogram_test.cc')
-rw-r--r-- | base/histogram_test.cc | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/base/histogram_test.cc b/base/histogram_test.cc index 9830392..29172e3 100644 --- a/base/histogram_test.cc +++ b/base/histogram_test.cc @@ -76,46 +76,46 @@ TEST(HistogramTest, RecordedStartupTest) { StatisticsRecorder recorder; // This initializes the global state. StatisticsRecorder::Histograms histograms; - EXPECT_EQ(0, histograms.size()); + EXPECT_EQ(0U, histograms.size()); StatisticsRecorder::GetHistograms(&histograms); // Load up lists - EXPECT_EQ(0, histograms.size()); + EXPECT_EQ(0U, histograms.size()); // Try basic construction Histogram histogram(L"TestHistogram", 1, 1000, 10); histograms.clear(); StatisticsRecorder::GetHistograms(&histograms); // Load up lists - EXPECT_EQ(1, histograms.size()); + EXPECT_EQ(1U, histograms.size()); Histogram histogram1(L"Test1Histogram", 1, 1000, 10); histograms.clear(); StatisticsRecorder::GetHistograms(&histograms); // Load up lists - EXPECT_EQ(2, histograms.size()); + EXPECT_EQ(2U, histograms.size()); LinearHistogram linear_histogram(L"TestLinearHistogram", 1, 1000, 10); LinearHistogram linear_histogram1(L"Test1LinearHistogram", 1, 1000, 10); histograms.clear(); StatisticsRecorder::GetHistograms(&histograms); // Load up lists - EXPECT_EQ(4, histograms.size()); + EXPECT_EQ(4U, histograms.size()); // Use standard macros (but with fixed samples) HISTOGRAM_TIMES(L"Test2Histogram", TimeDelta::FromDays(1)); HISTOGRAM_COUNTS(L"Test3Histogram", 30); histograms.clear(); StatisticsRecorder::GetHistograms(&histograms); // Load up lists - EXPECT_EQ(6, histograms.size()); + EXPECT_EQ(6U, histograms.size()); ASSET_HISTOGRAM_COUNTS(L"TestAssetHistogram", 1000); histograms.clear(); StatisticsRecorder::GetHistograms(&histograms); // Load up lists - EXPECT_EQ(7, histograms.size()); + EXPECT_EQ(7U, histograms.size()); DHISTOGRAM_TIMES(L"Test4Histogram", TimeDelta::FromDays(1)); DHISTOGRAM_COUNTS(L"Test5Histogram", 30); histograms.clear(); StatisticsRecorder::GetHistograms(&histograms); // Load up lists #ifndef NDEBUG - EXPECT_EQ(9, histograms.size()); + EXPECT_EQ(9U, histograms.size()); #else - EXPECT_EQ(7, histograms.size()); + EXPECT_EQ(7U, histograms.size()); #endif } @@ -124,7 +124,7 @@ TEST(HistogramTest, RangeTest) { StatisticsRecorder::Histograms histograms; recorder.GetHistograms(&histograms); - EXPECT_EQ(0, histograms.size()); + EXPECT_EQ(0U, histograms.size()); Histogram histogram(L"Histogram", 1, 64, 8); // As mentioned in header file. // Check that we got a nice exponential when there was enough rooom. @@ -177,12 +177,12 @@ TEST(HistogramTest, RangeTest) { EXPECT_EQ(INT_MAX, threadsafe_histogram.ranges(15)); recorder.GetHistograms(&histograms); - EXPECT_EQ(5, histograms.size()); + EXPECT_EQ(5U, histograms.size()); } // Make sure histogram handles out-of-bounds data gracefully. TEST(HistogramTest, BoundsTest) { - const int kBucketCount = 50; + const size_t kBucketCount = 50; Histogram histogram(L"Bounded", 10, 100, kBucketCount); // Put two samples "out of bounds" above and below. @@ -251,7 +251,7 @@ TEST(HistogramTest, AssetCountTest) { // Find the histogram. StatisticsRecorder::Histograms histogram_list; StatisticsRecorder::GetHistograms(&histogram_list); - ASSERT_GT(histogram_list.size(), 0u); + ASSERT_NE(0U, histogram_list.size()); std::string ascii_name = WideToASCII(kAssetTestHistogramName); std::string debug_ascii_name = WideToASCII(kAssetTestDebugHistogramName); const Histogram* our_histogram = NULL; @@ -280,7 +280,7 @@ TEST(HistogramTest, AssetCountTest) { EXPECT_LT(++match_count, 2) << "extra count in bucket " << i; } } - EXPECT_EQ(1u, match_count); + EXPECT_EQ(1, match_count); // Remove our sample. AssetCountFunction(-100); // Remove a sample from the bucket for 100. @@ -304,7 +304,7 @@ TEST(HistogramTest, AssetCountTest) { EXPECT_LT(++match_count, 2) << "extra count in bucket " << i; } } - EXPECT_EQ(1u, match_count); + EXPECT_EQ(1, match_count); // Remove our sample. AssetCountFunction(-100); // Remove a sample from the bucket for 100. |