diff --git a/test/testutils/DataBlockFixture.cpp b/test/testutils/DataBlockFixture.cpp index 5fdb3a0a..252015b2 100644 --- a/test/testutils/DataBlockFixture.cpp +++ b/test/testutils/DataBlockFixture.cpp @@ -1,4 +1,4 @@ -#include +#include "DataBlockFixture.h" #include #include @@ -20,11 +20,13 @@ void DataBlockFixture::fillFileWithRandomData(long long int IV) { val += 1442695040888963407; reinterpret_cast(_fileData)[i] = val; } + uint64_t alreadyWritten = (_size/sizeof(long long int))*sizeof(long long int); + val *= 6364136223846793005L; + val += 1442695040888963407; + char *remainingBytes = reinterpret_cast(&val); //Fill remaining bytes - for(size_t i=(_size/sizeof(long long int))*sizeof(long long int); i<_size; ++i) { - val *= 6364136223846793005L; - val += 1442695040888963407; - reinterpret_cast(_fileData)[i] = val; + for(size_t i=0; i<_size-alreadyWritten; ++i) { + reinterpret_cast(_fileData)[alreadyWritten + i] = remainingBytes[i]; } }