Fix shadowed variable improperly scoped

These variables were outside of the function that used them. Every other
function that set the "size" variable was shadowing the improperly
scoped variables.

Change-Id: I45b20606492987c7a09105c33847bc5b35b9e0ec
Signed-off-by: John Edward Broadbent <jebr@google.com>
diff --git a/src/test/erase/pattern_test.cpp b/src/test/erase/pattern_test.cpp
index 2e2ac81..b379f59 100644
--- a/src/test/erase/pattern_test.cpp
+++ b/src/test/erase/pattern_test.cpp
@@ -95,17 +95,14 @@
     EXPECT_THROW(pass.verifyPattern(size, readFd), InternalFailure);
 }
 
-uint64_t size = 4096;
-size_t shortSize = 128;
-static auto shortData1 = std::vector<std::byte>(shortSize);
-static auto shortData2 = std::vector<std::byte>(shortSize);
-static auto restOfData = std::vector<std::byte>(size - shortSize * 2);
-
 TEST(pattern, shortReadWritePass)
 {
     std::string testFileName = "testfile_shortRead";
-
     uint64_t size = 4096;
+    size_t shortSize = 128;
+    static auto shortData1 = std::vector<std::byte>(shortSize);
+    static auto shortData2 = std::vector<std::byte>(shortSize);
+    static auto restOfData = std::vector<std::byte>(size - shortSize * 2);
     Pattern pass(testFileName);
     stdplus::fd::FdMock mock;