| Index: net/quic/quic_sent_entropy_manager_test.cc
|
| diff --git a/net/quic/quic_sent_entropy_manager_test.cc b/net/quic/quic_sent_entropy_manager_test.cc
|
| index 3648bf3b7495c2775505474134ecaa0ba6f4ae53..78bdcce8a2bdf5f4e014b8668374dbb34ff2debc 100644
|
| --- a/net/quic/quic_sent_entropy_manager_test.cc
|
| +++ b/net/quic/quic_sent_entropy_manager_test.cc
|
| @@ -24,30 +24,24 @@ class QuicSentEntropyManagerTest : public ::testing::Test {
|
| };
|
|
|
| TEST_F(QuicSentEntropyManagerTest, SentEntropyHash) {
|
| - EXPECT_EQ(0, entropy_manager_.EntropyHash(0));
|
| + EXPECT_EQ(0, entropy_manager_.GetCumulativeEntropy(0));
|
|
|
| - vector<pair<QuicPacketSequenceNumber, QuicPacketEntropyHash> > entropies;
|
| - entropies.push_back(make_pair(1, 12));
|
| - entropies.push_back(make_pair(2, 1));
|
| - entropies.push_back(make_pair(3, 33));
|
| - entropies.push_back(make_pair(4, 3));
|
| -
|
| - for (size_t i = 0; i < entropies.size(); ++i) {
|
| - entropy_manager_.RecordPacketEntropyHash(entropies[i].first,
|
| - entropies[i].second);
|
| + QuicPacketEntropyHash entropies[4] = {12, 1, 33, 3};
|
| + for (size_t i = 0; i < arraysize(entropies); ++i) {
|
| + entropy_manager_.RecordPacketEntropyHash(i + 1, entropies[i]);
|
| }
|
|
|
| QuicPacketEntropyHash hash = 0;
|
| - for (size_t i = 0; i < entropies.size(); ++i) {
|
| - hash ^= entropies[i].second;
|
| - EXPECT_EQ(hash, entropy_manager_.EntropyHash(i + 1));
|
| + for (size_t i = 0; i < arraysize(entropies); ++i) {
|
| + hash ^= entropies[i];
|
| + EXPECT_EQ(hash, entropy_manager_.GetCumulativeEntropy(i + 1));
|
| }
|
| }
|
|
|
| TEST_F(QuicSentEntropyManagerTest, IsValidEntropy) {
|
| QuicPacketEntropyHash entropies[10] =
|
| {12, 1, 33, 3, 32, 100, 28, 42, 22, 255};
|
| - for (size_t i = 0; i < 10; ++i) {
|
| + for (size_t i = 0; i < arraysize(entropies); ++i) {
|
| entropy_manager_.RecordPacketEntropyHash(i + 1, entropies[i]);
|
| }
|
|
|
| @@ -58,7 +52,7 @@ TEST_F(QuicSentEntropyManagerTest, IsValidEntropy) {
|
| missing_packets.insert(8);
|
|
|
| QuicPacketEntropyHash entropy_hash = 0;
|
| - for (size_t i = 0; i < 10; ++i) {
|
| + for (size_t i = 0; i < arraysize(entropies); ++i) {
|
| if (missing_packets.find(i + 1) == missing_packets.end()) {
|
| entropy_hash ^= entropies[i];
|
| }
|
| @@ -72,7 +66,7 @@ TEST_F(QuicSentEntropyManagerTest, ClearEntropiesBefore) {
|
| QuicPacketEntropyHash entropies[10] =
|
| {12, 1, 33, 3, 32, 100, 28, 42, 22, 255};
|
|
|
| - for (size_t i = 0; i < 10; ++i) {
|
| + for (size_t i = 0; i < arraysize(entropies); ++i) {
|
| entropy_manager_.RecordPacketEntropyHash(i + 1, entropies[i]);
|
| }
|
|
|
| @@ -85,7 +79,7 @@ TEST_F(QuicSentEntropyManagerTest, ClearEntropiesBefore) {
|
| missing_packets.insert(8);
|
|
|
| QuicPacketEntropyHash entropy_hash = 0;
|
| - for (size_t i = 0; i < 10; ++i) {
|
| + for (size_t i = 0; i < arraysize(entropies); ++i) {
|
| if (missing_packets.find(i + 1) == missing_packets.end()) {
|
| entropy_hash ^= entropies[i];
|
| }
|
| @@ -94,10 +88,10 @@ TEST_F(QuicSentEntropyManagerTest, ClearEntropiesBefore) {
|
| entropy_hash));
|
|
|
| entropy_hash = 0;
|
| - for (size_t i = 0; i < 10; ++i) {
|
| + for (size_t i = 0; i < arraysize(entropies); ++i) {
|
| entropy_hash ^= entropies[i];
|
| }
|
| - EXPECT_EQ(entropy_hash, entropy_manager_.EntropyHash(10));
|
| + EXPECT_EQ(entropy_hash, entropy_manager_.GetCumulativeEntropy(10));
|
| }
|
|
|
| } // namespace
|
|
|