DataBlockFixture creates data that is independent from its size
This commit is contained in:
parent
0e91d06a6f
commit
3b06dec1f2
@ -20,11 +20,13 @@ void DataBlockFixture::fillFileWithRandomData(long long int IV) {
|
||||
val += 1442695040888963407;
|
||||
reinterpret_cast<long long int*>(_fileData)[i] = val;
|
||||
}
|
||||
uint64_t alreadyWritten = (_size/sizeof(long long int))*sizeof(long long int);
|
||||
val *= 6364136223846793005L;
|
||||
val += 1442695040888963407;
|
||||
char *remainingBytes = reinterpret_cast<char*>(&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<char*>(_fileData)[i] = val;
|
||||
for(size_t i=0; i<_size-alreadyWritten; ++i) {
|
||||
reinterpret_cast<char*>(_fileData)[alreadyWritten + i] = remainingBytes[i];
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user