summaryrefslogtreecommitdiffstats
path: root/test/unlink.c
diff options
context:
space:
mode:
authorAlbert Cheng <acheng@hdfgroup.org>2006-10-12 03:55:06 (GMT)
committerAlbert Cheng <acheng@hdfgroup.org>2006-10-12 03:55:06 (GMT)
commite065eee4a8932e6c09557bc539d6674138e9d7fe (patch)
tree794fd744c2d3b5efbc7523005c20ee9461f1cdff /test/unlink.c
parent9b24333b1944e5b5c37aeff0b94fabfbacb15b20 (diff)
downloadhdf5-e065eee4a8932e6c09557bc539d6674138e9d7fe.zip
hdf5-e065eee4a8932e6c09557bc539d6674138e9d7fe.tar.gz
hdf5-e065eee4a8932e6c09557bc539d6674138e9d7fe.tar.bz2
[svn-r12751] Purpose:
Bug fix (related to 544) Description: h5_get_file_size() was coded to return 0 if failed but file size can be 0. Changed the failure return value to -1 which is allowed by the returned type of off_t which is a signed type. Also changed the checking code of the stat call to just == 0 since that is how it is defined. Test: Could test it in heping only. Both Sol and Copper failed to compiled due to error in the Direct IO VFD code.
Diffstat (limited to 'test/unlink.c')
-rw-r--r--test/unlink.c44
1 files changed, 22 insertions, 22 deletions
diff --git a/test/unlink.c b/test/unlink.c
index cb66177..edb6b6c 100644
--- a/test/unlink.c
+++ b/test/unlink.c
@@ -549,7 +549,7 @@ test_filespace(hid_t fapl)
if(H5Fclose(file) < 0) TEST_ERROR
/* Get the size of an empty file */
- if((empty_size=h5_get_file_size(filename))==0) TEST_ERROR
+ if((empty_size=h5_get_file_size(filename))<0) TEST_ERROR
/* Create common objects for datasets */
@@ -606,7 +606,7 @@ test_filespace(hid_t fapl)
if(H5Fclose(file) < 0) TEST_ERROR
/* Get the size of the file */
- if((file_size=h5_get_file_size(filename))==0) TEST_ERROR
+ if((file_size=h5_get_file_size(filename))<0) TEST_ERROR
/* Verify the file is correct size */
if(file_size!=empty_size) TEST_ERROR
@@ -630,7 +630,7 @@ test_filespace(hid_t fapl)
if(H5Fclose(file) < 0) TEST_ERROR
/* Get the size of the file */
- if((file_size=h5_get_file_size(filename))==0) TEST_ERROR
+ if((file_size=h5_get_file_size(filename))<0) TEST_ERROR
/* Verify the file is correct size */
if(file_size!=empty_size) TEST_ERROR
@@ -654,7 +654,7 @@ test_filespace(hid_t fapl)
if(H5Fclose(file) < 0) TEST_ERROR
/* Get the size of the file */
- if((file_size=h5_get_file_size(filename))==0) TEST_ERROR
+ if((file_size=h5_get_file_size(filename))<0) TEST_ERROR
/* Verify the file is correct size */
if(file_size!=empty_size) TEST_ERROR
@@ -678,7 +678,7 @@ test_filespace(hid_t fapl)
if(H5Fclose(file) < 0) TEST_ERROR
/* Get the size of the file */
- if((file_size=h5_get_file_size(filename))==0) TEST_ERROR
+ if((file_size=h5_get_file_size(filename))<0) TEST_ERROR
/* Verify the file is correct size */
if(file_size!=empty_size) TEST_ERROR
@@ -702,7 +702,7 @@ test_filespace(hid_t fapl)
if(H5Fclose(file) < 0) TEST_ERROR
/* Get the size of the file */
- if((file_size=h5_get_file_size(filename))==0) TEST_ERROR
+ if((file_size=h5_get_file_size(filename))<0) TEST_ERROR
/* Verify the file is correct size */
if(file_size!=empty_size) TEST_ERROR
@@ -748,7 +748,7 @@ test_filespace(hid_t fapl)
if(H5Fclose(file) < 0) TEST_ERROR
/* Get the size of the file */
- if((file_size=h5_get_file_size(filename))==0) TEST_ERROR
+ if((file_size=h5_get_file_size(filename))<0) TEST_ERROR
/* Verify the file is correct size */
if(file_size!=empty_size) TEST_ERROR
@@ -772,7 +772,7 @@ test_filespace(hid_t fapl)
if(H5Fclose(file) < 0) TEST_ERROR
/* Get the size of the file */
- if((file_size=h5_get_file_size(filename))==0) TEST_ERROR
+ if((file_size=h5_get_file_size(filename))<0) TEST_ERROR
/* Verify the file is correct size */
if(file_size!=empty_size) TEST_ERROR
@@ -835,7 +835,7 @@ test_filespace(hid_t fapl)
if(H5Fclose(file) < 0) TEST_ERROR
/* Get the size of the file */
- if((file_size = h5_get_file_size(filename))==0) TEST_ERROR
+ if((file_size = h5_get_file_size(filename))<0) TEST_ERROR
/* Verify the file is correct size */
if(file_size!=empty_size) TEST_ERROR
@@ -862,7 +862,7 @@ test_filespace(hid_t fapl)
if(H5Fclose(file) < 0) TEST_ERROR
/* Get the size of the file */
- if((file_size=h5_get_file_size(filename))==0) TEST_ERROR
+ if((file_size=h5_get_file_size(filename))<0) TEST_ERROR
/* Verify the file is correct size */
if(file_size!=empty_size) TEST_ERROR
@@ -886,7 +886,7 @@ test_filespace(hid_t fapl)
if(H5Fclose(file) < 0) TEST_ERROR
/* Get the size of the file */
- if((file_size=h5_get_file_size(filename))==0) TEST_ERROR
+ if((file_size=h5_get_file_size(filename))<0) TEST_ERROR
/* Verify the file is correct size */
if(file_size!=empty_size) TEST_ERROR
@@ -917,7 +917,7 @@ test_filespace(hid_t fapl)
if(H5Fclose(file) < 0) TEST_ERROR
/* Get the size of the file */
- if((file_size = h5_get_file_size(filename)) == 0) TEST_ERROR
+ if((file_size = h5_get_file_size(filename)) < 0) TEST_ERROR
/* Verify the file is correct size */
if(file_size != empty_size) TEST_ERROR
@@ -946,7 +946,7 @@ test_filespace(hid_t fapl)
if(H5Fclose(file) < 0) TEST_ERROR
/* Get the size of the file */
- if((file_size=h5_get_file_size(filename))==0) TEST_ERROR
+ if((file_size=h5_get_file_size(filename))<0) TEST_ERROR
/* Verify the file is correct size */
if(file_size!=empty_size) TEST_ERROR
@@ -1027,7 +1027,7 @@ test_filespace(hid_t fapl)
if(H5Fclose(file) < 0) TEST_ERROR
/* Get the size of the file */
- if((file_size=h5_get_file_size(filename))==0) TEST_ERROR
+ if((file_size=h5_get_file_size(filename))<0) TEST_ERROR
/* Verify the file is correct size */
if(file_size!=empty_size) TEST_ERROR
@@ -1060,7 +1060,7 @@ test_filespace(hid_t fapl)
if(H5Fclose(file) < 0) TEST_ERROR
/* Get the size of the file */
- if((file_size=h5_get_file_size(filename))==0) TEST_ERROR
+ if((file_size=h5_get_file_size(filename))<0) TEST_ERROR
/* Verify the file is correct size */
if(file_size!=empty_size) TEST_ERROR
@@ -1093,7 +1093,7 @@ test_filespace(hid_t fapl)
if(H5Fclose(file) < 0) TEST_ERROR
/* Get the size of the file */
- if((file_size=h5_get_file_size(filename))==0) TEST_ERROR
+ if((file_size=h5_get_file_size(filename))<0) TEST_ERROR
/* Verify the file is correct size */
if(file_size!=empty_size) TEST_ERROR
@@ -1130,7 +1130,7 @@ test_filespace(hid_t fapl)
if(H5Fclose(file) < 0) TEST_ERROR
/* Get the size of the file */
- if((file_size=h5_get_file_size(filename))==0) TEST_ERROR
+ if((file_size=h5_get_file_size(filename))<0) TEST_ERROR
/* Verify the file is correct size */
if(file_size!=empty_size) TEST_ERROR
@@ -1179,7 +1179,7 @@ test_filespace(hid_t fapl)
if(H5Fclose(file) < 0) TEST_ERROR
/* Get the size of the file */
- if((file_size=h5_get_file_size(filename))==0) TEST_ERROR
+ if((file_size=h5_get_file_size(filename))<0) TEST_ERROR
/* Verify the file is correct size */
if(file_size!=empty_size) TEST_ERROR
@@ -2124,7 +2124,7 @@ test_full_group_compact(hid_t fapl)
if(H5Fclose(file_id) < 0) TEST_ERROR
/* Get the size of the file with only the objects to keep */
- if((keep_size = h5_get_file_size(filename)) == 0) TEST_ERROR
+ if((keep_size = h5_get_file_size(filename)) < 0) TEST_ERROR
/* Re-open the file */
if((file_id = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR
@@ -2188,7 +2188,7 @@ test_full_group_compact(hid_t fapl)
if(H5Fclose(file_id) < 0) TEST_ERROR
/* Get the size of the file */
- if((file_size = h5_get_file_size(filename)) == 0) TEST_ERROR
+ if((file_size = h5_get_file_size(filename)) < 0) TEST_ERROR
/* Verify the file is correct size */
if(file_size != keep_size) TEST_ERROR
@@ -2258,7 +2258,7 @@ test_full_group_dense(hid_t fapl)
if(H5Fclose(file_id) < 0) TEST_ERROR
/* Get the size of the file with only the objects to keep */
- if((keep_size = h5_get_file_size(filename)) == 0) TEST_ERROR
+ if((keep_size = h5_get_file_size(filename)) < 0) TEST_ERROR
/* Re-open the file */
if((file_id = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR
@@ -2335,7 +2335,7 @@ test_full_group_dense(hid_t fapl)
if(H5Fclose(file_id) < 0) TEST_ERROR
/* Get the size of the file */
- if((file_size = h5_get_file_size(filename)) == 0) TEST_ERROR
+ if((file_size = h5_get_file_size(filename)) < 0) TEST_ERROR
/* Verify the file is correct size */
if(file_size != keep_size) TEST_ERROR