diff options
author | Stewart Smith <stewart@linux.vnet.ibm.com> | 2014-12-19 13:54:47 +1100 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2014-12-19 13:54:47 +1100 |
commit | d93c709f7dcba03aedc55f740098a6a32cef473d (patch) | |
tree | e9e22d5d802fd46df41d187582b0c7e3e3ff8048 /core | |
parent | 84412fdfdf9a6223ff480ab78130856ed3bf65c9 (diff) | |
download | talos-skiboot-d93c709f7dcba03aedc55f740098a6a32cef473d.tar.gz talos-skiboot-d93c709f7dcba03aedc55f740098a6a32cef473d.zip |
Increase test coverage of pel test
Cover pel buffer too small case in create_pel_log
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'core')
-rw-r--r-- | core/pel.c | 2 | ||||
-rw-r--r-- | core/test/run-pel.c | 6 |
2 files changed, 6 insertions, 2 deletions
@@ -237,7 +237,7 @@ int create_pel_log(struct errorlog *elog_data, char *pel_buffer, int pel_offset = 0; if (pel_buffer_size < pel_size(elog_data)) { - prerror("PEL buffer too small to create record"); + prerror("PEL buffer too small to create record\n"); return 0; } diff --git a/core/test/run-pel.c b/core/test/run-pel.c index 40aa3746..7087d64f 100644 --- a/core/test/run-pel.c +++ b/core/test/run-pel.c @@ -74,7 +74,11 @@ int main(void) elog->elog_origin = ORG_SAPPHIRE; size = pel_size(elog); - printf("PEL Size: %ld\n", size); + + printf("Test buffer too small: "); + assert(0 == create_pel_log(elog, NULL, size - 1)); + + assert(size <= PEL_MIN_SIZE + 4); assert(size == create_pel_log(elog, pel_buf, size)); return 0; |