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

Unified Diff: chrome/installer/mini_installer/mini_string_test.cc

Issue 1126163003: mini_installer: Change to use _countof rather than base's arraysize macro. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rm stdlib.h includes Created 5 years, 7 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 | « chrome/installer/mini_installer/mini_string.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/installer/mini_installer/mini_string_test.cc
diff --git a/chrome/installer/mini_installer/mini_string_test.cc b/chrome/installer/mini_installer/mini_string_test.cc
index e83f16518211b9de51f957d8416101108d2d65a6..a2ef7bfdecdf5a8023d874957f400fa33dd85faf 100644
--- a/chrome/installer/mini_installer/mini_string_test.cc
+++ b/chrome/installer/mini_installer/mini_string_test.cc
@@ -3,6 +3,7 @@
// found in the LICENSE file.
#include <windows.h>
+#include <stdlib.h>
#include <string>
@@ -34,7 +35,7 @@ TEST_F(MiniInstallerStringTest, StackStringOverflow) {
size_t max_chars = str.capacity() - 1;
- while ((str.length() + (arraysize(kTestString) - 1)) <= max_chars) {
+ while ((str.length() + (_countof(kTestString) - 1)) <= max_chars) {
EXPECT_TRUE(str.append(kTestString));
compare_str.append(kTestString);
EXPECT_EQ(str.length(), compare_str.length());
@@ -70,6 +71,6 @@ TEST_F(MiniInstallerStringTest, StackStringFind) {
EXPECT_EQ(static_cast<const wchar_t*>(NULL), str.findi(kTestStringNotFound));
const wchar_t* found = str.findi(kTestStringFind);
EXPECT_NE(static_cast<const wchar_t*>(NULL), found);
- std::wstring check(found, arraysize(kTestStringFind) - 1);
+ std::wstring check(found, _countof(kTestStringFind) - 1);
EXPECT_EQ(0, lstrcmpi(check.c_str(), kTestStringFind));
}
« no previous file with comments | « chrome/installer/mini_installer/mini_string.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698