Fix broken test
diff --git a/quic/core/quic_connection_id.cc b/quic/core/quic_connection_id.cc
index 7b4f41b..f446ac8 100644
--- a/quic/core/quic_connection_id.cc
+++ b/quic/core/quic_connection_id.cc
@@ -32,10 +32,10 @@
// that they always land in the same hash bucket.
class QuicConnectionIdHasher {
public:
- inline QuicConnectionIdHasher()
+ explicit inline QuicConnectionIdHasher()
: QuicConnectionIdHasher(QuicRandom::GetInstance()) {}
- inline QuicConnectionIdHasher(QuicRandom* random) {
+ explicit inline QuicConnectionIdHasher(QuicRandom* random) {
random->RandBytes(&sip_hash_key_, sizeof(sip_hash_key_));
}
diff --git a/quic/core/quic_connection_id_test.cc b/quic/core/quic_connection_id_test.cc
index 64afaf8..0d4b190 100644
--- a/quic/core/quic_connection_id_test.cc
+++ b/quic/core/quic_connection_id_test.cc
@@ -92,6 +92,12 @@
// Verify that any two all-zero connection IDs of different lengths never
// have the same hash.
+ if (sizeof(connection_id64_1.Hash()) < sizeof(uint64_t) &&
+ !GetQuicRestartFlag(quic_connection_id_use_siphash)) {
+ // The old hashing algorithm returns 0 for all-zero connection IDs on
+ // 32bit platforms.
+ return;
+ }
const char connection_id_bytes[kQuicMaxConnectionIdLength] = {};
for (uint8_t i = 0; i < kQuicMaxConnectionIdLength - 1; ++i) {
QuicConnectionId connection_id_i(connection_id_bytes, i);