summaryrefslogtreecommitdiffstats
path: root/c++
diff options
context:
space:
mode:
Diffstat (limited to 'c++')
-rw-r--r--c++/test/tcompound.cpp56
1 files changed, 28 insertions, 28 deletions
diff --git a/c++/test/tcompound.cpp b/c++/test/tcompound.cpp
index 28d8a1e..6ae3f82 100644
--- a/c++/test/tcompound.cpp
+++ b/c++/test/tcompound.cpp
@@ -122,9 +122,9 @@ static void test_compound_2()
SUBTEST("Compound Element Reordering");
try {
// Sizes should be the same, but be careful just in case
- buf = (unsigned char*)malloc(nelmts * MAX(sizeof(src_typ_t), sizeof(dst_typ_t)));
- bkg = (unsigned char*)malloc(nelmts * sizeof(dst_typ_t));
- orig = (unsigned char*)malloc(nelmts * sizeof(src_typ_t));
+ buf = (unsigned char*)HDmalloc(nelmts * MAX(sizeof(src_typ_t), sizeof(dst_typ_t)));
+ bkg = (unsigned char*)HDmalloc(nelmts * sizeof(dst_typ_t));
+ orig = (unsigned char*)HDmalloc(nelmts * sizeof(src_typ_t));
for (i=0; i<nelmts; i++) {
s_ptr = ((src_typ_t*)orig) + i;
s_ptr->a = i*8+0;
@@ -190,9 +190,9 @@ static void test_compound_2()
}
}
// Release resources
- free(buf);
- free(bkg);
- free(orig);
+ HDfree(buf);
+ HDfree(bkg);
+ HDfree(orig);
s_ptr = NULL;
d_ptr = NULL;
st.close();
@@ -247,9 +247,9 @@ static void test_compound_3()
SUBTEST("Compound Datatype Subset Conversions");
try {
/* Initialize */
- buf = (unsigned char*)malloc(nelmts * MAX(sizeof(src_typ_t), sizeof(dst_typ_t)));
- bkg = (unsigned char*)malloc(nelmts * sizeof(dst_typ_t));
- orig = (unsigned char*)malloc(nelmts * sizeof(src_typ_t));
+ buf = (unsigned char*)HDmalloc(nelmts * MAX(sizeof(src_typ_t), sizeof(dst_typ_t)));
+ bkg = (unsigned char*)HDmalloc(nelmts * sizeof(dst_typ_t));
+ orig = (unsigned char*)HDmalloc(nelmts * sizeof(src_typ_t));
for (i=0; i<nelmts; i++) {
s_ptr = ((src_typ_t*)orig) + i;
s_ptr->a = i*8+0;
@@ -312,9 +312,9 @@ static void test_compound_3()
} // for
/* Release resources */
- free(buf);
- free(bkg);
- free(orig);
+ HDfree(buf);
+ HDfree(bkg);
+ HDfree(orig);
s_ptr = NULL;
d_ptr = NULL;
st.close();
@@ -374,9 +374,9 @@ static void test_compound_4()
SUBTEST("Compound Element Shrinking & Reordering");
try {
/* Sizes should be the same, but be careful just in case */
- buf = (unsigned char*)malloc(nelmts * MAX(sizeof(src_typ_t), sizeof(dst_typ_t)));
- bkg = (unsigned char*)malloc(nelmts * sizeof(dst_typ_t));
- orig = (unsigned char*)malloc(nelmts * sizeof(src_typ_t));
+ buf = (unsigned char*)HDmalloc(nelmts * MAX(sizeof(src_typ_t), sizeof(dst_typ_t)));
+ bkg = (unsigned char*)HDmalloc(nelmts * sizeof(dst_typ_t));
+ orig = (unsigned char*)HDmalloc(nelmts * sizeof(src_typ_t));
for (i=0; i<nelmts; i++) {
s_ptr = ((src_typ_t*)orig) + i;
s_ptr->a = i*8+0;
@@ -444,9 +444,9 @@ static void test_compound_4()
} // for
/* Release resources */
- free(buf);
- free(bkg);
- free(orig);
+ HDfree(buf);
+ HDfree(bkg);
+ HDfree(orig);
s_ptr = NULL;
d_ptr = NULL;
st.close();
@@ -499,8 +499,8 @@ static void test_compound_5()
src_typ_t src[2] = {{"one", 102, {104, 105, 106, 107}},
{"two", 202, {204, 205, 206, 207}}};
dst_typ_t *dst;
- void *buf = calloc(2, sizeof(dst_typ_t));
- void *bkg = calloc(2, sizeof(dst_typ_t));
+ void *buf = HDcalloc(2, sizeof(dst_typ_t));
+ void *bkg = HDcalloc(2, sizeof(dst_typ_t));
ArrayType* array_dt = NULL;
// Output message about test being performed
@@ -552,8 +552,8 @@ static void test_compound_5()
{ H5_FAILED(); }
/* Free memory buffers */
- free(buf);
- free(bkg);
+ HDfree(buf);
+ HDfree(bkg);
dst = NULL;
PASSED();
} // end of try block
@@ -606,9 +606,9 @@ static void test_compound_6()
SUBTEST("Compound Element Growing");
try {
/* Sizes should be the same, but be careful just in case */
- buf = (unsigned char*)malloc(nelmts * MAX(sizeof(src_typ_t), sizeof(dst_typ_t)));
- bkg = (unsigned char*)malloc(nelmts * sizeof(dst_typ_t));
- orig = (unsigned char*)malloc(nelmts * sizeof(src_typ_t));
+ buf = (unsigned char*)HDmalloc(nelmts * MAX(sizeof(src_typ_t), sizeof(dst_typ_t)));
+ bkg = (unsigned char*)HDmalloc(nelmts * sizeof(dst_typ_t));
+ orig = (unsigned char*)HDmalloc(nelmts * sizeof(src_typ_t));
for (i=0; i<nelmts; i++) {
s_ptr = ((src_typ_t*)orig) + i;
s_ptr->b = (i*8+1) & 0x7fff;
@@ -645,9 +645,9 @@ static void test_compound_6()
} // for
/* Release resources */
- free(buf);
- free(bkg);
- free(orig);
+ HDfree(buf);
+ HDfree(bkg);
+ HDfree(orig);
s_ptr = NULL;
d_ptr = NULL;
st.close();