tests/imd: Fix invalid NULL comparison on uintptr_t
Use 0 instead of NULL when testing or initializing uintptr_t fields, since NULL is only defined for pointers. "data.3.lzma.bin" file is regenerated using: util/cbfs-compression-tool compress file.bin /tmp/file.lzma.bin lzma dd if=/tmp/file.lzma.bin of=file.lzma.bin skip=8 ibs=1 Change-Id: Ia1e7cc5052e842c7ef97ec7cec34919bbe1e2228 Signed-off-by: Elyes Haouas <ehaouas@noos.fr> Reviewed-on: https://review.coreboot.org/c/coreboot/+/89356 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Jakub "Kuba" Czapiga <czapiga@google.com>
This commit is contained in:
parent
6d816b3b43
commit
16bf80b9b1
3 changed files with 3 additions and 3 deletions
|
|
@ -67,7 +67,7 @@ static void test_imd_handle_init(void **state)
|
|||
assert_ptr_equal(imd.lg.r, NULL);
|
||||
|
||||
/* Small allocations not initialized */
|
||||
assert_ptr_equal(imd.sm.limit, NULL);
|
||||
assert_ptr_equal(imd.sm.limit, 0);
|
||||
assert_ptr_equal(imd.sm.r, NULL);
|
||||
}
|
||||
}
|
||||
|
|
@ -234,7 +234,7 @@ static void test_imd_recover(void **state)
|
|||
const struct imd_entry *lg_entry;
|
||||
|
||||
/* Fail when the limit for lg was not set. */
|
||||
imd.lg.limit = (uintptr_t) NULL;
|
||||
imd.lg.limit = 0;
|
||||
assert_int_equal(-1, imd_recover(&imd));
|
||||
|
||||
/* Set the limit for lg. */
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -68,7 +68,7 @@ static void test_imd_handle_init(void **state)
|
|||
assert_ptr_equal(imd.lg.r, NULL);
|
||||
|
||||
/* Small allocations not initialized */
|
||||
assert_ptr_equal(imd.sm.limit, NULL);
|
||||
assert_ptr_equal(imd.sm.limit, 0);
|
||||
assert_ptr_equal(imd.sm.r, NULL);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue