summaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
authorviettrungluu <viettrungluu@chromium.org>2014-10-16 18:20:48 -0700
committerCommit bot <commit-bot@chromium.org>2014-10-17 01:21:04 +0000
commit2560ad88c6c237d40db5bf2e377cd552c33ef6ea (patch)
treecbb6d0a186ad1b08a917e6a07c5558389cd3f74f /crypto
parent7cbf7ae277ab297529d5ae4b5f3f61cc37bc77ea (diff)
downloadchromium_src-2560ad88c6c237d40db5bf2e377cd552c33ef6ea.zip
chromium_src-2560ad88c6c237d40db5bf2e377cd552c33ef6ea.tar.gz
chromium_src-2560ad88c6c237d40db5bf2e377cd552c33ef6ea.tar.bz2
Convert the few remaining ARRAYSIZE_UNSAFE -> arraysize.
There are still ARRAYSIZE_UNSAFEs in ppapi/tests/test_audio.cc, but it defines it itself, and it might be compiled by some older NaCl toolchain that doesn't support C++11. third_party/npapi/npspy/common/format.cpp also has its own ARRAYSIZE_UNSAFE, but I'm hoping to delete npspy completely.) I'll remove ARRAYSIZE_UNSAFE from base/macro.h separately, since it's quite likely we have deps that use our base (and those deps may use it). R=ben@chromium.org TBR=armansito@chromium.org BUG=423134 Review URL: https://codereview.chromium.org/663673002 Cr-Commit-Position: refs/heads/master@{#300034}
Diffstat (limited to 'crypto')
-rw-r--r--crypto/hmac_unittest.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/crypto/hmac_unittest.cc b/crypto/hmac_unittest.cc
index 174c323..91eccd6 100644
--- a/crypto/hmac_unittest.cc
+++ b/crypto/hmac_unittest.cc
@@ -142,7 +142,7 @@ TEST(HMACTest, RFC2202TestCases) {
"\xBB\xFF\x1A\x91" }
};
- for (size_t i = 0; i < ARRAYSIZE_UNSAFE(cases); ++i) {
+ for (size_t i = 0; i < arraysize(cases); ++i) {
crypto::HMAC hmac(crypto::HMAC::SHA1);
ASSERT_TRUE(hmac.Init(reinterpret_cast<const unsigned char*>(cases[i].key),
cases[i].key_len));
@@ -239,7 +239,7 @@ TEST(HMACTest, HMACObjectReuse) {
ASSERT_TRUE(
hmac.Init(reinterpret_cast<const unsigned char*>(kSimpleKey),
kSimpleKeyLength));
- for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kSimpleHmacCases); ++i) {
+ for (size_t i = 0; i < arraysize(kSimpleHmacCases); ++i) {
std::string data_string(kSimpleHmacCases[i].data,
kSimpleHmacCases[i].data_len);
unsigned char digest[kSHA1DigestSize];
@@ -254,7 +254,7 @@ TEST(HMACTest, Verify) {
hmac.Init(reinterpret_cast<const unsigned char*>(kSimpleKey),
kSimpleKeyLength));
const char empty_digest[kSHA1DigestSize] = { 0 };
- for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kSimpleHmacCases); ++i) {
+ for (size_t i = 0; i < arraysize(kSimpleHmacCases); ++i) {
// Expected results
EXPECT_TRUE(hmac.Verify(
base::StringPiece(kSimpleHmacCases[i].data,