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

Side by Side Diff: base/rand_util_unittest.cc

Issue 1466413002: Update gtest to 786564fa4a3c, switch to googlemock in gtest Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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
OLDNEW
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 #include "base/rand_util.h" 5 #include "base/rand_util.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "base/memory/scoped_ptr.h" 11 #include "base/memory/scoped_ptr.h"
12 #include "base/time/time.h" 12 #include "base/time/time.h"
13 #include "testing/gtest/include/gtest/gtest.h" 13 #include "testing/gtest/googletest/include/gtest/gtest.h"
14 14
15 namespace { 15 namespace {
16 16
17 const int kIntMin = std::numeric_limits<int>::min(); 17 const int kIntMin = std::numeric_limits<int>::min();
18 const int kIntMax = std::numeric_limits<int>::max(); 18 const int kIntMax = std::numeric_limits<int>::max();
19 19
20 } // namespace 20 } // namespace
21 21
22 TEST(RandUtilTest, RandInt) { 22 TEST(RandUtilTest, RandInt) {
23 EXPECT_EQ(base::RandInt(0, 0), 0); 23 EXPECT_EQ(base::RandInt(0, 0), 0);
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 141
142 scoped_ptr<uint8[]> buffer(new uint8[kTestBufferSize]); 142 scoped_ptr<uint8[]> buffer(new uint8[kTestBufferSize]);
143 const base::TimeTicks now = base::TimeTicks::Now(); 143 const base::TimeTicks now = base::TimeTicks::Now();
144 for (int i = 0; i < kTestIterations; ++i) 144 for (int i = 0; i < kTestIterations; ++i)
145 base::RandBytes(buffer.get(), kTestBufferSize); 145 base::RandBytes(buffer.get(), kTestBufferSize);
146 const base::TimeTicks end = base::TimeTicks::Now(); 146 const base::TimeTicks end = base::TimeTicks::Now();
147 147
148 LOG(INFO) << "RandBytes(" << kTestBufferSize << ") took: " 148 LOG(INFO) << "RandBytes(" << kTestBufferSize << ") took: "
149 << (end - now).InMicroseconds() << "µs"; 149 << (end - now).InMicroseconds() << "µs";
150 } 150 }
OLDNEW
« no previous file with comments | « base/profiler/win32_stack_frame_unwinder_unittest.cc ('k') | base/scoped_clear_errno_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698