Update clang config (#473)
* Update clang config to put H5E_BEGIN_TRY / H5E_END_TRY on separate lines, empty C++ methods on separate lines, understand that ALL_MEMBERS / UNIQUE_MEMBERS are foreach macros, and properly skip the 'config' directory in the find command without emiting a warning * Committing clang-format changes Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
This commit is contained in:
365
test/dtypes.c
365
test/dtypes.c
@@ -312,7 +312,10 @@ test_copy(void)
|
||||
goto error;
|
||||
|
||||
/* We should not be able to close a built-in byte */
|
||||
H5E_BEGIN_TRY { status = H5Tclose(H5T_NATIVE_SCHAR); }
|
||||
H5E_BEGIN_TRY
|
||||
{
|
||||
status = H5Tclose(H5T_NATIVE_SCHAR);
|
||||
}
|
||||
H5E_END_TRY;
|
||||
if (status >= 0) {
|
||||
H5_FAILED();
|
||||
@@ -598,7 +601,10 @@ test_compound_1(void)
|
||||
goto error;
|
||||
|
||||
/* Attempt to add the new compound datatype as a field within itself */
|
||||
H5E_BEGIN_TRY { ret = H5Tinsert(complex_id, "compound", (size_t)0, complex_id); }
|
||||
H5E_BEGIN_TRY
|
||||
{
|
||||
ret = H5Tinsert(complex_id, "compound", (size_t)0, complex_id);
|
||||
}
|
||||
H5E_END_TRY;
|
||||
if (ret >= 0) {
|
||||
FAIL_PUTS_ERROR("Inserted compound datatype into itself?");
|
||||
@@ -612,56 +618,83 @@ test_compound_1(void)
|
||||
|
||||
/* Test some functions that aren't supposed to work for compound type */
|
||||
/* Tries to shrink the size and trail the last member */
|
||||
H5E_BEGIN_TRY { ret = H5Tset_size(complex_id, sizeof(double)); }
|
||||
H5E_BEGIN_TRY
|
||||
{
|
||||
ret = H5Tset_size(complex_id, sizeof(double));
|
||||
}
|
||||
H5E_END_TRY;
|
||||
if (ret >= 0) {
|
||||
FAIL_PUTS_ERROR("Operation not allowed for this type.");
|
||||
} /* end if */
|
||||
|
||||
H5E_BEGIN_TRY { size = H5Tget_precision(complex_id); }
|
||||
H5E_BEGIN_TRY
|
||||
{
|
||||
size = H5Tget_precision(complex_id);
|
||||
}
|
||||
H5E_END_TRY;
|
||||
if (size > 0) {
|
||||
FAIL_PUTS_ERROR("Operation not allowed for this type.");
|
||||
} /* end if */
|
||||
|
||||
size = 128;
|
||||
H5E_BEGIN_TRY { ret = H5Tset_precision(complex_id, size); }
|
||||
H5E_BEGIN_TRY
|
||||
{
|
||||
ret = H5Tset_precision(complex_id, size);
|
||||
}
|
||||
H5E_END_TRY;
|
||||
if (ret >= 0) {
|
||||
FAIL_PUTS_ERROR("Operation not allowed for this type.");
|
||||
} /* end if */
|
||||
|
||||
H5E_BEGIN_TRY { ret = H5Tget_pad(complex_id, &lsb, &msb); }
|
||||
H5E_BEGIN_TRY
|
||||
{
|
||||
ret = H5Tget_pad(complex_id, &lsb, &msb);
|
||||
}
|
||||
H5E_END_TRY;
|
||||
if (ret >= 0) {
|
||||
FAIL_PUTS_ERROR("Operation not allowed for this type.");
|
||||
} /* end if */
|
||||
|
||||
H5E_BEGIN_TRY { size = H5Tget_ebias(complex_id); }
|
||||
H5E_BEGIN_TRY
|
||||
{
|
||||
size = H5Tget_ebias(complex_id);
|
||||
}
|
||||
H5E_END_TRY;
|
||||
if (size > 0) {
|
||||
FAIL_PUTS_ERROR("Operation not allowed for this type.");
|
||||
} /* end if */
|
||||
|
||||
H5E_BEGIN_TRY { lsb = H5Tget_inpad(complex_id); }
|
||||
H5E_BEGIN_TRY
|
||||
{
|
||||
lsb = H5Tget_inpad(complex_id);
|
||||
}
|
||||
H5E_END_TRY;
|
||||
if (lsb >= 0) {
|
||||
FAIL_PUTS_ERROR("Operation not allowed for this type.");
|
||||
} /* end if */
|
||||
|
||||
H5E_BEGIN_TRY { cset = H5Tget_cset(complex_id); }
|
||||
H5E_BEGIN_TRY
|
||||
{
|
||||
cset = H5Tget_cset(complex_id);
|
||||
}
|
||||
H5E_END_TRY;
|
||||
if (cset > -1) {
|
||||
FAIL_PUTS_ERROR("Operation not allowed for this type.");
|
||||
} /* end if */
|
||||
|
||||
H5E_BEGIN_TRY { strpad = H5Tget_strpad(complex_id); }
|
||||
H5E_BEGIN_TRY
|
||||
{
|
||||
strpad = H5Tget_strpad(complex_id);
|
||||
}
|
||||
H5E_END_TRY;
|
||||
if (strpad > -1) {
|
||||
FAIL_PUTS_ERROR("Operation not allowed for this type.");
|
||||
} /* end if */
|
||||
|
||||
H5E_BEGIN_TRY { offset = H5Tget_offset(complex_id); }
|
||||
H5E_BEGIN_TRY
|
||||
{
|
||||
offset = H5Tget_offset(complex_id);
|
||||
}
|
||||
H5E_END_TRY;
|
||||
if (offset >= 0) {
|
||||
FAIL_PUTS_ERROR("Operation not allowed for this type.");
|
||||
@@ -673,19 +706,28 @@ test_compound_1(void)
|
||||
if (order != H5T_ORDER_LE && order != H5T_ORDER_BE)
|
||||
FAIL_PUTS_ERROR("Wrong order for this type.");
|
||||
|
||||
H5E_BEGIN_TRY { sign = H5Tget_sign(complex_id); }
|
||||
H5E_BEGIN_TRY
|
||||
{
|
||||
sign = H5Tget_sign(complex_id);
|
||||
}
|
||||
H5E_END_TRY;
|
||||
if (sign > -1) {
|
||||
FAIL_PUTS_ERROR("Operation not allowed for this type.");
|
||||
} /* end if */
|
||||
|
||||
H5E_BEGIN_TRY { tag = H5Tget_tag(complex_id); }
|
||||
H5E_BEGIN_TRY
|
||||
{
|
||||
tag = H5Tget_tag(complex_id);
|
||||
}
|
||||
H5E_END_TRY;
|
||||
if (tag) {
|
||||
FAIL_PUTS_ERROR("Operation not allowed for this type.");
|
||||
} /* end if */
|
||||
|
||||
H5E_BEGIN_TRY { super = H5Tget_super(complex_id); }
|
||||
H5E_BEGIN_TRY
|
||||
{
|
||||
super = H5Tget_super(complex_id);
|
||||
}
|
||||
H5E_END_TRY;
|
||||
if (super >= 0) {
|
||||
FAIL_PUTS_ERROR("Operation not allowed for this type.");
|
||||
@@ -1347,7 +1389,10 @@ test_compound_7(void)
|
||||
} /* end if */
|
||||
|
||||
/* Should not be able to insert field past end of compound datatype */
|
||||
H5E_BEGIN_TRY { ret = H5Tinsert(tid2, "d", HOFFSET(struct s2, d), H5T_NATIVE_DOUBLE); }
|
||||
H5E_BEGIN_TRY
|
||||
{
|
||||
ret = H5Tinsert(tid2, "d", HOFFSET(struct s2, d), H5T_NATIVE_DOUBLE);
|
||||
}
|
||||
H5E_END_TRY;
|
||||
if (ret >= 0) {
|
||||
H5_FAILED();
|
||||
@@ -1356,7 +1401,10 @@ test_compound_7(void)
|
||||
} /* end if */
|
||||
|
||||
/* Should not be able to shrink size of compound datatype */
|
||||
H5E_BEGIN_TRY { ret = H5Tset_size(tid2, sizeof(struct s1) / 2); }
|
||||
H5E_BEGIN_TRY
|
||||
{
|
||||
ret = H5Tset_size(tid2, sizeof(struct s1) / 2);
|
||||
}
|
||||
H5E_END_TRY;
|
||||
if (ret >= 0) {
|
||||
H5_FAILED();
|
||||
@@ -1590,7 +1638,10 @@ test_compound_8(void)
|
||||
} /* end if */
|
||||
|
||||
/* If the type is not packed, packing a locked type shouldn't work */
|
||||
H5E_BEGIN_TRY { ret = H5Tpack(tid3); }
|
||||
H5E_BEGIN_TRY
|
||||
{
|
||||
ret = H5Tpack(tid3);
|
||||
}
|
||||
H5E_END_TRY;
|
||||
if (ret >= 0) {
|
||||
H5_FAILED();
|
||||
@@ -2498,7 +2549,10 @@ test_compound_12(void)
|
||||
|
||||
/* Tries to cut last member. Supposed to fail. */
|
||||
size--;
|
||||
H5E_BEGIN_TRY { ret = H5Tset_size(complex_id, size); }
|
||||
H5E_BEGIN_TRY
|
||||
{
|
||||
ret = H5Tset_size(complex_id, size);
|
||||
}
|
||||
H5E_END_TRY;
|
||||
if (ret >= 0) {
|
||||
H5_FAILED();
|
||||
@@ -3594,7 +3648,10 @@ test_compound_18(void)
|
||||
HDassert(sid > 0);
|
||||
|
||||
/* Create a dataset with the bad compound datatype */
|
||||
H5E_BEGIN_TRY { did = H5Dcreate2(file, "dataset", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); }
|
||||
H5E_BEGIN_TRY
|
||||
{
|
||||
did = H5Dcreate2(file, "dataset", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
|
||||
}
|
||||
H5E_END_TRY;
|
||||
if (did > 0) {
|
||||
H5Dclose(did);
|
||||
@@ -3606,7 +3663,10 @@ test_compound_18(void)
|
||||
HDassert(gid > 0);
|
||||
|
||||
/* Create an attribute with the bad compound datatype */
|
||||
H5E_BEGIN_TRY { aid = H5Acreate2(gid, "attr", tid, sid, H5P_DEFAULT, H5P_DEFAULT); }
|
||||
H5E_BEGIN_TRY
|
||||
{
|
||||
aid = H5Acreate2(gid, "attr", tid, sid, H5P_DEFAULT, H5P_DEFAULT);
|
||||
}
|
||||
H5E_END_TRY;
|
||||
if (aid > 0) {
|
||||
H5Aclose(aid);
|
||||
@@ -3614,7 +3674,10 @@ test_compound_18(void)
|
||||
} /* end if */
|
||||
|
||||
/* Commit the datatype */
|
||||
H5E_BEGIN_TRY { ret = H5Tcommit2(file, "cmpnd", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); }
|
||||
H5E_BEGIN_TRY
|
||||
{
|
||||
ret = H5Tcommit2(file, "cmpnd", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
|
||||
}
|
||||
H5E_END_TRY;
|
||||
if (ret >= 0) {
|
||||
FAIL_PUTS_ERROR("committed named datatype with bad compound datatype")
|
||||
@@ -3636,7 +3699,10 @@ test_compound_18(void)
|
||||
FAIL_STACK_ERROR
|
||||
|
||||
/* Try to open the datatype */
|
||||
H5E_BEGIN_TRY { tid = H5Topen2(file, "cmpnd", H5P_DEFAULT); }
|
||||
H5E_BEGIN_TRY
|
||||
{
|
||||
tid = H5Topen2(file, "cmpnd", H5P_DEFAULT);
|
||||
}
|
||||
H5E_END_TRY;
|
||||
if (tid > 0) {
|
||||
H5Tclose(tid);
|
||||
@@ -3644,7 +3710,10 @@ test_compound_18(void)
|
||||
} /* end if */
|
||||
|
||||
/* Try to open the dataset */
|
||||
H5E_BEGIN_TRY { did = H5Dopen2(file, "dataset", H5P_DEFAULT); }
|
||||
H5E_BEGIN_TRY
|
||||
{
|
||||
did = H5Dopen2(file, "dataset", H5P_DEFAULT);
|
||||
}
|
||||
H5E_END_TRY;
|
||||
if (did > 0) {
|
||||
H5Dclose(did);
|
||||
@@ -3656,7 +3725,10 @@ test_compound_18(void)
|
||||
TEST_ERROR
|
||||
|
||||
/* Try to open the dataset */
|
||||
H5E_BEGIN_TRY { aid = H5Aopen(gid, "attr", H5P_DEFAULT); }
|
||||
H5E_BEGIN_TRY
|
||||
{
|
||||
aid = H5Aopen(gid, "attr", H5P_DEFAULT);
|
||||
}
|
||||
H5E_END_TRY;
|
||||
if (aid > 0) {
|
||||
H5Aclose(aid);
|
||||
@@ -3958,14 +4030,20 @@ test_transient(hid_t fapl)
|
||||
goto error;
|
||||
|
||||
/* Predefined types cannot be modified or closed */
|
||||
H5E_BEGIN_TRY { status = H5Tset_precision(H5T_NATIVE_INT, (size_t)256); }
|
||||
H5E_BEGIN_TRY
|
||||
{
|
||||
status = H5Tset_precision(H5T_NATIVE_INT, (size_t)256);
|
||||
}
|
||||
H5E_END_TRY;
|
||||
if (status >= 0) {
|
||||
H5_FAILED();
|
||||
HDputs(" Predefined types should not be modifiable!");
|
||||
goto error;
|
||||
}
|
||||
H5E_BEGIN_TRY { status = H5Tclose(H5T_NATIVE_INT); }
|
||||
H5E_BEGIN_TRY
|
||||
{
|
||||
status = H5Tclose(H5T_NATIVE_INT);
|
||||
}
|
||||
H5E_END_TRY;
|
||||
if (status >= 0) {
|
||||
H5_FAILED();
|
||||
@@ -3980,7 +4058,10 @@ test_transient(hid_t fapl)
|
||||
goto error;
|
||||
|
||||
/* It should not be possible to create an attribute for a transient type */
|
||||
H5E_BEGIN_TRY { ret_id = H5Acreate2(type, "attr1", H5T_NATIVE_INT, space, H5P_DEFAULT, H5P_DEFAULT); }
|
||||
H5E_BEGIN_TRY
|
||||
{
|
||||
ret_id = H5Acreate2(type, "attr1", H5T_NATIVE_INT, space, H5P_DEFAULT, H5P_DEFAULT);
|
||||
}
|
||||
H5E_END_TRY;
|
||||
if (ret_id >= 0) {
|
||||
H5_FAILED();
|
||||
@@ -3999,7 +4080,10 @@ test_transient(hid_t fapl)
|
||||
/* The type returned from a dataset should not be modifiable */
|
||||
if ((t2 = H5Dget_type(dset)) < 0)
|
||||
goto error;
|
||||
H5E_BEGIN_TRY { status = H5Tset_precision(t2, (size_t)256); }
|
||||
H5E_BEGIN_TRY
|
||||
{
|
||||
status = H5Tset_precision(t2, (size_t)256);
|
||||
}
|
||||
H5E_END_TRY;
|
||||
if (status >= 0) {
|
||||
H5_FAILED();
|
||||
@@ -4019,7 +4103,10 @@ test_transient(hid_t fapl)
|
||||
goto error;
|
||||
if ((t2 = H5Dget_type(dset)) < 0)
|
||||
goto error;
|
||||
H5E_BEGIN_TRY { status = H5Tset_precision(t2, (size_t)256); }
|
||||
H5E_BEGIN_TRY
|
||||
{
|
||||
status = H5Tset_precision(t2, (size_t)256);
|
||||
}
|
||||
H5E_END_TRY;
|
||||
if (status >= 0) {
|
||||
H5_FAILED();
|
||||
@@ -4127,7 +4214,10 @@ test_named(hid_t fapl)
|
||||
}
|
||||
|
||||
/* We should not be able to modify a type after it has been committed. */
|
||||
H5E_BEGIN_TRY { status = H5Tset_precision(type, (size_t)256); }
|
||||
H5E_BEGIN_TRY
|
||||
{
|
||||
status = H5Tset_precision(type, (size_t)256);
|
||||
}
|
||||
H5E_END_TRY;
|
||||
if (status >= 0) {
|
||||
H5_FAILED();
|
||||
@@ -4325,7 +4415,10 @@ test_named(hid_t fapl)
|
||||
/* Verify that H5Tcommit_anon returns an error */
|
||||
if ((type = H5Tcopy(H5T_NATIVE_INT)) < 0)
|
||||
goto error;
|
||||
H5E_BEGIN_TRY { status = H5Tcommit_anon(file, type, H5P_DEFAULT, H5P_DEFAULT); }
|
||||
H5E_BEGIN_TRY
|
||||
{
|
||||
status = H5Tcommit_anon(file, type, H5P_DEFAULT, H5P_DEFAULT);
|
||||
}
|
||||
H5E_END_TRY;
|
||||
if (status >= 0) {
|
||||
H5_FAILED();
|
||||
@@ -4935,37 +5028,55 @@ test_conv_str_3(void)
|
||||
if (H5Tget_order(type) < 0)
|
||||
FAIL_STACK_ERROR
|
||||
|
||||
H5E_BEGIN_TRY { ret = H5Tset_precision(type, nelmts); }
|
||||
H5E_BEGIN_TRY
|
||||
{
|
||||
ret = H5Tset_precision(type, nelmts);
|
||||
}
|
||||
H5E_END_TRY;
|
||||
if (ret >= 0) {
|
||||
FAIL_PUTS_ERROR("Operation not allowed for this type.");
|
||||
} /* end if */
|
||||
|
||||
H5E_BEGIN_TRY { size = H5Tget_ebias(type); }
|
||||
H5E_BEGIN_TRY
|
||||
{
|
||||
size = H5Tget_ebias(type);
|
||||
}
|
||||
H5E_END_TRY;
|
||||
if (size > 0) {
|
||||
FAIL_PUTS_ERROR("Operation not allowed for this type.");
|
||||
} /* end if */
|
||||
|
||||
H5E_BEGIN_TRY { inpad = H5Tget_inpad(type); }
|
||||
H5E_BEGIN_TRY
|
||||
{
|
||||
inpad = H5Tget_inpad(type);
|
||||
}
|
||||
H5E_END_TRY;
|
||||
if (inpad > -1) {
|
||||
FAIL_PUTS_ERROR("Operation not allowed for this type.");
|
||||
} /* end if */
|
||||
|
||||
H5E_BEGIN_TRY { sign = H5Tget_sign(type); }
|
||||
H5E_BEGIN_TRY
|
||||
{
|
||||
sign = H5Tget_sign(type);
|
||||
}
|
||||
H5E_END_TRY;
|
||||
if (sign > -1) {
|
||||
FAIL_PUTS_ERROR("Operation not allowed for this type.");
|
||||
} /* end if */
|
||||
|
||||
H5E_BEGIN_TRY { tag = H5Tget_tag(type); }
|
||||
H5E_BEGIN_TRY
|
||||
{
|
||||
tag = H5Tget_tag(type);
|
||||
}
|
||||
H5E_END_TRY;
|
||||
if (tag) {
|
||||
FAIL_PUTS_ERROR("Operation not allowed for this type.");
|
||||
} /* end if */
|
||||
|
||||
H5E_BEGIN_TRY { super = H5Tget_super(type); }
|
||||
H5E_BEGIN_TRY
|
||||
{
|
||||
super = H5Tget_super(type);
|
||||
}
|
||||
H5E_END_TRY;
|
||||
if (super >= 0) {
|
||||
FAIL_PUTS_ERROR("Operation not allowed for this type.");
|
||||
@@ -5298,7 +5409,10 @@ test_bitfield_funcs(void)
|
||||
if ((ntype = H5Tget_native_type(type, H5T_DIR_ASCEND)) < 0)
|
||||
goto error;
|
||||
|
||||
H5E_BEGIN_TRY { size = H5Tget_ebias(type); }
|
||||
H5E_BEGIN_TRY
|
||||
{
|
||||
size = H5Tget_ebias(type);
|
||||
}
|
||||
H5E_END_TRY;
|
||||
if (size > 0) {
|
||||
H5_FAILED();
|
||||
@@ -5306,7 +5420,10 @@ test_bitfield_funcs(void)
|
||||
goto error;
|
||||
} /* end if */
|
||||
|
||||
H5E_BEGIN_TRY { inpad = H5Tget_inpad(type); }
|
||||
H5E_BEGIN_TRY
|
||||
{
|
||||
inpad = H5Tget_inpad(type);
|
||||
}
|
||||
H5E_END_TRY;
|
||||
if (inpad > -1) {
|
||||
H5_FAILED();
|
||||
@@ -5314,7 +5431,10 @@ test_bitfield_funcs(void)
|
||||
goto error;
|
||||
} /* end if */
|
||||
|
||||
H5E_BEGIN_TRY { cset = H5Tget_cset(type); }
|
||||
H5E_BEGIN_TRY
|
||||
{
|
||||
cset = H5Tget_cset(type);
|
||||
}
|
||||
H5E_END_TRY;
|
||||
if (cset > -1) {
|
||||
H5_FAILED();
|
||||
@@ -5322,7 +5442,10 @@ test_bitfield_funcs(void)
|
||||
goto error;
|
||||
} /* end if */
|
||||
|
||||
H5E_BEGIN_TRY { strpad = H5Tget_strpad(type); }
|
||||
H5E_BEGIN_TRY
|
||||
{
|
||||
strpad = H5Tget_strpad(type);
|
||||
}
|
||||
H5E_END_TRY;
|
||||
if (strpad > -1) {
|
||||
H5_FAILED();
|
||||
@@ -5330,7 +5453,10 @@ test_bitfield_funcs(void)
|
||||
goto error;
|
||||
} /* end if */
|
||||
|
||||
H5E_BEGIN_TRY { ret = H5Tset_sign(type, H5T_SGN_2); }
|
||||
H5E_BEGIN_TRY
|
||||
{
|
||||
ret = H5Tset_sign(type, H5T_SGN_2);
|
||||
}
|
||||
H5E_END_TRY;
|
||||
if (ret >= 0) {
|
||||
H5_FAILED();
|
||||
@@ -5338,7 +5464,10 @@ test_bitfield_funcs(void)
|
||||
goto error;
|
||||
} /* end if */
|
||||
|
||||
H5E_BEGIN_TRY { tag = H5Tget_tag(type); }
|
||||
H5E_BEGIN_TRY
|
||||
{
|
||||
tag = H5Tget_tag(type);
|
||||
}
|
||||
H5E_END_TRY;
|
||||
if (tag) {
|
||||
H5_FAILED();
|
||||
@@ -5346,7 +5475,10 @@ test_bitfield_funcs(void)
|
||||
goto error;
|
||||
} /* end if */
|
||||
|
||||
H5E_BEGIN_TRY { super = H5Tget_super(type); }
|
||||
H5E_BEGIN_TRY
|
||||
{
|
||||
super = H5Tget_super(type);
|
||||
}
|
||||
H5E_END_TRY;
|
||||
if (super >= 0) {
|
||||
H5_FAILED();
|
||||
@@ -5471,7 +5603,10 @@ opaque_check(int tag_it)
|
||||
}
|
||||
|
||||
/* Make sure that we can't convert between the types yet */
|
||||
H5E_BEGIN_TRY { status = H5Tconvert(st, dt, (size_t)OPAQUE_NELMTS, buf, NULL, H5P_DEFAULT); }
|
||||
H5E_BEGIN_TRY
|
||||
{
|
||||
status = H5Tconvert(st, dt, (size_t)OPAQUE_NELMTS, buf, NULL, H5P_DEFAULT);
|
||||
}
|
||||
H5E_END_TRY;
|
||||
if (status >= 0) {
|
||||
H5_FAILED();
|
||||
@@ -5540,7 +5675,10 @@ opaque_long(void)
|
||||
long_tag[16384] = '\0';
|
||||
|
||||
/* Set opaque type's tag */
|
||||
H5E_BEGIN_TRY { ret = H5Tset_tag(dt, long_tag); }
|
||||
H5E_BEGIN_TRY
|
||||
{
|
||||
ret = H5Tset_tag(dt, long_tag);
|
||||
}
|
||||
H5E_END_TRY;
|
||||
if (ret != FAIL)
|
||||
TEST_ERROR
|
||||
@@ -5596,63 +5734,90 @@ opaque_funcs(void)
|
||||
if ((size = H5Tget_size(type)) == 0)
|
||||
goto error;
|
||||
|
||||
H5E_BEGIN_TRY { ret = H5Tset_precision(type, (size_t)32); }
|
||||
H5E_BEGIN_TRY
|
||||
{
|
||||
ret = H5Tset_precision(type, (size_t)32);
|
||||
}
|
||||
H5E_END_TRY;
|
||||
if (ret >= 0) {
|
||||
HDprintf("Operation not allowed for this type.\n");
|
||||
TEST_ERROR
|
||||
} /* end if */
|
||||
|
||||
H5E_BEGIN_TRY { ret = H5Tset_pad(type, H5T_PAD_ZERO, H5T_PAD_ONE); }
|
||||
H5E_BEGIN_TRY
|
||||
{
|
||||
ret = H5Tset_pad(type, H5T_PAD_ZERO, H5T_PAD_ONE);
|
||||
}
|
||||
H5E_END_TRY;
|
||||
if (ret >= 0) {
|
||||
HDprintf("Operation not allowed for this type.\n");
|
||||
TEST_ERROR
|
||||
} /* end if */
|
||||
|
||||
H5E_BEGIN_TRY { size = H5Tget_ebias(type); }
|
||||
H5E_BEGIN_TRY
|
||||
{
|
||||
size = H5Tget_ebias(type);
|
||||
}
|
||||
H5E_END_TRY;
|
||||
if (size > 0) {
|
||||
HDprintf("Operation not allowed for this type.\n");
|
||||
TEST_ERROR
|
||||
} /* end if */
|
||||
|
||||
H5E_BEGIN_TRY { inpad = H5Tget_inpad(type); }
|
||||
H5E_BEGIN_TRY
|
||||
{
|
||||
inpad = H5Tget_inpad(type);
|
||||
}
|
||||
H5E_END_TRY;
|
||||
if (inpad > -1) {
|
||||
HDprintf("Operation not allowed for this type.\n");
|
||||
TEST_ERROR
|
||||
} /* end if */
|
||||
|
||||
H5E_BEGIN_TRY { cset = H5Tget_cset(type); }
|
||||
H5E_BEGIN_TRY
|
||||
{
|
||||
cset = H5Tget_cset(type);
|
||||
}
|
||||
H5E_END_TRY;
|
||||
if (cset > -1) {
|
||||
HDprintf("Operation not allowed for this type.\n");
|
||||
TEST_ERROR
|
||||
} /* end if */
|
||||
|
||||
H5E_BEGIN_TRY { strpad = H5Tget_strpad(type); }
|
||||
H5E_BEGIN_TRY
|
||||
{
|
||||
strpad = H5Tget_strpad(type);
|
||||
}
|
||||
H5E_END_TRY;
|
||||
if (strpad > -1) {
|
||||
HDprintf("Operation not allowed for this type.\n");
|
||||
TEST_ERROR
|
||||
} /* end if */
|
||||
|
||||
H5E_BEGIN_TRY { ret = H5Tset_offset(type, (size_t)16); }
|
||||
H5E_BEGIN_TRY
|
||||
{
|
||||
ret = H5Tset_offset(type, (size_t)16);
|
||||
}
|
||||
H5E_END_TRY;
|
||||
if (ret >= 0) {
|
||||
HDprintf("Operation not allowed for this type.\n");
|
||||
TEST_ERROR
|
||||
} /* end if */
|
||||
|
||||
H5E_BEGIN_TRY { sign = H5Tget_sign(type); }
|
||||
H5E_BEGIN_TRY
|
||||
{
|
||||
sign = H5Tget_sign(type);
|
||||
}
|
||||
H5E_END_TRY;
|
||||
if (sign > -1) {
|
||||
HDprintf("Operation not allowed for this type.\n");
|
||||
TEST_ERROR
|
||||
} /* end if */
|
||||
|
||||
H5E_BEGIN_TRY { super = H5Tget_super(type); }
|
||||
H5E_BEGIN_TRY
|
||||
{
|
||||
super = H5Tget_super(type);
|
||||
}
|
||||
H5E_END_TRY;
|
||||
if (super >= 0) {
|
||||
HDprintf("Operation not allowed for this type.\n");
|
||||
@@ -5810,7 +5975,10 @@ test_encode(void)
|
||||
cmpd_buf = (unsigned char *)HDcalloc((size_t)1, cmpd_buf_size);
|
||||
|
||||
/* Try decoding bogus buffer */
|
||||
H5E_BEGIN_TRY { ret_id = H5Tdecode(cmpd_buf); }
|
||||
H5E_BEGIN_TRY
|
||||
{
|
||||
ret_id = H5Tdecode(cmpd_buf);
|
||||
}
|
||||
H5E_END_TRY;
|
||||
if (ret_id != FAIL) {
|
||||
H5_FAILED();
|
||||
@@ -6159,7 +6327,10 @@ test_encode(void)
|
||||
} /* end if */
|
||||
|
||||
/* Make sure the decoded datatypes are already closed. */
|
||||
H5E_BEGIN_TRY { ret = H5Tclose(decoded_tid1); }
|
||||
H5E_BEGIN_TRY
|
||||
{
|
||||
ret = H5Tclose(decoded_tid1);
|
||||
}
|
||||
H5E_END_TRY;
|
||||
if (ret != FAIL) {
|
||||
H5_FAILED();
|
||||
@@ -6167,7 +6338,10 @@ test_encode(void)
|
||||
goto error;
|
||||
}
|
||||
|
||||
H5E_BEGIN_TRY { ret = H5Tclose(decoded_tid2); }
|
||||
H5E_BEGIN_TRY
|
||||
{
|
||||
ret = H5Tclose(decoded_tid2);
|
||||
}
|
||||
H5E_END_TRY;
|
||||
if (ret != FAIL) {
|
||||
H5_FAILED();
|
||||
@@ -6175,7 +6349,10 @@ test_encode(void)
|
||||
goto error;
|
||||
}
|
||||
|
||||
H5E_BEGIN_TRY { ret = H5Tclose(decoded_tid3); }
|
||||
H5E_BEGIN_TRY
|
||||
{
|
||||
ret = H5Tclose(decoded_tid3);
|
||||
}
|
||||
H5E_END_TRY;
|
||||
if (ret != FAIL) {
|
||||
H5_FAILED();
|
||||
@@ -6610,7 +6787,10 @@ test_int_float_except(void)
|
||||
|
||||
#if H5_SIZEOF_INT == 4 && H5_SIZEOF_FLOAT == 4
|
||||
error:
|
||||
H5E_BEGIN_TRY { H5Pclose(dxpl); }
|
||||
H5E_BEGIN_TRY
|
||||
{
|
||||
H5Pclose(dxpl);
|
||||
}
|
||||
H5E_END_TRY;
|
||||
return 1;
|
||||
#endif /* H5_SIZEOF_INT==4 && H5_SIZEOF_FLOAT==4 */
|
||||
@@ -7788,7 +7968,10 @@ test_deprec(hid_t fapl)
|
||||
FAIL_STACK_ERROR
|
||||
|
||||
/* Predefined types cannot be committed */
|
||||
H5E_BEGIN_TRY { status = H5Tcommit1(file, "test_named_1 (should not exist)", H5T_NATIVE_INT); }
|
||||
H5E_BEGIN_TRY
|
||||
{
|
||||
status = H5Tcommit1(file, "test_named_1 (should not exist)", H5T_NATIVE_INT);
|
||||
}
|
||||
H5E_END_TRY;
|
||||
if (status >= 0)
|
||||
FAIL_PUTS_ERROR(" Predefined types should not be committable!")
|
||||
@@ -7804,13 +7987,19 @@ test_deprec(hid_t fapl)
|
||||
FAIL_PUTS_ERROR(" H5Tcommitted() returned false!")
|
||||
|
||||
/* We should not be able to modify a type after it has been committed. */
|
||||
H5E_BEGIN_TRY { status = H5Tset_precision(type, (size_t)256); }
|
||||
H5E_BEGIN_TRY
|
||||
{
|
||||
status = H5Tset_precision(type, (size_t)256);
|
||||
}
|
||||
H5E_END_TRY;
|
||||
if (status >= 0)
|
||||
FAIL_PUTS_ERROR(" Committed type is not constant!")
|
||||
|
||||
/* We should not be able to re-commit a committed type */
|
||||
H5E_BEGIN_TRY { status = H5Tcommit1(file, "test_named_2 (should not exist)", type); }
|
||||
H5E_BEGIN_TRY
|
||||
{
|
||||
status = H5Tcommit1(file, "test_named_2 (should not exist)", type);
|
||||
}
|
||||
H5E_END_TRY;
|
||||
if (status >= 0)
|
||||
FAIL_PUTS_ERROR(" Committed types should not be recommitted!")
|
||||
@@ -7840,7 +8029,10 @@ test_deprec(hid_t fapl)
|
||||
/* Verify that H5Tcommit2 returns an error */
|
||||
if ((type = H5Tcopy(H5T_NATIVE_INT)) < 0)
|
||||
goto error;
|
||||
H5E_BEGIN_TRY { status = H5Tcommit1(file, "test_named_3 (should not exist)", type); }
|
||||
H5E_BEGIN_TRY
|
||||
{
|
||||
status = H5Tcommit1(file, "test_named_3 (should not exist)", type);
|
||||
}
|
||||
H5E_END_TRY;
|
||||
if (status >= 0) {
|
||||
H5_FAILED();
|
||||
@@ -7927,7 +8119,10 @@ test_utf_ascii_conv(void)
|
||||
FAIL_STACK_ERROR
|
||||
|
||||
/* Test conversion in memory */
|
||||
H5E_BEGIN_TRY { status = H5Tconvert(utf8_vtid, ascii_vtid, 1, &utf8_w, NULL, H5P_DEFAULT); }
|
||||
H5E_BEGIN_TRY
|
||||
{
|
||||
status = H5Tconvert(utf8_vtid, ascii_vtid, 1, &utf8_w, NULL, H5P_DEFAULT);
|
||||
}
|
||||
H5E_END_TRY
|
||||
if (status >= 0)
|
||||
FAIL_STACK_ERROR
|
||||
@@ -7950,7 +8145,10 @@ test_utf_ascii_conv(void)
|
||||
FAIL_STACK_ERROR
|
||||
|
||||
/* Read the UTF8 string, as ASCII, supposed to fail */
|
||||
H5E_BEGIN_TRY { status = H5Dread(did, ascii_vtid, H5S_ALL, H5S_ALL, H5P_DEFAULT, &ascii_r); }
|
||||
H5E_BEGIN_TRY
|
||||
{
|
||||
status = H5Dread(did, ascii_vtid, H5S_ALL, H5S_ALL, H5P_DEFAULT, &ascii_r);
|
||||
}
|
||||
H5E_END_TRY
|
||||
if (status >= 0)
|
||||
FAIL_STACK_ERROR
|
||||
@@ -7963,7 +8161,10 @@ test_utf_ascii_conv(void)
|
||||
* Test VL string conversion from ASCII to UTF8
|
||||
************************************************/
|
||||
/* Test conversion in memory */
|
||||
H5E_BEGIN_TRY { status = H5Tconvert(ascii_vtid, utf8_vtid, 1, &ascii_w, NULL, H5P_DEFAULT); }
|
||||
H5E_BEGIN_TRY
|
||||
{
|
||||
status = H5Tconvert(ascii_vtid, utf8_vtid, 1, &ascii_w, NULL, H5P_DEFAULT);
|
||||
}
|
||||
H5E_END_TRY
|
||||
if (status >= 0)
|
||||
FAIL_STACK_ERROR
|
||||
@@ -7977,7 +8178,10 @@ test_utf_ascii_conv(void)
|
||||
FAIL_STACK_ERROR
|
||||
|
||||
/* Read the ASCII string, as UTF8, supposed to fail */
|
||||
H5E_BEGIN_TRY { status = H5Dread(did, utf8_vtid, H5S_ALL, H5S_ALL, H5P_DEFAULT, &utf8_r); }
|
||||
H5E_BEGIN_TRY
|
||||
{
|
||||
status = H5Dread(did, utf8_vtid, H5S_ALL, H5S_ALL, H5P_DEFAULT, &utf8_r);
|
||||
}
|
||||
H5E_END_TRY
|
||||
if (status >= 0)
|
||||
FAIL_STACK_ERROR
|
||||
@@ -8020,7 +8224,10 @@ test_utf_ascii_conv(void)
|
||||
FAIL_STACK_ERROR
|
||||
|
||||
/* Test conversion in memory */
|
||||
H5E_BEGIN_TRY { status = H5Tconvert(utf8_tid, ascii_tid, 1, utf8_2, NULL, H5P_DEFAULT); }
|
||||
H5E_BEGIN_TRY
|
||||
{
|
||||
status = H5Tconvert(utf8_tid, ascii_tid, 1, utf8_2, NULL, H5P_DEFAULT);
|
||||
}
|
||||
H5E_END_TRY
|
||||
if (status >= 0)
|
||||
FAIL_STACK_ERROR
|
||||
@@ -8034,7 +8241,10 @@ test_utf_ascii_conv(void)
|
||||
FAIL_STACK_ERROR
|
||||
|
||||
/* Read the UTF8 string as ASCII, supposed to fail */
|
||||
H5E_BEGIN_TRY { status = H5Dread(did, ascii_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, &ascii2); }
|
||||
H5E_BEGIN_TRY
|
||||
{
|
||||
status = H5Dread(did, ascii_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, &ascii2);
|
||||
}
|
||||
H5E_END_TRY
|
||||
if (status >= 0)
|
||||
FAIL_STACK_ERROR
|
||||
@@ -8047,7 +8257,10 @@ test_utf_ascii_conv(void)
|
||||
* Test fixed-length string conversion from ASCII to UTF8
|
||||
**********************************************************/
|
||||
/* Test conversion in memory */
|
||||
H5E_BEGIN_TRY { status = H5Tconvert(ascii_tid, utf8_tid, 1, ascii2, NULL, H5P_DEFAULT); }
|
||||
H5E_BEGIN_TRY
|
||||
{
|
||||
status = H5Tconvert(ascii_tid, utf8_tid, 1, ascii2, NULL, H5P_DEFAULT);
|
||||
}
|
||||
H5E_END_TRY
|
||||
if (status >= 0)
|
||||
FAIL_STACK_ERROR
|
||||
@@ -8061,7 +8274,10 @@ test_utf_ascii_conv(void)
|
||||
FAIL_STACK_ERROR
|
||||
|
||||
/* Read the UTF8 string as ASCII, supposed to fail */
|
||||
H5E_BEGIN_TRY { status = H5Dread(did, utf8_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, &utf8_2); }
|
||||
H5E_BEGIN_TRY
|
||||
{
|
||||
status = H5Dread(did, utf8_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, &utf8_2);
|
||||
}
|
||||
H5E_END_TRY
|
||||
if (status >= 0)
|
||||
FAIL_STACK_ERROR
|
||||
@@ -8441,7 +8657,10 @@ test_versionbounds(void)
|
||||
for (high = 0; high < versions_count; high++) {
|
||||
|
||||
/* Set version bounds */
|
||||
H5E_BEGIN_TRY { ret = H5Pset_libver_bounds(fapl, versions[low], versions[high]); }
|
||||
H5E_BEGIN_TRY
|
||||
{
|
||||
ret = H5Pset_libver_bounds(fapl, versions[low], versions[high]);
|
||||
}
|
||||
H5E_END_TRY;
|
||||
|
||||
if (ret < 0) /* Invalid low/high combinations */
|
||||
|
||||
Reference in New Issue
Block a user