summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2007-08-30 13:55:10 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2007-08-30 13:55:10 (GMT)
commitc50c23d387121f2acaf364fa3c1f5d407c4ffb43 (patch)
tree70719be38921637a74c90894d837973017bc68f0 /test
parent926a033b139974a8a9fd6ddec7150bcbdb556675 (diff)
downloadhdf5-c50c23d387121f2acaf364fa3c1f5d407c4ffb43.zip
hdf5-c50c23d387121f2acaf364fa3c1f5d407c4ffb43.tar.gz
hdf5-c50c23d387121f2acaf364fa3c1f5d407c4ffb43.tar.bz2
[svn-r14129] Description:
Add H5O{set|get}_comment routines, which were overlooked before. Move H5G{set|get}_comment routines to deprecated code section, replacing internal calls with H5O{set|get}_comment. Tested on: FreeBSD/32 6.2 (duty) FreeBSD/64 6.2 (liberty) Linux/32 2.6 (kagiso) Linux/64 2.6 (smirom) Solaris/32 5.10 (linew) AIX/32 5.3 (copper) Mac OS X/32 10.4.10 (amazon)
Diffstat (limited to 'test')
-rw-r--r--test/dsets.c4
-rw-r--r--test/links.c42
-rw-r--r--test/stab.c4
-rw-r--r--test/trefer.c8
-rw-r--r--test/tunicode.c8
5 files changed, 36 insertions, 30 deletions
diff --git a/test/dsets.c b/test/dsets.c
index d1c6e17..6469a5e 100644
--- a/test/dsets.c
+++ b/test/dsets.c
@@ -211,7 +211,7 @@ test_create(hid_t file)
if (H5Dclose(dataset) < 0) goto error;
/* Add a comment to the dataset */
- status = H5Gset_comment(file, DSET_DEFAULT_NAME, "This is a dataset");
+ status = H5Oset_comment(file, DSET_DEFAULT_NAME, "This is a dataset", H5P_DEFAULT);
if (status<0) goto error;
/*
@@ -6273,7 +6273,7 @@ main(void)
/* Cause the library to emit initial messages */
if((grp = H5Gcreate2(file, "emit diagnostics", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto error;
- if(H5Gset_comment(grp, ".", "Causes diagnostic messages to be emitted") < 0)
+ if(H5Oset_comment(grp, ".", "Causes diagnostic messages to be emitted", H5P_DEFAULT) < 0)
goto error;
if(H5Gclose(grp) < 0)
goto error;
diff --git a/test/links.c b/test/links.c
index 8e87ecc..fe3ea79 100644
--- a/test/links.c
+++ b/test/links.c
@@ -1493,6 +1493,11 @@ test_compat(hid_t fapl, hbool_t new_format)
if((group1_id = H5Gcreate2(file_id, "group1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
if((group2_id = H5Gcreate2(file_id, "group2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ /* Test H5Gset and get comment */
+ if(H5Gset_comment(file_id, "group1", "comment") < 0) FAIL_STACK_ERROR
+ if(H5Gget_comment(file_id, "group1", sizeof(linkval), linkval) < 0) FAIL_STACK_ERROR
+ if(HDstrcmp(linkval, "comment")) TEST_ERROR
+
/* Create links using H5Glink and H5Glink2 */
if(H5Glink(file_id, H5G_LINK_HARD, "group2", "group1/link_to_group2") < 0) FAIL_STACK_ERROR
if(H5Glink2(file_id, "group1", H5G_LINK_HARD, group2_id, "link_to_group1") < 0) FAIL_STACK_ERROR
@@ -3400,42 +3405,43 @@ external_link_closing(hid_t fapl, hbool_t new_format)
"elink/elink/elink/group1_moved", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
/* Open file 4 so we can do some fancy things */
- if((fid4 = H5Fopen(filename4, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR
+ if((fid4 = H5Fopen(filename4, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR
if(H5Lmove(fid1, "elink/elink/elink/type1", fid4,
- "type1_moved", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
+ "type1_moved", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
if(H5Lmove(fid4, "dataset1", fid1,
- "elink/elink/elink/dataset1_moved", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
+ "elink/elink/elink/dataset1_moved", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
/* Close file 4 again */
- if(H5Fclose(fid4) < 0) TEST_ERROR
+ if(H5Fclose(fid4) < 0) FAIL_STACK_ERROR
/* Test copy (as of this test, it uses the same code as move) */
if(H5Lcopy(fid1, "elink/elink/elink", fid1,
- "elink/elink/elink_copied", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
+ "elink/elink/elink_copied", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
if(H5Lcopy(fid1, "elink/elink/elink", fid1,
- "elink/elink/elink/elink_copied2", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
+ "elink/elink/elink/elink_copied2", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
/* Test H5Gset and get comment */
- if(H5Gset_comment(fid1, "elink/elink/elink/group1_moved", "comment") < 0) TEST_ERROR
- if(H5Gget_comment(fid1, "elink/elink/elink/group1_moved", sizeof(buf), buf) < 0) TEST_ERROR
+ if(H5Oset_comment(fid1, "elink/elink/elink/group1_moved", "comment", H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if(H5Oget_comment(fid1, "elink/elink/elink/group1_moved", buf, sizeof(buf), H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if(HDstrcmp(buf, "comment")) TEST_ERROR
/* Test H5*open */
if((gid = H5Gopen2(fid1, "elink/elink/elink/group1_moved", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if((tid = H5Topen(fid1, "elink/elink/elink/type1_moved")) < 0) TEST_ERROR
- if((did = H5Dopen(fid1, "elink/elink/elink/dataset1_moved")) < 0) TEST_ERROR
+ if((tid = H5Topen(fid1, "elink/elink/elink/type1_moved")) < 0) FAIL_STACK_ERROR
+ if((did = H5Dopen(fid1, "elink/elink/elink/dataset1_moved")) < 0) FAIL_STACK_ERROR
/* Close objects */
- if(H5Gclose(gid) < 0) TEST_ERROR
- if(H5Tclose(tid) < 0) TEST_ERROR
- if(H5Dclose(did) < 0) TEST_ERROR
+ if(H5Gclose(gid) < 0) FAIL_STACK_ERROR
+ if(H5Tclose(tid) < 0) FAIL_STACK_ERROR
+ if(H5Dclose(did) < 0) FAIL_STACK_ERROR
/* Test H5*open2 */
if((gid = H5Gopen2(fid1, "elink/elink/elink/group1_moved", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if((tid = H5Topen2(fid1, "elink/elink/elink/type1_moved", H5P_DEFAULT)) < 0) TEST_ERROR
- if((did = H5Dopen2(fid1, "elink/elink/elink/dataset1_moved", H5P_DEFAULT)) < 0) TEST_ERROR
+ if((tid = H5Topen2(fid1, "elink/elink/elink/type1_moved", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if((did = H5Dopen2(fid1, "elink/elink/elink/dataset1_moved", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
/* Close objects */
- if(H5Gclose(gid) < 0) TEST_ERROR
- if(H5Tclose(tid) < 0) TEST_ERROR
- if(H5Dclose(did) < 0) TEST_ERROR
+ if(H5Gclose(gid) < 0) FAIL_STACK_ERROR
+ if(H5Tclose(tid) < 0) FAIL_STACK_ERROR
+ if(H5Dclose(did) < 0) FAIL_STACK_ERROR
/* Test H5Oopen */
if((did = H5Oopen(fid1, "elink/elink/elink/dataset1_moved", H5P_DEFAULT)) < 0) TEST_ERROR
diff --git a/test/stab.c b/test/stab.c
index 2aed346..e3cfa57 100644
--- a/test/stab.c
+++ b/test/stab.c
@@ -111,7 +111,7 @@ test_misc(hid_t fapl, hbool_t new_format)
if((g1 = H5Gcreate2(fid, "test_1a", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
if((g2 = H5Gcreate2(g1, "sub_1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
if((g3 = H5Gcreate2(fid, "test_1b", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
- if(H5Gset_comment(g3, ".", "hello world") < 0) TEST_ERROR
+ if(H5Oset_comment(g3, ".", "hello world", H5P_DEFAULT) < 0) TEST_ERROR
if(H5Gclose(g1) < 0) TEST_ERROR
if(H5Gclose(g2) < 0) TEST_ERROR
if(H5Gclose(g3) < 0) TEST_ERROR
@@ -120,7 +120,7 @@ test_misc(hid_t fapl, hbool_t new_format)
if((g1 = H5Gopen2(fid, "/test_1a", H5P_DEFAULT)) < 0) TEST_ERROR
if((g2 = H5Gopen2(fid, "/test_1a/sub_1", H5P_DEFAULT)) < 0) TEST_ERROR
if((g3 = H5Gopen2(fid, "/test_1b", H5P_DEFAULT)) < 0) TEST_ERROR
- if(H5Gget_comment(g3, "././.", sizeof comment, comment) < 0) TEST_ERROR
+ if(H5Oget_comment(g3, "././.", comment, sizeof comment, H5P_DEFAULT) < 0) TEST_ERROR
if(HDstrcmp(comment, "hello world")) {
H5_FAILED();
puts(" Read the wrong comment string from the group.");
diff --git a/test/trefer.c b/test/trefer.c
index 14fc184..6ea69fd 100644
--- a/test/trefer.c
+++ b/test/trefer.c
@@ -110,8 +110,8 @@ test_reference_obj(void)
CHECK(group, FAIL, "H5Gcreate2");
/* Set group's comment */
- ret=H5Gset_comment(group,".",write_comment);
- CHECK(ret, FAIL, "H5Gset_comment");
+ ret=H5Oset_comment(group, ".", write_comment, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Oset_comment");
/* Create a dataset (inside Group1) */
dataset=H5Dcreate(group,"Dataset1",H5T_NATIVE_UINT,sid1,H5P_DEFAULT);
@@ -245,8 +245,8 @@ test_reference_obj(void)
CHECK(group, FAIL, "H5Rdereference");
/* Get group's comment */
- ret = H5Gget_comment(group, ".", (size_t)10, read_comment);
- CHECK(ret, FAIL, "H5Gget_comment");
+ ret = H5Oget_comment(group, ".", read_comment, (size_t)10, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Oget_comment");
/* Check for correct comment value */
if(HDstrcmp(write_comment, read_comment) != 0)
diff --git a/test/tunicode.c b/test/tunicode.c
index b959da1..788c8a3 100644
--- a/test/tunicode.c
+++ b/test/tunicode.c
@@ -397,10 +397,10 @@ void test_objnames(hid_t fid, const char* string)
/* Set a comment on the group to test that we can access the group
* Also test that UTF-8 comments can be read.
*/
- ret = H5Gset_comment(fid, string, string);
- CHECK(ret, FAIL, "H5Gset_comment");
- ret = H5Gget_comment(fid, string, (size_t)MAX_STRING_LENGTH, read_buf);
- CHECK(ret, FAIL, "H5Gget_comment");
+ ret = H5Oset_comment(fid, string, string, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Oset_comment");
+ ret = H5Oget_comment(fid, string, read_buf, (size_t)MAX_STRING_LENGTH, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Oget_comment");
ret = H5Gclose(grp_id);
CHECK(ret, FAIL, "H5Gclose");