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

Side by Side Diff: crypto/secure_hash_unittest.cc

Issue 9447084: Refactor Pickle Read methods to use higher performance PickleIterator. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: compile (racing with incoming CLs) Created 8 years, 9 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
« no previous file with comments | « crypto/secure_hash_openssl.cc ('k') | gpu/ipc/gpu_command_buffer_traits.h » ('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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "crypto/secure_hash.h" 5 #include "crypto/secure_hash.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/pickle.h" 9 #include "base/pickle.h"
10 #include "crypto/sha2.h" 10 #include "crypto/sha2.h"
11 #include "testing/gtest/include/gtest/gtest.h" 11 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 ctx1->Update(input1.data(), input1.size()); 55 ctx1->Update(input1.data(), input1.size());
56 ctx1->Update(input2.data(), input2.size()); 56 ctx1->Update(input2.data(), input2.size());
57 ctx1->Update(input3.data(), input3.size()); 57 ctx1->Update(input3.data(), input3.size());
58 58
59 EXPECT_TRUE(ctx1->Serialize(&pickle)); 59 EXPECT_TRUE(ctx1->Serialize(&pickle));
60 ctx1->Update(input4.data(), input4.size()); 60 ctx1->Update(input4.data(), input4.size());
61 ctx1->Update(input5.data(), input5.size()); 61 ctx1->Update(input5.data(), input5.size());
62 62
63 ctx1->Finish(output1, sizeof(output1)); 63 ctx1->Finish(output1, sizeof(output1));
64 64
65 void* data_iterator = NULL; 65 PickleIterator data_iterator(pickle);
66 EXPECT_TRUE(ctx2->Deserialize(&data_iterator, &pickle)); 66 EXPECT_TRUE(ctx2->Deserialize(&data_iterator));
67 ctx2->Update(input4.data(), input4.size()); 67 ctx2->Update(input4.data(), input4.size());
68 ctx2->Update(input5.data(), input5.size()); 68 ctx2->Update(input5.data(), input5.size());
69 69
70 ctx2->Finish(output2, sizeof(output2)); 70 ctx2->Finish(output2, sizeof(output2));
71 71
72 EXPECT_EQ(0, memcmp(output1, output2, crypto::kSHA256Length)); 72 EXPECT_EQ(0, memcmp(output1, output2, crypto::kSHA256Length));
73 } 73 }
OLDNEW
« no previous file with comments | « crypto/secure_hash_openssl.cc ('k') | gpu/ipc/gpu_command_buffer_traits.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698