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

Side by Side Diff: net/quic/congestion_control/cube_root_test.cc

Issue 266243004: Clang format slam. Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/basictypes.h" 5 #include "base/basictypes.h"
6 #include "net/quic/congestion_control/cube_root.h" 6 #include "net/quic/congestion_control/cube_root.h"
7 #include "testing/gtest/include/gtest/gtest.h" 7 #include "testing/gtest/include/gtest/gtest.h"
8 8
9 namespace net { 9 namespace net {
10 namespace test { 10 namespace test {
11 11
12 class CubeRootTest : public ::testing::Test { 12 class CubeRootTest : public ::testing::Test {
13 protected: 13 protected:
14 CubeRootTest() { 14 CubeRootTest() {}
15 }
16 }; 15 };
17 16
18 TEST_F(CubeRootTest, LowRoot) { 17 TEST_F(CubeRootTest, LowRoot) {
19 for (uint32 i = 1; i < 256; ++i) { 18 for (uint32 i = 1; i < 256; ++i) {
20 uint64 cube = i * i * i; 19 uint64 cube = i * i * i;
21 uint8 cube_root = CubeRoot::Root(cube); 20 uint8 cube_root = CubeRoot::Root(cube);
22 EXPECT_EQ(i, cube_root); 21 EXPECT_EQ(i, cube_root);
23 } 22 }
24 } 23 }
25 24
(...skipping 12 matching lines...) Expand all
38 uint64 cube = i * i * i; 37 uint64 cube = i * i * i;
39 uint32 cube_root = CubeRoot::Root(cube); 38 uint32 cube_root = CubeRoot::Root(cube);
40 uint32 margin = cube_root >> 9; 39 uint32 margin = cube_root >> 9;
41 EXPECT_LE(i - margin, cube_root); 40 EXPECT_LE(i - margin, cube_root);
42 EXPECT_GE(i + margin, cube_root); 41 EXPECT_GE(i + margin, cube_root);
43 } 42 }
44 } 43 }
45 44
46 } // namespace test 45 } // namespace test
47 } // namespace net 46 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698