OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // Test of Histogram class | 5 // Test of Histogram class |
6 | 6 |
7 #include <algorithm> | |
levin
2011/06/14 07:35:05
I'm surprised that you didn't add #include <vector
Lei Zhang
2011/06/14 18:57:35
Done. Not sure why the linter did not complain.
| |
8 | |
9 #include "base/memory/scoped_ptr.h" | |
7 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
8 #include "base/scoped_ptr.h" | |
9 #include "base/time.h" | 11 #include "base/time.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
11 | 13 |
12 namespace base { | 14 namespace base { |
13 namespace { | 15 namespace { |
14 | 16 |
15 class HistogramTest : public testing::Test { | 17 class HistogramTest : public testing::Test { |
16 }; | 18 }; |
17 | 19 |
18 // Check for basic syntax and use. | 20 // Check for basic syntax and use. |
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
415 if (checksum & 1) | 417 if (checksum & 1) |
416 checksum = kReversedPolynomial ^ (checksum >> 1); | 418 checksum = kReversedPolynomial ^ (checksum >> 1); |
417 else | 419 else |
418 checksum >>= 1; | 420 checksum >>= 1; |
419 } | 421 } |
420 EXPECT_EQ(Histogram::kCrcTable[i], checksum); | 422 EXPECT_EQ(Histogram::kCrcTable[i], checksum); |
421 } | 423 } |
422 } | 424 } |
423 | 425 |
424 } // namespace base | 426 } // namespace base |
OLD | NEW |