Fix MSVC14 warning spam in tests

Microsoft Visual C++ 14 has new variable shadowing warnings. The test output is full of
"warning C4456: declaration of 'i' hides previous local declaration".