From aa9e1aeea18a0eff050feac19596be6cad9a7c65 Mon Sep 17 00:00:00 2001 From: Vailin Choi Date: Wed, 21 Mar 2018 11:44:24 -0500 Subject: Add test and release info for the fix to HDFFV-10425 test failure with H5DOwrite_chunk. --- hl/test/test_dset_opt.c | 143 +++++++++++++++++++++++++++++++++++++++++++++++ release_docs/RELEASE.txt | 16 ++++++ 2 files changed, 159 insertions(+) diff --git a/hl/test/test_dset_opt.c b/hl/test/test_dset_opt.c index 383a87a..fe2b2f3 100644 --- a/hl/test/test_dset_opt.c +++ b/hl/test/test_dset_opt.c @@ -62,6 +62,14 @@ #define OVERWRITE_CHUNK_NY 2 #define OVERWRITE_VALUE 42 +/* Defines used in test_single_chunk_latest() */ +#define FILE "single_latest.h5" +#define DATASET "dataset" +#define DIM0 4 +#define DIM1 32 +#define CHUNK0 DIM0 +#define CHUNK1 DIM1 + /* Local prototypes for filter functions */ static size_t filter_bogus1(unsigned int flags, size_t cd_nelmts, const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf); @@ -1969,6 +1977,139 @@ error: } /* test_read_unallocated_chunk() */ /*------------------------------------------------------------------------- + * Function: test_single_chunk_latest + * + * Purpose: This is to verify the fix for jira issue HDFFV-10425. + * The problem was due to a bug in the internal ilbrary routine + * H5D__chunk_direct_write() which passed a null dataset + * pointer to the insert callback for the chunk index type. + * Currently, the single chunk index is the only one that + * used the dataset pointer in the insert callback. + * + * This routine is based on the test program attached to + * this jira issue: + * Create a file with the latest format and a chunked dataset + * with one single chunk. The library will use single chunk + * index for the dataset. + * Verify that the data read is the same as the written data. + * + * Return: Success: 0 + * Failure: 1 + * + *------------------------------------------------------------------------- + */ +static int +test_single_chunk_latest(void) +{ + hid_t fid; /* File ID */ + hid_t fapl; /* File access property list ID */ + hid_t sid; /* Dataspace ID */ + hid_t did; /* Dataset ID */ + hid_t dcpl; /* Dataset creation property list */ + hsize_t dims[2] = {DIM0, DIM1}; /* Dimension sizes */ + hsize_t chunk[2] = {CHUNK0, CHUNK1}; /* Chunk dimension sizes */ + hsize_t offset[2] = {0,0}; /* Offset for writing */ + int wdata[DIM0][DIM1]; /* Write buffer */ + int rdata[DIM0][DIM1]; /* Read buffer */ + int i, j; /* Local index variable */ + + TESTING("H5DOwrite_chunk with single chunk and latest format"); + + /* Initialize data */ + for (i=0; i Date: Wed, 21 Mar 2018 14:12:30 -0500 Subject: Couple fixes to the test routine for HDFFV-10425. --- hl/test/test_dset_opt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hl/test/test_dset_opt.c b/hl/test/test_dset_opt.c index fe2b2f3..ef4cf13 100644 --- a/hl/test/test_dset_opt.c +++ b/hl/test/test_dset_opt.c @@ -2040,7 +2040,7 @@ test_single_chunk_latest(void) goto error; /* Create the dataset */ - if((did = H5Dcreate(fid, DATASET, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) + if((did = H5Dcreate2(fid, DATASET, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto error; /* Write the data directly to the dataset */ @@ -2064,7 +2064,7 @@ test_single_chunk_latest(void) /* Open the file and dataset with default properties */ if((fid = H5Fopen(FILE, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) goto error; - if((did = H5Dopen(fid, DATASET, H5P_DEFAULT)) < 0) + if((did = H5Dopen2(fid, DATASET, H5P_DEFAULT)) < 0) goto error; /* Retrieve dataset creation property list */ -- cgit v0.12