Message ID | 1471411974-8179-7-git-send-email-oohall@gmail.com |
---|---|
State | Accepted |
Headers | show |
diff --git a/core/test/run-nvram-format.c b/core/test/run-nvram-format.c index 2d0c2da56ace..b8ba69867c77 100644 --- a/core/test/run-nvram-format.c +++ b/core/test/run-nvram-format.c @@ -65,6 +65,12 @@ int main(void) nvram_image[0] = 0; assert(nvram_check(nvram_image,128*1024) != 0); + /* Does our NUL checking work? */ + assert(nvram_format(nvram_image, 128 * 1024) == 0); + h = (struct chrp_nvram_hdr *) nvram_image; + memset((char *) h + sizeof(*h), 0xFF, h->len * 16 - sizeof(*h)); + assert(nvram_check(nvram_image, 128 * 1024) != 0); + assert(nvram_format(nvram_image, 128*1024)==0); /* corrupt the length of the partition */ nvram_image[2] = 0;
Adds a test for nvram_check() that the ibm,skiboot nvram partition is correctly terminated. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> --- core/test/run-nvram-format.c | 6 ++++++ 1 file changed, 6 insertions(+)