summaryrefslogtreecommitdiffstats
path: root/test/dtypes.c
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2011-10-11 22:09:25 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2011-10-11 22:09:25 (GMT)
commit0e0b6fc5abdd841f2272e299b185b4566619ae01 (patch)
treecc5c01121b75b77b8a3efa66717e537197e0ae94 /test/dtypes.c
parent268d79925ba45493c259a96c72c3e89f9d6472c3 (diff)
downloadhdf5-0e0b6fc5abdd841f2272e299b185b4566619ae01.zip
hdf5-0e0b6fc5abdd841f2272e299b185b4566619ae01.tar.gz
hdf5-0e0b6fc5abdd841f2272e299b185b4566619ae01.tar.bz2
[svn-r21524] Reverts 20920 (HDFFV-7579 fix) (this is 20913/21 from the trunk)
This change reverts the HDFFV-7579 fix while we more carefully consider enum conversions as a part of the h5compare work. Tested on jam, Windows 7 and linew.
Diffstat (limited to 'test/dtypes.c')
-rw-r--r--test/dtypes.c107
1 files changed, 0 insertions, 107 deletions
diff --git a/test/dtypes.c b/test/dtypes.c
index 57ac4e6..aca1403 100644
--- a/test/dtypes.c
+++ b/test/dtypes.c
@@ -4488,22 +4488,12 @@ error:
* Failure: number of errors
*
* Programmer: Robb Matzke, LLNL, 2003-06-09
- *
- * Modifications:
- * Raymond Lu
- * 26 May 2011
- * I added a few overflowing values (beyond the range of enumerate
- * values) to make sure the library retains these values. The test
- * for overflowing values when no conversion happens is in
- * test_noconv of enum.c.
*-------------------------------------------------------------------------
*/
static int
test_conv_enum_2(void)
{
hid_t srctype=-1, dsttype=-1, oddsize=-1;
- hid_t dxpl_id=-1;
- hbool_t conv_overflow;
int *data=NULL, i, nerrors=0;
const char *mname[] = { "RED",
"GREEN",
@@ -4555,108 +4545,11 @@ test_conv_enum_2(void)
}
}
- /* Now make the source data overflow and see the conversion retain the original values by default.
- * The initialization makes the first 128 values be -1, -2, -3,..., -128. In hexadecimal,
- * they are 0xffffff, 0xfffffe, 0xfffffd,..., 0xffff7f. The rest values are between 0
- * and 127. */
- for (i=0; i<NTESTELEM; i++) {
- if(i > 127) {
- ((char*)data)[i*3+2] = i % 128;
- ((char*)data)[i*3+0] = 0;
- ((char*)data)[i*3+1] = 0;
- } else {
- ((char*)data)[i*3+2] = -(i+1);
- ((char*)data)[i*3+0] = -1;
- ((char*)data)[i*3+1] = -1;
- }
- }
-
- /* Convert to destination type */
- H5Tconvert(srctype, dsttype, (size_t)NTESTELEM, data, NULL, H5P_DEFAULT);
-
- /* Check results */
- for (i=0; i<NTESTELEM; i++) {
- if(i > 127) {
- if (data[i] != i%128) {
- if (!nerrors++) {
- H5_FAILED();
- printf("element %d is %d but should have been %d\n",
- i, data[i], i%128);
- }
- }
- } else {
- if (data[i] != -(i+1)) {
- if (!nerrors++) {
- H5_FAILED();
- printf("element %d is %d but should have been %d\n",
- i, data[i], -(i+1));
- }
- }
- }
- }
-
- /* Now make the source data overflow and set the property for handling overflowing data to fill them
- * them with 0xff (-1). The initialization makes the first 128 values be -1, -2, -3,..., -128. In
- * hexadecimal, they are 0xffffff, 0xfffffe, 0xfffffd,..., 0xffff7f. The next 128 values are 128 to
- * 255. The rest values are between 0 and 7. */
- for (i=0; i<NTESTELEM; i++) {
- if(i > 255) {
- ((char*)data)[i*3+2] = i % 8;
- ((char*)data)[i*3+0] = 0;
- ((char*)data)[i*3+1] = 0;
- } else if(i > 127) {
- ((char*)data)[i*3+2] = i;
- ((char*)data)[i*3+0] = 0;
- ((char*)data)[i*3+1] = 0;
-
- } else {
- ((char*)data)[i*3+2] = -(i+1);
- ((char*)data)[i*3+0] = -1;
- ((char*)data)[i*3+1] = -1;
- }
- }
-
- /* Set the property for handling overflowing data */
- dxpl_id = H5Pcreate(H5P_DATASET_XFER);
-
- /* First verify it's TRUE by default */
- H5Pget_enum_conv_overflow(dxpl_id, &conv_overflow);
- if(!conv_overflow)
- nerrors++;
-
- /* Then set it to FALSE */
- H5Pset_enum_conv_overflow(dxpl_id, FALSE);
-
- /* Convert to destination type */
- H5Tconvert(srctype, dsttype, (size_t)NTESTELEM, data, NULL, dxpl_id);
-
- /* Check results. All overflowing values should turn to -1. */
- for (i=0; i<NTESTELEM; i++) {
- if(i > 255) {
- if (data[i] != i%8) {
- if (!nerrors++) {
- H5_FAILED();
- printf("element %d is %d but should have been %d\n",
- i, data[i], i%8);
- }
- }
- } else {
- if (data[i] != -1) {
- if (!nerrors++) {
- H5_FAILED();
- printf("element %d is %d but should have been -1\n",
- i, data[i]);
- }
- }
- }
- }
-
/* Cleanup */
free(data);
H5Tclose(srctype);
H5Tclose(dsttype);
H5Tclose(oddsize);
- H5Pclose(dxpl_id);
/* Failure */
if (nerrors) {