summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2007-02-09 15:32:51 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2007-02-09 15:32:51 (GMT)
commit140c0c9db2992989b9a0cb6b20589efdcc9c2184 (patch)
tree2ab5ed56ffc92f8fdeb335743385a907de865f49 /test
parent487d82bf58a1a8795343512c17a8b5a8428bdcd9 (diff)
downloadhdf5-140c0c9db2992989b9a0cb6b20589efdcc9c2184.zip
hdf5-140c0c9db2992989b9a0cb6b20589efdcc9c2184.tar.gz
hdf5-140c0c9db2992989b9a0cb6b20589efdcc9c2184.tar.bz2
[svn-r13274] Description:
Relax restriction on the "location ID" for attribute operations to allow file IDs to be used as the location ID. If a file ID is used, the attribute operations will occur on the file's root group. Tested on: FreeBSD/32 6.2 (duty)
Diffstat (limited to 'test')
-rw-r--r--test/tattr.c31
1 files changed, 27 insertions, 4 deletions
diff --git a/test/tattr.c b/test/tattr.c
index b95c9f0..a444ea5 100644
--- a/test/tattr.c
+++ b/test/tattr.c
@@ -164,9 +164,31 @@ test_attr_basic_write(hid_t fapl)
sid2 = H5Screate_simple(ATTR1_RANK, dims2, NULL);
CHECK(sid2, FAIL, "H5Screate_simple");
- /* Try to create an attribute on the file (should fail) */
- ret=H5Acreate(fid1,ATTR1_NAME,H5T_NATIVE_INT,sid2,H5P_DEFAULT);
- VERIFY(ret, FAIL, "H5Acreate");
+
+ /* Try to create an attribute on the file (should create an attribute on root group) */
+ attr = H5Acreate(fid1, ATTR1_NAME, H5T_NATIVE_INT, sid2, H5P_DEFAULT);
+ CHECK(attr, FAIL, "H5Acreate");
+
+ /* Close attribute */
+ ret = H5Aclose(attr);
+ CHECK(ret, FAIL, "H5Aclose");
+
+ /* Open the root group */
+ group = H5Gopen(fid1, "/");
+ CHECK(group, FAIL, "H5Gopen");
+
+ /* Open attribute again */
+ attr = H5Aopen_name(group, ATTR1_NAME);
+ CHECK(attr, FAIL, "H5Aopen_name");
+
+ /* Close attribute */
+ ret = H5Aclose(attr);
+ CHECK(ret, FAIL, "H5Aclose");
+
+ /* Close root group */
+ ret = H5Gclose(group);
+ CHECK(ret, FAIL, "H5Gclose");
+
/* Create an attribute for the dataset */
attr=H5Acreate(dataset,ATTR1_NAME,H5T_NATIVE_INT,sid2,H5P_DEFAULT);
@@ -384,7 +406,8 @@ test_attr_basic_read(hid_t fapl)
CHECK(ret, FAIL, "H5Dclose");
/* Open the group */
- group=H5Gopen(fid1,GROUP1_NAME);
+ group = H5Gopen(fid1,GROUP1_NAME);
+ CHECK(group, FAIL, "H5Gopen");
/* Verify the correct number of attributes */
ret=H5Aget_num_attrs(group);