Initialize memory in new DoAppendIfFits unit test (#8324)

This commit is contained in:
Andrew Noyes 2022-09-26 13:46:20 -07:00 committed by GitHub
parent b7fc2f1e5c
commit 7827535ffd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -35,6 +35,8 @@ TEST_CASE("/Atomic/DoAppendIfFits") {
{
Value existingValue = makeString(CLIENT_KNOBS->VALUE_SIZE_LIMIT - 1, arena);
Value otherOperand = makeString(2, arena);
deterministicRandom()->randomBytes(mutateString(existingValue), existingValue.size());
deterministicRandom()->randomBytes(mutateString(otherOperand), otherOperand.size());
// Appended values cannot fit in result, should return existingValue
auto result = doAppendIfFits(existingValue, otherOperand, arena);
ASSERT(compare(existingValue, result) == 0);