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