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

Unified Diff: base/md5_unittest.cc

Issue 1099453002: base: Simplify the construction of MD5Digest. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: REBASE Created 5 years, 8 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 | « base/md5.cc ('k') | components/data_reduction_proxy/core/browser/data_reduction_proxy_tamper_detection.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/md5_unittest.cc
diff --git a/base/md5_unittest.cc b/base/md5_unittest.cc
index 8d817e9a8e0a6d97bbfa95eab54240737649ffb2..f6721dfd62e12f07bd749fee291e2a8e1dde5556 100644
--- a/base/md5_unittest.cc
+++ b/base/md5_unittest.cc
@@ -23,7 +23,7 @@ TEST(MD5, DigestToBase16) {
};
for (int i = 0; i < 16; ++i)
- digest.a[i] = data[i] & 0xff;
+ digest[i] = data[i] & 0xff;
std::string actual = MD5DigestToBase16(digest);
std::string expected = "d41d8cd98f00b204e9800998ecf8427e";
@@ -45,7 +45,7 @@ TEST(MD5, MD5SumEmtpyData) {
};
for (int i = 0; i < 16; ++i)
- EXPECT_EQ(expected[i], digest.a[i] & 0xFF);
+ EXPECT_EQ(expected[i], digest[i] & 0xFF);
}
TEST(MD5, MD5SumOneByteData) {
@@ -62,7 +62,7 @@ TEST(MD5, MD5SumOneByteData) {
};
for (int i = 0; i < 16; ++i)
- EXPECT_EQ(expected[i], digest.a[i] & 0xFF);
+ EXPECT_EQ(expected[i], digest[i] & 0xFF);
}
TEST(MD5, MD5SumLongData) {
@@ -83,7 +83,7 @@ TEST(MD5, MD5SumLongData) {
};
for (int i = 0; i < 16; ++i)
- EXPECT_EQ(expected[i], digest.a[i] & 0xFF);
+ EXPECT_EQ(expected[i], digest[i] & 0xFF);
}
TEST(MD5, ContextWithEmptyData) {
@@ -101,7 +101,7 @@ TEST(MD5, ContextWithEmptyData) {
};
for (int i = 0; i < 16; ++i)
- EXPECT_EQ(expected[i], digest.a[i] & 0xFF);
+ EXPECT_EQ(expected[i], digest[i] & 0xFF);
}
TEST(MD5, ContextWithLongData) {
@@ -138,7 +138,7 @@ TEST(MD5, ContextWithLongData) {
};
for (int i = 0; i < 16; ++i)
- EXPECT_EQ(expected[i], digest.a[i] & 0xFF);
+ EXPECT_EQ(expected[i], digest[i] & 0xFF);
}
// Example data from http://www.ietf.org/rfc/rfc1321.txt A.5 Test Suite
« no previous file with comments | « base/md5.cc ('k') | components/data_reduction_proxy/core/browser/data_reduction_proxy_tamper_detection.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698