| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <string.h> | 5 #include <string.h> |
| 6 #include <string> | 6 #include <string> |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/md5.h" | 10 #include "base/md5.h" |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 MD5Final(&check_full_digest, &check_full_context); | 239 MD5Final(&check_full_digest, &check_full_context); |
| 240 | 240 |
| 241 MD5Digest digest; | 241 MD5Digest digest; |
| 242 MD5Final(&digest, &context); | 242 MD5Final(&digest, &context); |
| 243 | 243 |
| 244 // The header and full digest pairs are the same, and they aren't the same as | 244 // The header and full digest pairs are the same, and they aren't the same as |
| 245 // each other. | 245 // each other. |
| 246 EXPECT_TRUE(!memcmp(&header_digest, &check_header_digest, | 246 EXPECT_TRUE(!memcmp(&header_digest, &check_header_digest, |
| 247 sizeof(header_digest))); | 247 sizeof(header_digest))); |
| 248 EXPECT_TRUE(!memcmp(&digest, &check_full_digest, sizeof(digest))); | 248 EXPECT_TRUE(!memcmp(&digest, &check_full_digest, sizeof(digest))); |
| 249 EXPECT_FALSE(!memcmp(&digest, &header_digest, sizeof(digest))); | 249 EXPECT_TRUE(memcmp(&digest, &header_digest, sizeof(digest))); |
| 250 } | 250 } |
| 251 | 251 |
| 252 } // namespace base | 252 } // namespace base |
| OLD | NEW |