Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up tests #4724

Merged
merged 1 commit into from
Aug 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 13 additions & 12 deletions test/trefer.c
Original file line number Diff line number Diff line change
Expand Up @@ -618,21 +618,22 @@ test_reference_obj(void)

/* Check file name for reference */
namelen = H5Rget_file_name(&rbuf[0], NULL, 0);
CHECK(namelen, FAIL, "H5Dget_file_name");
VERIFY(namelen, strlen(FILE_REF_OBJ), "H5Dget_file_name");
CHECK(namelen, FAIL, "H5Rget_file_name");
VERIFY(namelen, strlen(FILE_REF_OBJ), "H5Rget_file_name");

/* Make sure size parameter is ignored */
namelen = H5Rget_file_name(&rbuf[0], NULL, 200);
CHECK(namelen, FAIL, "H5Dget_file_name");
VERIFY(namelen, strlen(FILE_REF_OBJ), "H5Dget_file_name");
CHECK(namelen, FAIL, "H5Rget_file_name");
VERIFY(namelen, strlen(FILE_REF_OBJ), "H5Rget_file_name");

/* Get the file name for the reference */
namebuf = (char *)malloc((size_t)namelen + 1);
namelen = H5Rget_file_name(&rbuf[0], (char *)namebuf, (size_t)namelen + 1);
CHECK(namelen, FAIL, "H5Dget_file_name");
namelen = H5Rget_file_name(&rbuf[0], namebuf, (size_t)namelen + 1);
CHECK(namelen, FAIL, "H5Rget_file_name");
VERIFY(strcmp(namebuf, FILE_REF_OBJ), 0, "namebuf vs FILE_REF_OBJ");
VERIFY(namelen, strlen(FILE_REF_OBJ), "H5Rget_file_name");

ret = !((strcmp(namebuf, FILE_REF_OBJ) == 0) && (namelen == strlen(FILE_REF_OBJ)));
CHECK(ret, FAIL, "H5Literate");
free(namebuf);

/* Testing Dataset1 */

Expand All @@ -644,7 +645,8 @@ test_reference_obj(void)
namebuf = (char *)malloc((size_t)namelen + 1);
namelen = H5Rget_obj_name(&rbuf[0], H5P_DEFAULT, namebuf, (size_t)namelen + 1);
CHECK(namelen, FAIL, "H5Rget_obj_name");
VERIFY(strcmp(namebuf, DS1_REF_OBJ), 0, "strcmp namebuf vs DS1_REF_OBJ");
VERIFY(strcmp(namebuf, DS1_REF_OBJ), 0, "namebuf vs DS1_REF_OBJ");
VERIFY(namelen, strlen(DS1_REF_OBJ), "H5Rget_obj_name");

/* Open dataset object */
ref_ds1 = H5Ropen_object(&rbuf[0], H5P_DEFAULT, dapl_id);
Expand Down Expand Up @@ -697,13 +699,12 @@ test_reference_obj(void)

/* Getting the name of the referenced object and verify it */
namelen = H5Rget_obj_name(&rbuf[1], H5P_DEFAULT, NULL, 0);
CHECK(namelen, FAIL, "H5Rget_obj_name");
VERIFY(namelen, strlen(DS2_REF_OBJ), "H5Rget_obj_name");

namebuf = (char *)malloc((size_t)namelen + 1);
namelen = H5Rget_obj_name(&rbuf[1], H5P_DEFAULT, namebuf, (size_t)namelen + 1);
CHECK(namelen, FAIL, "H5Rget_obj_name");
VERIFY(strcmp(namebuf, DS2_REF_OBJ), 0, "strcmp namebuf vs DS2_REF_OBJ");
VERIFY(namelen, strlen(DS2_REF_OBJ), "H5Rget_obj_name");
VERIFY(strcmp(namebuf, DS2_REF_OBJ), 0, "namebuf vs DS2_REF_OBJ");

/* Open dataset object */
ref_ds2 = H5Ropen_object(&rbuf[1], H5P_DEFAULT, dapl_id);
Expand Down
Loading