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

Side by Side Diff: net/quic/crypto/crypto_server_test.cc

Issue 826973002: replace COMPILE_ASSERT with static_assert in net/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: apply fixups Created 5 years, 11 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
« no previous file with comments | « net/quic/crypto/crypto_handshake_message.cc ('k') | net/quic/crypto/curve25519_key_exchange.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 (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 <ostream> 5 #include <ostream>
6 #include <vector> 6 #include <vector>
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "crypto/secure_hash.h" 10 #include "crypto/secure_hash.h"
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 StringPiece(reinterpret_cast<const char*>(orbit_), sizeof(orbit_)), 266 StringPiece(reinterpret_cast<const char*>(orbit_), sizeof(orbit_)),
267 &nonce); 267 &nonce);
268 return nonce; 268 return nonce;
269 } 269 }
270 270
271 void CheckRejectReasons( 271 void CheckRejectReasons(
272 const HandshakeFailureReason* expected_handshake_failures, 272 const HandshakeFailureReason* expected_handshake_failures,
273 size_t expected_count) { 273 size_t expected_count) {
274 const uint32* reject_reasons; 274 const uint32* reject_reasons;
275 size_t num_reject_reasons; 275 size_t num_reject_reasons;
276 COMPILE_ASSERT(sizeof(QuicTag) == sizeof(uint32), header_out_of_sync); 276 static_assert(sizeof(QuicTag) == sizeof(uint32), "header out of sync");
277 QuicErrorCode error_code = out_.GetTaglist(kRREJ, &reject_reasons, 277 QuicErrorCode error_code = out_.GetTaglist(kRREJ, &reject_reasons,
278 &num_reject_reasons); 278 &num_reject_reasons);
279 if (!FLAGS_send_quic_crypto_reject_reason) { 279 if (!FLAGS_send_quic_crypto_reject_reason) {
280 ASSERT_EQ(QUIC_CRYPTO_MESSAGE_PARAMETER_NOT_FOUND, error_code); 280 ASSERT_EQ(QUIC_CRYPTO_MESSAGE_PARAMETER_NOT_FOUND, error_code);
281 return; 281 return;
282 } 282 }
283 ASSERT_EQ(QUIC_NO_ERROR, error_code); 283 ASSERT_EQ(QUIC_NO_ERROR, error_code);
284 284
285 if (FLAGS_use_early_return_when_verifying_chlo) { 285 if (FLAGS_use_early_return_when_verifying_chlo) {
286 EXPECT_EQ(1u, num_reject_reasons); 286 EXPECT_EQ(1u, num_reject_reasons);
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after
719 719
720 strike_register_client_->RunPendingVerifications(); 720 strike_register_client_->RunPendingVerifications();
721 ASSERT_TRUE(called); 721 ASSERT_TRUE(called);
722 EXPECT_EQ(0, strike_register_client_->PendingVerifications()); 722 EXPECT_EQ(0, strike_register_client_->PendingVerifications());
723 // The message should be rejected now. 723 // The message should be rejected now.
724 EXPECT_EQ(kREJ, out_.tag()); 724 EXPECT_EQ(kREJ, out_.tag());
725 } 725 }
726 726
727 } // namespace test 727 } // namespace test
728 } // namespace net 728 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/crypto/crypto_handshake_message.cc ('k') | net/quic/crypto/curve25519_key_exchange.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698