summaryrefslogtreecommitdiffstats
path: root/test/objcopy.c
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2020-01-07 22:33:43 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2020-01-07 22:33:43 (GMT)
commit6b6afd7a94802d88e662a1e264b304904e975965 (patch)
tree4a45a7c0c6d5c677f2128abc93a2eee2351abce9 /test/objcopy.c
parenta11b49fca2c068918ff1a6ebf560591435f9275f (diff)
parent7116d82f6b685261b5b4e64fada1a0a031cd7341 (diff)
downloadhdf5-6b6afd7a94802d88e662a1e264b304904e975965.zip
hdf5-6b6afd7a94802d88e662a1e264b304904e975965.tar.gz
hdf5-6b6afd7a94802d88e662a1e264b304904e975965.tar.bz2
Merging in latest from upstream (HDFFV/hdf5:refs/heads/hdf5_1_12)
* commit '7116d82f6b685261b5b4e64fada1a0a031cd7341': Remove mismerged code Cherry pick of 0225e6d5969 Cleanups from PR reviews Remove unnecessary H5CX call Refactor H5Dvlen_get_buf_size to use optional dataset operation, with generic fallback for VOL connectors that don't implement operation Refactor all the 'H5VL_*_optional' callbacks to move the type of operation out of the va_list, so it's at least possible for another connector to know what the operation is and decide whether to implement it or not. Update h5debug to retrieve file pointer through VOL framework
Diffstat (limited to 'test/objcopy.c')
-rw-r--r--test/objcopy.c47
1 files changed, 27 insertions, 20 deletions
diff --git a/test/objcopy.c b/test/objcopy.c
index 751fe72..cabdbfd 100644
--- a/test/objcopy.c
+++ b/test/objcopy.c
@@ -157,6 +157,7 @@ const char *FILENAME[] = {
#define NUM_SUB_GROUPS 20
#define NUM_WIDE_LOOP_GROUPS 10
#define NUM_DATASETS 10
+#define ATTR_CMPD_STRING "ThisIsAString"
char src_obj_full_name[215]; /* the full path + name of the object to be copied */
@@ -194,9 +195,9 @@ compare_attribute_compound_vlstr(hid_t loc, hid_t loc2);
*
* Purpose: Add an address to the table.
*
- * Return: void
+ * Return: void
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Saturday, November 5, 2005
*
*-------------------------------------------------------------------------
@@ -228,11 +229,10 @@ addr_insert(H5O_info_t *oi)
*
* Purpose: Check if address has already been encountered
*
- * Return: Success: TRUE/FALSE
- *
- * Failure: (can't fail)
+ * Return: Success: TRUE/FALSE
+ * Failure: (can't fail)
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Saturday, November 5, 2005
*
*-------------------------------------------------------------------------
@@ -257,9 +257,9 @@ addr_lookup(H5O_info_t *oi)
*
* Purpose: Reset the address tracking data structures
*
- * Return: void
+ * Return: void
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Saturday, November 5, 2005
*
*-------------------------------------------------------------------------
@@ -5784,7 +5784,8 @@ attach_attribute_compound_vlstr(hid_t loc_id)
int i;
char *v;
} s1;
- s1 buf; /* Buffer */
+ size_t len;
+ s1 buf = {0, NULL}; /* Buffer */
int ret_value = -1; /* Return value */
/* Create dataspace */
@@ -5814,8 +5815,11 @@ attach_attribute_compound_vlstr(hid_t loc_id)
goto done;
/* Write to the attribute */
+ len = HDstrlen(ATTR_CMPD_STRING) + 1;
buf.i = 9;
- buf.v = "ThisIsAString";
+ if(NULL == (buf.v = (char *)HDcalloc(len, sizeof(char))))
+ goto done;
+ HDstrncpy(buf.v, ATTR_CMPD_STRING, len);
if(H5Awrite(aid, cmpd_tid, &buf) < 0)
goto done;
@@ -5832,6 +5836,9 @@ done:
H5Tclose(cmpd_tid);
if(aid > 0)
H5Aclose(aid);
+
+ HDfree(buf.v);
+
return ret_value;
} /* attach_attribute_compound_vlstr */
@@ -11464,8 +11471,8 @@ error:
H5Tclose(f_tid);
H5Tclose(g_tid);
H5Tclose(anon_tid);
- H5Pclose(ocpypl_id);
- H5Aclose(aid);
+ H5Pclose(ocpypl_id);
+ H5Aclose(aid);
H5Dclose(did);
H5Sclose(sid);
H5Gclose(gid);
@@ -11704,14 +11711,14 @@ test_copy_cdt_merge_cdt(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t ds
error:
H5E_BEGIN_TRY {
- H5Pclose(ocpypl_id);
- H5Tclose(tid);
- H5Tclose(tid1);
- H5Tclose(tid2);
- H5Tclose(tid3);
- H5Tclose(tid4);
- H5Tclose(tid5);
- H5Aclose(aid);
+ H5Pclose(ocpypl_id);
+ H5Tclose(tid);
+ H5Tclose(tid1);
+ H5Tclose(tid2);
+ H5Tclose(tid3);
+ H5Tclose(tid4);
+ H5Tclose(tid5);
+ H5Aclose(aid);
H5Sclose(sid);
H5Fclose(fid_dst);
H5Fclose(fid_src);