summaryrefslogtreecommitdiffstats
path: root/test/tvlstr.c
diff options
context:
space:
mode:
authorRaymond Lu <songyulu@hdfgroup.org>2002-11-18 16:38:11 (GMT)
committerRaymond Lu <songyulu@hdfgroup.org>2002-11-18 16:38:11 (GMT)
commit0105a3b97cabccd3463c82c22da7e3f4d23c2b05 (patch)
tree9b0002e531446227f62b929adba84b9bfbcacc8a /test/tvlstr.c
parent02fe47462b798e7f212f09fe65f022965ce4b365 (diff)
downloadhdf5-0105a3b97cabccd3463c82c22da7e3f4d23c2b05.zip
hdf5-0105a3b97cabccd3463c82c22da7e3f4d23c2b05.tar.gz
hdf5-0105a3b97cabccd3463c82c22da7e3f4d23c2b05.tar.bz2
[svn-r6099]
Purpose: bug fix. Description: h5dump cannot dump data and datatype for VL string. Platforms tested: eirene, arabica Misc. update: MANIFEST, RELEASE.txt
Diffstat (limited to 'test/tvlstr.c')
-rw-r--r--test/tvlstr.c32
1 files changed, 27 insertions, 5 deletions
diff --git a/test/tvlstr.c b/test/tvlstr.c
index 9d31f2d..91bf47a 100644
--- a/test/tvlstr.c
+++ b/test/tvlstr.c
@@ -239,13 +239,17 @@ static void test_vlstring_type(void)
H5T_cset_t cset;
H5T_str_t pad;
herr_t ret;
+ size_t size;
/* Output message about test being performed */
MESSAGE(5, ("Testing VL String type\n"));
/* Create file */
- fid = H5Fcreate(DATAFILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
- CHECK(fid, FAIL, "H5Fcreate");
+ /*fid = H5Fcreate(DATAFILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(fid, FAIL, "H5Fcreate");*/
+
+ fid = H5Fopen(DATAFILE, H5F_ACC_RDWR, H5P_DEFAULT);
+ CHECK(fid, FAIL, "H5Fopen");
/* Create a datatype to refer to */
tid_vlstr = H5Tcopy(H5T_C_S1);
@@ -280,8 +284,20 @@ static void test_vlstring_type(void)
/* Close datatype */
ret = H5Tclose(tid_vlstr);
CHECK(ret, FAIL, "H5Tclose");
+
+ tid_vlstr = H5Topen(fid, VLSTR_TYPE);
+ CHECK(tid_vlstr, FAIL, "H5Topen");
+
+ ret = H5Tclose(tid_vlstr);
+ CHECK(ret, FAIL, "H5Tclose");
+
+ ret = H5Fclose(fid);
+ CHECK(ret, FAIL, "H5Fclose");
+ fid = H5Fopen(DATAFILE, H5F_ACC_RDWR, H5P_DEFAULT);
+ CHECK(fid, FAIL, "H5Fopen");
+
/* Open the variable-length string datatype just created */
tid_vlstr = H5Topen(fid, VLSTR_TYPE);
CHECK(tid_vlstr, FAIL, "H5Topen");
@@ -313,8 +329,8 @@ static void test_write_vl_string_attribute(void)
herr_t ret;
char *string_att_check;
- file = H5Fcreate(DATAFILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
- CHECK(file, FAIL, "H5Fcreate");
+ file = H5Fopen(DATAFILE, H5F_ACC_RDWR, H5P_DEFAULT);
+ CHECK(file, FAIL, "H5Fopen");
/* Create a datatype to refer to. */
type = H5Tcopy (H5T_C_S1);
@@ -375,6 +391,9 @@ static void test_read_vl_string_attribute(void)
hid_t type;
herr_t ret;
char *string_att_check;
+ hsize_t size[64];
+ hid_t space;
+ int ndims;
file = H5Fopen(DATAFILE, H5F_ACC_RDONLY, H5P_DEFAULT);
CHECK(file, FAIL, "H5Fopen");
@@ -391,6 +410,9 @@ static void test_read_vl_string_attribute(void)
att = H5Aopen_name(root, "test_scalar");
CHECK(att, FAIL, "H5Aopen_name");
+
+ space = H5Aget_space(att);
+ ndims = H5Sget_simple_extent_dims(space, size, NULL);
ret = H5Aread(att, type, &string_att_check);
CHECK(ret, FAIL, "H5Aread");
@@ -433,7 +455,7 @@ test_vlstrings(void)
test_vlstrings_basic();
test_vlstring_type();
- /* Test using VL strings in attributes */
+ /*Test using VL strings in attributes */
test_write_vl_string_attribute();
test_read_vl_string_attribute();
} /* test_vlstrings() */