From 76034a33b2d4b40eb1dd329107eb16b60e8134f1 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Tue, 18 Dec 2001 15:28:38 -0500 Subject: [svn-r4737] Purpose: Bug Fix Description: Added regression test for proper library behavior when adding fields past the end of a datatype. Platforms Tested: FreeBSD 4.4 (sleipnir) --- test/dtypes.c | 123 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 119 insertions(+), 4 deletions(-) diff --git a/test/dtypes.c b/test/dtypes.c index a170027..dd95439 100644 --- a/test/dtypes.c +++ b/test/dtypes.c @@ -926,17 +926,23 @@ test_compound_6(void) /* Build hdf5 datatypes */ if ((st=H5Tcreate(H5T_COMPOUND, sizeof(struct st)))<0 || H5Tinsert(st, "b", HOFFSET(struct st, b), H5T_NATIVE_SHORT)<0 || - H5Tinsert(st, "d", HOFFSET(struct st, d), H5T_NATIVE_SHORT)<0) + H5Tinsert(st, "d", HOFFSET(struct st, d), H5T_NATIVE_SHORT)<0) { + H5_FAILED(); goto error; + } if ((dt=H5Tcreate(H5T_COMPOUND, sizeof(struct dt)))<0 || H5Tinsert(dt, "b", HOFFSET(struct dt, b), H5T_NATIVE_LONG)<0 || - H5Tinsert(dt, "d", HOFFSET(struct dt, d), H5T_NATIVE_LONG)<0) + H5Tinsert(dt, "d", HOFFSET(struct dt, d), H5T_NATIVE_LONG)<0) { + H5_FAILED(); goto error; + } /* Perform the conversion */ - if (H5Tconvert(st, dt, (hsize_t)nelmts, buf, bkg, H5P_DEFAULT)<0) + if (H5Tconvert(st, dt, (hsize_t)nelmts, buf, bkg, H5P_DEFAULT)<0) { + H5_FAILED(); goto error; + } /* Compare results */ for (i=0; i=0) { + H5_FAILED(); + printf("Inserted field 'd'?\n"); + goto error; + } /* end if */ + + /* Release resources */ + if (H5Tclose(tid1)<0 || H5Tclose(tid2)<0) { + H5_FAILED(); + printf("Can't close datatypes\n"); + goto error; + } /* end if */ PASSED(); reset_hdf5(); @@ -3790,6 +3904,7 @@ main(void) nerrors += test_compound_4(); nerrors += test_compound_5(); nerrors += test_compound_6(); + nerrors += test_compound_7(); nerrors += test_conv_int (); nerrors += test_conv_enum_1(); nerrors += test_conv_bitfield(); -- cgit v0.12