From eb14ef75b7615385bf10b92dcae56e8c7875a689 Mon Sep 17 00:00:00 2001 From: Stewart Smith Date: Wed, 24 Jun 2015 17:47:00 +1000 Subject: add test for nvram free space partition name Signed-off-by: Stewart Smith --- core/test/run-nvram-format.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'core') diff --git a/core/test/run-nvram-format.c b/core/test/run-nvram-format.c index 77b759b..2d0c2da 100644 --- a/core/test/run-nvram-format.c +++ b/core/test/run-nvram-format.c @@ -20,15 +20,10 @@ int main(void) { - char *nvram_image = malloc(0x100000); + char *nvram_image; size_t sz; struct chrp_nvram_hdr *h; - assert(nvram_format(nvram_image, 0x100000) == 0); - assert(nvram_check(nvram_image, 0x100000) == 0); - - free(nvram_image); - /* 1024 bytes is too small for our NVRAM */ nvram_image = malloc(1024); assert(nvram_format(nvram_image, 1024)!=0); @@ -57,6 +52,8 @@ int main(void) assert(nvram_check(nvram_image, sz)==0); assert(nvram_image[sz-13]==0); assert(nvram_image[sz-14]==1); + h = (struct chrp_nvram_hdr*)(&nvram_image[NVRAM_SIZE_COMMON + NVRAM_SIZE_FW_PRIV]); + assert(memcmp(h->name, "wwwwwwwwwwww", 12)==0); free(nvram_image); /* 128k NVRAM check */ -- cgit v1.1