test: fix memoryZeroed() in ULTs

first byte in the buffer was not checked what resulted in incorrect check
if memory was zeroed,

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
This commit is contained in:
Mateusz Hoppe
2023-02-22 15:45:07 +00:00
committed by Compute-Runtime-Automation
parent 2f5be7a48d
commit 6c2f5df6c3
2 changed files with 14 additions and 2 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2022 Intel Corporation
* Copyright (C) 2018-2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -42,7 +42,7 @@
inline bool memoryZeroed(const void *mem, const size_t size) {
size_t sizeLeft = (size_t)size;
bool memoryZeroed = true;
while (--sizeLeft) {
while (sizeLeft--) {
uint8_t *pMem = (uint8_t *)mem;
if (pMem[sizeLeft] != 0) {
memoryZeroed = false;