summaryrefslogtreecommitdiffstats
path: root/test/file_image.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/file_image.c')
-rw-r--r--test/file_image.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/test/file_image.c b/test/file_image.c
index 73c901e..9d7a48c 100644
--- a/test/file_image.c
+++ b/test/file_image.c
@@ -86,15 +86,16 @@ typedef struct {
static int
test_properties(void)
{
- hid_t fapl_1;
- hid_t fapl_2;
- char *buffer;
+ hid_t fapl_1 = -1;
+ hid_t fapl_2 = -1;
+ char *buffer = 0;
int count = 10;
- void *temp;
- char *temp2;
+ void *temp = 0;
+ char *temp2 = 0;
int i;
size_t size;
size_t temp_size;
+ int retval = 1;
TESTING("File image property list functions");
@@ -145,18 +146,21 @@ test_properties(void)
VERIFY(temp2 != temp, "Retrieved buffer is the same as previously retrieved buffer");
VERIFY(0 == HDmemcmp(temp2, buffer, size),"Buffers contain different data");
+ retval = 0;
+
+error:
+
/* Close everything */
- if(H5Pclose(fapl_1) < 0) FAIL_STACK_ERROR
- if(H5Pclose(fapl_2) < 0) FAIL_STACK_ERROR
+ if(H5Pclose(fapl_1) < 0) retval = 1;
+ if(H5Pclose(fapl_2) < 0) retval = 1;
HDfree(buffer);
HDfree(temp);
HDfree(temp2);
- PASSED();
- return 0;
+ if(retval == 0)
+ PASSED();
-error:
- return 1;
+ return retval;
} /* end test_properties() */
/******************************************************************************