@@ -3360,10 +3360,10 @@ test_h5s_bug3(void)
3360
3360
hid_t space3 = H5I_INVALID_HID ;
3361
3361
3362
3362
space1 = H5Screate_simple (1 , dims , NULL );
3363
- CHECK (space1 , FAIL , "H5Screate_simple" );
3363
+ CHECK (space1 , H5I_INVALID_HID , "H5Screate_simple" );
3364
3364
3365
3365
space2 = H5Screate_simple (1 , dims , NULL );
3366
- CHECK (space2 , FAIL , "H5Screate_simple" );
3366
+ CHECK (space2 , H5I_INVALID_HID , "H5Screate_simple" );
3367
3367
3368
3368
/* Select a single, different element in each dataspace */
3369
3369
start [0 ] = 0 ;
@@ -3382,7 +3382,7 @@ test_h5s_bug3(void)
3382
3382
* wasn't a hyperslab.
3383
3383
*/
3384
3384
space3 = H5Scombine_select (space1 , H5S_SELECT_AND , space2 );
3385
- CHECK (space3 , FAIL , "H5Scombine_select" );
3385
+ CHECK (space3 , H5I_INVALID_HID , "H5Scombine_select" );
3386
3386
3387
3387
/* Close dataspaces */
3388
3388
ret = H5Sclose (space1 );
@@ -3393,6 +3393,40 @@ test_h5s_bug3(void)
3393
3393
CHECK (ret , FAIL , "H5Sclose" );
3394
3394
} /* test_h5s_bug3() */
3395
3395
3396
+ /****************************************************************
3397
+ **
3398
+ ** test_h5s_bug4(): Test copying a dataspace with a point
3399
+ ** selection after the dataspace's extent has
3400
+ ** been reset with H5Sset_extent_none().
3401
+ **
3402
+ ****************************************************************/
3403
+ static void
3404
+ test_h5s_bug4 (void )
3405
+ {
3406
+ hsize_t dims [] = {10 };
3407
+ hsize_t points [] = {0 };
3408
+ herr_t ret = SUCCEED ;
3409
+ hid_t space_id = H5I_INVALID_HID ;
3410
+ hid_t space_copy_id = H5I_INVALID_HID ;
3411
+
3412
+ space_id = H5Screate_simple (1 , dims , NULL );
3413
+ CHECK (space_id , H5I_INVALID_HID , "H5Screate_simple" );
3414
+
3415
+ ret = H5Sselect_elements (space_id , H5S_SELECT_SET , 1 , points );
3416
+ CHECK (ret , FAIL , "H5Sselect_elements" );
3417
+
3418
+ ret = H5Sset_extent_none (space_id );
3419
+ CHECK (ret , FAIL , "H5Sselect_elements" );
3420
+
3421
+ space_copy_id = H5Scopy (space_id );
3422
+ CHECK (space_id , H5I_INVALID_HID , "H5Screate_simple" );
3423
+
3424
+ ret = H5Sclose (space_copy_id );
3425
+ CHECK (ret , FAIL , "H5Sclose" );
3426
+ ret = H5Sclose (space_id );
3427
+ CHECK (ret , FAIL , "H5Sclose" );
3428
+ } /* test_h5s_bug4() */
3429
+
3396
3430
/*-------------------------------------------------------------------------
3397
3431
* Function: test_versionbounds
3398
3432
*
@@ -3577,6 +3611,7 @@ test_h5s(void H5_ATTR_UNUSED *params)
3577
3611
test_h5s_bug1 (); /* Test bug in offset initialization */
3578
3612
test_h5s_bug2 (); /* Test bug found in H5S__hyper_update_diminfo() */
3579
3613
test_h5s_bug3 (); /* Test bug found in H5S__combine_select() */
3614
+ test_h5s_bug4 (); /* Test bug in point selection copying */
3580
3615
test_versionbounds (); /* Test version bounds with dataspace */
3581
3616
} /* test_h5s() */
3582
3617
0 commit comments