Commit ef12daa2 authored by Christopher Dykes's avatar Christopher Dykes Committed by Facebook Github Bot 8

Rename SIZE to kSize

Summary: Because `SIZE` is a defined type on Windows.

Reviewed By: yfeldblum

Differential Revision: D3507144

fbshipit-source-id: ee9fd9bb7c35055ca69719717aa10d8e9c8701c2
parent 7a0de7ae
...@@ -20,12 +20,12 @@ ...@@ -20,12 +20,12 @@
namespace { namespace {
constexpr size_t SIZE = 4096 * 4; constexpr size_t kSize = 4096 * 4;
char src[SIZE]; char src[kSize];
char dst[SIZE]; char dst[kSize];
void init() { void init() {
for (size_t i = 0; i < SIZE; ++i) { for (size_t i = 0; i < kSize; ++i) {
src[i] = static_cast<char>(i); src[i] = static_cast<char>(i);
dst[i] = static_cast<char>(255 - i); dst[i] = static_cast<char>(255 - i);
} }
...@@ -42,7 +42,7 @@ TEST(memcpy, zero_len) UBSAN_DISABLE("nonnull-attribute") { ...@@ -42,7 +42,7 @@ TEST(memcpy, zero_len) UBSAN_DISABLE("nonnull-attribute") {
// Test copy `len' bytes and verify that exactly `len' bytes are copied. // Test copy `len' bytes and verify that exactly `len' bytes are copied.
void testLen(size_t len) { void testLen(size_t len) {
if (len > SIZE) { if (len > kSize) {
return; return;
} }
init(); init();
...@@ -51,7 +51,7 @@ void testLen(size_t len) { ...@@ -51,7 +51,7 @@ void testLen(size_t len) {
EXPECT_EQ(src[i], static_cast<char>(i)); EXPECT_EQ(src[i], static_cast<char>(i));
EXPECT_EQ(src[i], dst[i]); EXPECT_EQ(src[i], dst[i]);
} }
if (len < SIZE) { if (len < kSize) {
EXPECT_EQ(src[len], static_cast<char>(len)); EXPECT_EQ(src[len], static_cast<char>(len));
EXPECT_EQ(dst[len], static_cast<char>(255 - len)); EXPECT_EQ(dst[len], static_cast<char>(255 - len));
} }
...@@ -68,11 +68,11 @@ TEST(memcpy, main) { ...@@ -68,11 +68,11 @@ TEST(memcpy, main) {
testLen(len); testLen(len);
} }
for (size_t len = 128; len < SIZE; len += 128) { for (size_t len = 128; len < kSize; len += 128) {
testLen(len); testLen(len);
} }
for (size_t len = 128; len < SIZE; len += 73) { for (size_t len = 128; len < kSize; len += 73) {
testLen(len); testLen(len);
} }
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment