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

Unified Diff: crypto/sha2_unittest.cc

Issue 1261333004: Add support for Flash Player Component updates on Linux (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase to fix merge conflicts Created 5 years, 4 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
« chrome/common/component_flash_hint_file_linux.cc ('K') | « crypto/sha2.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: crypto/sha2_unittest.cc
diff --git a/crypto/sha2_unittest.cc b/crypto/sha2_unittest.cc
index 78da1360d4daab5bbd9c4e3ccfc869b1586345c3..d3a5a3f4c426acbd0e11518f48c7d1e9ea2741d1 100644
--- a/crypto/sha2_unittest.cc
+++ b/crypto/sha2_unittest.cc
@@ -98,3 +98,20 @@ TEST(Sha256Test, Test3) {
for (size_t i = 0; i < sizeof(output_truncated3); i++)
EXPECT_EQ(expected3[i], static_cast<int>(output_truncated3[i]));
}
+
+TEST(Sha256Test, Test4) {
+ const uint8_t input4[] = {
+ 0x47, 0x65, 0x74, 0x20, 0x6f, 0x75, 0x74, 0x20, 0x74, 0x68, 0x65,
+ 0x72, 0x65, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x72, 0x6f, 0x63, 0x6b,
+ 0x2c, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x72, 0x6f, 0x6c, 0x6c, 0x20,
+ 0x74, 0x68, 0x65, 0x20, 0x62, 0x6f, 0x6e, 0x65, 0x73, 0x21, 0x0a};
+ const uint8_t expected4[] = {0x9f, 0xbe, 0x2b, 0x07, 0x76, 0x55, 0x14, 0xc9,
+ 0x50, 0xe1, 0x16, 0xee, 0xcc, 0x2d, 0x89, 0x2a,
+ 0x5a, 0xfd, 0xaa, 0xae, 0x73, 0x54, 0xad, 0xb6,
+ 0x12, 0x31, 0x7e, 0xd0, 0xb4, 0x67, 0x79, 0x17};
+
+ uint8_t output4[crypto::kSHA256Length];
+ crypto::SHA256HashBytes(input4, sizeof(input4), output4, sizeof(output4));
+ for (size_t i = 0; i < sizeof(output4); i++)
+ EXPECT_EQ(expected4[i], output4[i]);
+}
« chrome/common/component_flash_hint_file_linux.cc ('K') | « crypto/sha2.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698