diff options
author | Stewart Smith <stewart@linux.vnet.ibm.com> | 2015-06-24 17:47:00 +1000 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2015-06-24 17:47:59 +1000 |
commit | eb14ef75b7615385bf10b92dcae56e8c7875a689 (patch) | |
tree | fd3ad7294af4994c70dc6734220eca11be76027a /core/test | |
parent | 7bcbf364a3c2dc9645ece54820be5f54e0c84af1 (diff) | |
download | skiboot-eb14ef75b7615385bf10b92dcae56e8c7875a689.zip skiboot-eb14ef75b7615385bf10b92dcae56e8c7875a689.tar.gz skiboot-eb14ef75b7615385bf10b92dcae56e8c7875a689.tar.bz2 |
add test for nvram free space partition name
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'core/test')
-rw-r--r-- | core/test/run-nvram-format.c | 9 |
1 files changed, 3 insertions, 6 deletions
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 */ |