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

Side by Side Diff: net/quic/test_tools/quic_test_utils_test.cc

Issue 2590313003: Use SHA-1 functions from BoringSSL directly. (Closed)
Patch Set: Created 4 years 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 | « net/quic/test_tools/quic_test_utils.cc ('k') | net/quic/test_tools/simulator/quic_endpoint.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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "net/quic/test_tools/quic_test_utils.h" 5 #include "net/quic/test_tools/quic_test_utils.h"
6 6
7 #include "testing/gtest/include/gtest/gtest-spi.h" 7 #include "testing/gtest/include/gtest/gtest-spi.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 9
10 namespace net { 10 namespace net {
(...skipping 19 matching lines...) Expand all
30 30
31 TEST(QuicTestUtilsTest, QuicBandwidth) { 31 TEST(QuicTestUtilsTest, QuicBandwidth) {
32 ExpectApproxEq(QuicBandwidth::FromBytesPerSecond(1000), 32 ExpectApproxEq(QuicBandwidth::FromBytesPerSecond(1000),
33 QuicBandwidth::FromBitsPerSecond(8005), 0.01f); 33 QuicBandwidth::FromBitsPerSecond(8005), 0.01f);
34 EXPECT_NONFATAL_FAILURE( 34 EXPECT_NONFATAL_FAILURE(
35 ExpectApproxEq(QuicBandwidth::FromBytesPerSecond(1000), 35 ExpectApproxEq(QuicBandwidth::FromBytesPerSecond(1000),
36 QuicBandwidth::FromBitsPerSecond(9005), 0.01f), 36 QuicBandwidth::FromBitsPerSecond(9005), 0.01f),
37 ""); 37 "");
38 } 38 }
39 39
40 // Ensure that SimpleRandom does not change its output for a fixed seed.
41 TEST(QuicTestUtilsTest, SimpleRandomStability) {
42 SimpleRandom rng;
43 rng.set_seed(UINT64_C(0x1234567800010001));
44 EXPECT_EQ(UINT64_C(14865409841904857791), rng.RandUint64());
45 EXPECT_EQ(UINT64_C(12139094019410129741), rng.RandUint64());
46 }
47
40 } // namespace test 48 } // namespace test
41 } // namespace net 49 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/test_tools/quic_test_utils.cc ('k') | net/quic/test_tools/simulator/quic_endpoint.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698