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

Unified Diff: net/quic/test_tools/quic_crypto_server_config_peer.cc

Issue 2681793002: Landing Recent QUIC changes until 5:30 PM, Feb 3, 2017 UTC-5 (Closed)
Patch Set: sync and rebase Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/test_tools/quic_crypto_server_config_peer.h ('k') | net/quic/test_tools/quic_stream_peer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/test_tools/quic_crypto_server_config_peer.cc
diff --git a/net/quic/test_tools/quic_crypto_server_config_peer.cc b/net/quic/test_tools/quic_crypto_server_config_peer.cc
index d9a47f7747b8d8fc5711e644ddf242eaa16044dd..fa2b30c29c2d073e1ed641d5004ce6310c3da59e 100644
--- a/net/quic/test_tools/quic_crypto_server_config_peer.cc
+++ b/net/quic/test_tools/quic_crypto_server_config_peer.cc
@@ -97,44 +97,19 @@ string QuicCryptoServerConfigPeer::NewServerNonce(QuicRandom* rand,
return server_config_->NewServerNonce(rand, now);
}
-void QuicCryptoServerConfigPeer::CheckConfigs(const char* server_config_id1,
- ...) {
- va_list ap;
- va_start(ap, server_config_id1);
-
- std::vector<std::pair<ServerConfigID, bool>> expected;
- bool first = true;
- for (;;) {
- const char* server_config_id;
- if (first) {
- server_config_id = server_config_id1;
- first = false;
- } else {
- server_config_id = va_arg(ap, const char*);
- }
-
- if (!server_config_id) {
- break;
- }
-
- // varargs will promote the value to an int so we have to read that from
- // the stack and cast down.
- const bool is_primary = static_cast<bool>(va_arg(ap, int));
- expected.push_back(std::make_pair(server_config_id, is_primary));
- }
-
- va_end(ap);
-
+void QuicCryptoServerConfigPeer::CheckConfigs(
+ std::vector<std::pair<string, bool>> expected_ids_and_status) {
QuicReaderMutexLock locked(&server_config_->configs_lock_);
- ASSERT_EQ(expected.size(), server_config_->configs_.size()) << ConfigsDebug();
+ ASSERT_EQ(expected_ids_and_status.size(), server_config_->configs_.size())
+ << ConfigsDebug();
for (const std::pair<
const ServerConfigID,
QuicReferenceCountedPointer<QuicCryptoServerConfig::Config>>& i :
server_config_->configs_) {
bool found = false;
- for (std::pair<ServerConfigID, bool>& j : expected) {
+ for (std::pair<ServerConfigID, bool>& j : expected_ids_and_status) {
if (i.first == j.first && i.second->is_primary == j.second) {
found = true;
j.first.clear();
« no previous file with comments | « net/quic/test_tools/quic_crypto_server_config_peer.h ('k') | net/quic/test_tools/quic_stream_peer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698