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

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

Issue 266243004: Clang format slam. Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 | Annotate | Revision Log
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 "net/quic/crypto/crypto_secret_boxer.h" 5 #include "net/quic/crypto/crypto_secret_boxer.h"
6 6
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "net/quic/crypto/quic_random.h" 8 #include "net/quic/crypto/quic_random.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10
(...skipping 15 matching lines...) Expand all
26 const string box = boxer.Box(QuicRandom::GetInstance(), message); 26 const string box = boxer.Box(QuicRandom::GetInstance(), message);
27 27
28 string storage; 28 string storage;
29 StringPiece result; 29 StringPiece result;
30 EXPECT_TRUE(boxer.Unbox(box, &storage, &result)); 30 EXPECT_TRUE(boxer.Unbox(box, &storage, &result));
31 EXPECT_EQ(result, message); 31 EXPECT_EQ(result, message);
32 32
33 EXPECT_FALSE(boxer.Unbox(string(1, 'X') + box, &storage, &result)); 33 EXPECT_FALSE(boxer.Unbox(string(1, 'X') + box, &storage, &result));
34 EXPECT_FALSE(boxer.Unbox(box.substr(1, string::npos), &storage, &result)); 34 EXPECT_FALSE(boxer.Unbox(box.substr(1, string::npos), &storage, &result));
35 EXPECT_FALSE(boxer.Unbox(string(), &storage, &result)); 35 EXPECT_FALSE(boxer.Unbox(string(), &storage, &result));
36 EXPECT_FALSE(boxer.Unbox(string(1, box[0]^0x80) + box.substr(1, string::npos), 36 EXPECT_FALSE(
37 &storage, &result)); 37 boxer.Unbox(string(1, box[0] ^ 0x80) + box.substr(1, string::npos),
38 &storage,
39 &result));
38 } 40 }
39 41
40 } // namespace test 42 } // namespace test
41 } // namespace net 43 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698