hdf5/java/test/TestH5S.java

661 lines
22 KiB
Java
Raw Normal View History

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the COPYING file, which can be found at the root of the source code *
* distribution tree, or in https://www.hdfgroup.org/licenses. *
* If you do not have access to either file, you may request a copy from *
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
package test;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
2022-04-20 02:08:09 +08:00
import hdf.hdf5lib.H5;
import hdf.hdf5lib.HDF5Constants;
import hdf.hdf5lib.exceptions.HDF5Exception;
import hdf.hdf5lib.exceptions.HDF5LibraryException;
import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TestName;
public class TestH5S {
2022-04-20 02:08:09 +08:00
@Rule
public TestName testname = new TestName();
long H5sid = HDF5Constants.H5I_INVALID_HID;
int H5rank = 2;
long H5dims[] = {5, 5};
long H5maxdims[] = {10, 10};
@Before
2022-04-20 02:08:09 +08:00
public void createH5file() throws NullPointerException, HDF5Exception
{
assertTrue("H5 open ids is 0", H5.getOpenIDCount() == 0);
System.out.print(testname.getMethodName());
H5sid = H5.H5Screate_simple(H5rank, H5dims, H5maxdims);
assertTrue("H5.H5Screate_simple_extent", H5sid > 0);
}
@After
2022-04-20 02:08:09 +08:00
public void deleteH5file() throws HDF5LibraryException
{
if (H5sid > 0) {
2022-04-20 02:08:09 +08:00
try {
H5.H5Sclose(H5sid);
}
catch (Exception ex) {
}
}
System.out.println();
}
@Test
2022-04-20 02:08:09 +08:00
public void testH5Sget_simple_extent_ndims()
{
int read_rank = -1;
try {
read_rank = H5.H5Sget_simple_extent_ndims(H5sid);
assertTrue("H5.H5Sget_simple_extent_ndims", H5rank == read_rank);
}
catch (Throwable err) {
err.printStackTrace();
fail("H5.H5Sget_simple_extent_ndims: " + err);
}
}
@Test
2022-04-20 02:08:09 +08:00
public void testH5Sget_simple_extent_dims_null()
{
int read_rank = -1;
try {
read_rank = H5.H5Sget_simple_extent_dims(H5sid, null, null);
assertTrue("H5.H5Sget_simple_extent_dims", H5rank == read_rank);
}
catch (Throwable err) {
err.printStackTrace();
fail("H5.H5Sget_simple_extent_dims: " + err);
}
}
@Test
2022-04-20 02:08:09 +08:00
public void testH5Sget_simple_extent_dims()
{
int read_rank = -1;
long dims[] = {5, 5};
long maxdims[] = {10, 10};
try {
read_rank = H5.H5Sget_simple_extent_dims(H5sid, dims, maxdims);
assertTrue("H5.H5Sget_simple_extent_dims", H5rank == read_rank);
assertTrue("H5.H5Sget_simple_extent_dims:dims", H5dims[0] == dims[0]);
assertTrue("H5.H5Sget_simple_extent_dims:maxdims", H5maxdims[0] == maxdims[0]);
}
catch (Throwable err) {
err.printStackTrace();
fail("H5.H5Sget_simple_extent_dims: " + err);
}
}
@Test
2022-04-20 02:08:09 +08:00
public void testH5Sget_simple_extent_npoints()
{
long num_elements = -1;
try {
num_elements = H5.H5Sget_simple_extent_npoints(H5sid);
2022-04-20 02:08:09 +08:00
assertTrue("H5.H5Sget_simple_extent_npoints", (H5dims[0] * H5dims[1]) == num_elements);
}
catch (Throwable err) {
err.printStackTrace();
fail("H5.H5Sget_simple_extent_npoints: " + err);
}
}
@Test
2022-04-20 02:08:09 +08:00
public void testH5Sget_simple_extent_type()
{
int read_type = -1;
try {
read_type = H5.H5Sget_simple_extent_type(H5sid);
assertTrue("H5.H5Sget_simple_extent_type", HDF5Constants.H5S_SIMPLE == read_type);
}
catch (Throwable err) {
err.printStackTrace();
fail("H5.H5Sget_simple_extent_type: " + err);
}
}
@Test
2022-04-20 02:08:09 +08:00
public void testH5Sis_simple()
{
boolean result = false;
try {
result = H5.H5Sis_simple(H5sid);
assertTrue("H5.H5Sis_simple", result);
}
catch (Throwable err) {
err.printStackTrace();
fail("H5.H5Sis_simple: " + err);
}
}
@Test
2022-04-20 02:08:09 +08:00
public void testH5Sset_extent_simple()
{
long num_elements = -1;
try {
H5.H5Sset_extent_simple(H5sid, H5rank, H5maxdims, H5maxdims);
num_elements = H5.H5Sget_simple_extent_npoints(H5sid);
2022-04-20 02:08:09 +08:00
assertTrue("H5.H5Sget_simple_extent_npoints", (H5maxdims[0] * H5maxdims[1]) == num_elements);
}
catch (Throwable err) {
err.printStackTrace();
fail("H5.H5Sset_extent_simple: " + err);
}
}
@Test
2022-04-20 02:08:09 +08:00
public void testH5Sget_select_type()
{
int read_type = -1;
try {
read_type = H5.H5Sget_select_type(H5sid);
assertTrue("H5.H5Sget_select_type", HDF5Constants.H5S_SEL_ALL == read_type);
}
catch (Throwable err) {
err.printStackTrace();
fail("H5.H5Sset_extent_none: " + err);
}
}
@Test
2022-04-20 02:08:09 +08:00
public void testH5Sset_extent_none()
{
int read_type = -1;
try {
H5.H5Sset_extent_none(H5sid);
read_type = H5.H5Sget_simple_extent_type(H5sid);
2022-04-20 02:08:09 +08:00
assertTrue("H5.H5Sget_simple_extent_type: " + read_type, HDF5Constants.H5S_NULL == read_type);
}
catch (Throwable err) {
err.printStackTrace();
fail("H5.H5Sset_extent_none: " + err);
}
}
@Test
2022-04-20 02:08:09 +08:00
public void testH5Scopy()
{
long sid = HDF5Constants.H5I_INVALID_HID;
int read_rank = -1;
try {
sid = H5.H5Scopy(H5sid);
assertTrue("H5.H5Sis_simple", sid > 0);
read_rank = H5.H5Sget_simple_extent_ndims(sid);
assertTrue("H5.H5Screate_simple_extent_ndims", H5rank == read_rank);
}
catch (Throwable err) {
err.printStackTrace();
fail("H5.H5Scopy: " + err);
}
finally {
2022-04-20 02:08:09 +08:00
try {
H5.H5Sclose(sid);
}
catch (Exception ex) {
}
}
}
@Test
2022-04-20 02:08:09 +08:00
public void testH5Sextent_copy()
{
long sid = HDF5Constants.H5I_INVALID_HID;
int class_type = -1;
try {
sid = H5.H5Screate(HDF5Constants.H5S_NULL);
assertTrue("H5.H5Screate_null", sid > 0);
H5.H5Sextent_copy(sid, H5sid);
class_type = H5.H5Sget_simple_extent_type(sid);
assertTrue("H5.H5Screate_null: type", class_type == HDF5Constants.H5S_SIMPLE);
}
catch (Throwable err) {
err.printStackTrace();
fail("H5.H5Sextent_copy: " + err);
}
finally {
2022-04-20 02:08:09 +08:00
try {
H5.H5Sclose(sid);
}
catch (Exception ex) {
}
}
}
@Test
2022-04-20 02:08:09 +08:00
public void testH5Sextent_equal()
{
long sid = HDF5Constants.H5I_INVALID_HID;
boolean result = false;
try {
sid = H5.H5Screate(HDF5Constants.H5S_NULL);
2022-04-20 02:08:09 +08:00
assertTrue("H5.H5Screate_null", sid > 0);
}
catch (Throwable err) {
err.printStackTrace();
fail("H5.H5Screate: null " + err);
}
try {
result = H5.H5Sextent_equal(sid, H5sid);
2022-04-20 02:08:09 +08:00
assertFalse("H5.testH5Sextent_equal", result);
H5.H5Sextent_copy(sid, H5sid);
result = H5.H5Sextent_equal(sid, H5sid);
assertTrue("H5.testH5Sextent_equal", result);
}
catch (Throwable err) {
err.printStackTrace();
fail("H5.H5Sextent_copy " + err);
}
finally {
2022-04-20 02:08:09 +08:00
try {
H5.H5Sclose(sid);
}
catch (Exception ex) {
}
}
}
@Test
2022-04-20 02:08:09 +08:00
public void testH5Sencode_decode_null_dataspace()
{
long sid = HDF5Constants.H5I_INVALID_HID;
Primary change is HDFFV-11212 - new refs and JNI (#372) * OESS-98 convert plugin option to FetchContent, add tests * Fixes for pkcfg files because of plugin option * OESS-98 fix tools test for plugins * Keep doxygen comments under 100 chars long - format hint * Whitespace * HDFFV-11144 - Reclassify CMake messages * HDFFV-11099/11100 added help text * Reworked switch statement to compare string instead * Fix typo * Update CDash mode * Correct name of threadsafe * Correct option name * Undo accidental commit * Note LLVM 10 to 11 format default changes * Update format plugin * Undo clang-format version 11 changes * One more correction * Update supported platforms * Revert whitespace changes * Correct whitespace * Changes from PR#3 * HDFFV-11213 added option to control gcc10 warnings diagnostics * HDFFV-11212 Use the new references correctly in JNI utility and tests * format source * Fix typo * Add new test file * HDFFV-11212 - update test and remove unused arg * Minor non-space formatting changes * Use H5I_INVALID_ID instead of "-1" * source formatting * add missing testfile, update jni function * Undo commit of debug code * remove mislocated file * Fix h5repack test for handling of fapls and id close * Update h5diff test files usage text * HDFFV-11212 add new ref tests for JNI export dataset * src format update * Remove blank line typo * src format typo * long double requires %Lg * Another long double foramt specifer S.B. %Lg * issue with t128bit test * Windows issue with h5dump and type. * Fix review issues * refactor function nesting and fix error checks * format fixes * Remove untested functions and javadoc quiet comments * Restore TRY block. * Change string append errors to memory exception * revert to H5_JNI_FATAL_ERROR - support functions need work * Add assertion error for h5util functions * remove duplicate function * format fix * Revert HD function error handling * Update copyright comments
2021-02-26 05:12:57 +08:00
long decoded_sid = HDF5Constants.H5I_INVALID_HID;
byte[] null_sbuf = null;
2022-04-20 02:08:09 +08:00
boolean result = false;
try {
sid = H5.H5Screate(HDF5Constants.H5S_NULL);
assertTrue("H5.H5Screate_null", sid > 0);
}
catch (Throwable err) {
err.printStackTrace();
fail("H5.H5Screate: null " + err);
}
try {
null_sbuf = H5.H5Sencode(sid);
2022-04-20 02:08:09 +08:00
assertFalse("H5.testH5Sencode", null_sbuf == null);
}
catch (Throwable err) {
err.printStackTrace();
fail("H5.H5Sencode " + err);
}
finally {
2022-04-20 02:08:09 +08:00
if (null_sbuf == null) {
try {
H5.H5Sclose(sid);
}
catch (Exception ex) {
}
}
}
try {
decoded_sid = H5.H5Sdecode(null_sbuf);
2022-04-20 02:08:09 +08:00
assertTrue("H5.testH5Sdecode", decoded_sid > 0);
result = H5.H5Sextent_equal(sid, decoded_sid);
assertTrue("H5.testH5Sextent_equal", result);
}
catch (Throwable err) {
err.printStackTrace();
fail("H5.H5Sdecode " + err);
}
finally {
2022-04-20 02:08:09 +08:00
try {
H5.H5Sclose(decoded_sid);
}
catch (Exception ex) {
}
try {
H5.H5Sclose(sid);
}
catch (Exception ex) {
}
}
}
@Test
2022-04-20 02:08:09 +08:00
public void testH5Sencode_decode_scalar_dataspace()
{
long sid = HDF5Constants.H5I_INVALID_HID;
long decoded_sid = HDF5Constants.H5I_INVALID_HID;
byte[] scalar_sbuf = null;
2022-04-20 02:08:09 +08:00
boolean result = false;
int iresult = -1;
long lresult = -1;
try {
sid = H5.H5Screate(HDF5Constants.H5S_SCALAR);
assertTrue("H5.H5Screate_null", sid > 0);
}
catch (Throwable err) {
err.printStackTrace();
fail("H5.H5Screate: null " + err);
}
try {
scalar_sbuf = H5.H5Sencode(sid);
2022-04-20 02:08:09 +08:00
assertFalse("H5.testH5Sencode", scalar_sbuf == null);
}
catch (Throwable err) {
err.printStackTrace();
fail("H5.H5Sencode " + err);
}
finally {
2022-04-20 02:08:09 +08:00
if (scalar_sbuf == null) {
try {
H5.H5Sclose(sid);
}
catch (Exception ex) {
}
}
}
try {
decoded_sid = H5.H5Sdecode(scalar_sbuf);
2022-04-20 02:08:09 +08:00
assertTrue("H5.testH5Sdecode", decoded_sid > 0);
result = H5.H5Sextent_equal(sid, decoded_sid);
assertTrue("H5.testH5Sextent_equal", result);
/* Verify decoded dataspace */
lresult = H5.H5Sget_simple_extent_npoints(decoded_sid);
2022-04-20 02:08:09 +08:00
assertTrue("H5.testH5Sget_simple_extent_npoints", lresult == 1);
iresult = H5.H5Sget_simple_extent_ndims(decoded_sid);
2022-04-20 02:08:09 +08:00
assertTrue("H5.testH5Sget_simple_extent_ndims", iresult == 0);
}
catch (Throwable err) {
err.printStackTrace();
fail("H5.H5Sdecode " + err);
}
finally {
2022-04-20 02:08:09 +08:00
try {
H5.H5Sclose(decoded_sid);
}
catch (Exception ex) {
}
try {
H5.H5Sclose(sid);
}
catch (Exception ex) {
}
}
}
@Test
2022-04-20 02:08:09 +08:00
public void testH5Sselect_none()
{
int read_type = -1;
try {
H5.H5Sselect_none(H5sid);
read_type = H5.H5Sget_select_type(H5sid);
2022-04-20 02:08:09 +08:00
assertTrue("H5.H5Sget_select_type: " + read_type, HDF5Constants.H5S_SEL_NONE == read_type);
H5.H5Sselect_all(H5sid);
read_type = H5.H5Sget_select_type(H5sid);
2022-04-20 02:08:09 +08:00
assertTrue("H5.H5Sget_select_type: " + read_type, HDF5Constants.H5S_SEL_ALL == read_type);
}
catch (Throwable err) {
err.printStackTrace();
fail("H5.H5Sset_extent_none: " + err);
}
}
@Test
2022-04-20 02:08:09 +08:00
public void testH5Sget_select_npoints()
{
long coord[][] = {{0, 1}, {2, 4}, {5, 6}}; /* Coordinates for point selection */
long num_elements = -1;
try {
H5.H5Sselect_elements(H5sid, HDF5Constants.H5S_SELECT_SET, 3, coord);
num_elements = H5.H5Sget_select_npoints(H5sid);
2022-04-20 02:08:09 +08:00
assertTrue("H5.H5Sget_select_npoints: " + num_elements, 3 == num_elements);
}
catch (Throwable err) {
err.printStackTrace();
fail("H5.H5Sget_select_npoints: " + err);
}
}
@Test(expected = IllegalArgumentException.class)
2022-04-20 02:08:09 +08:00
public void testH5Sget_select_elem_pointlist_invalid() throws Throwable
{
long coord[][] = {{0, 1}, {2, 4}, {5, 6}}; /* Coordinates for point selection */
long getcoord[] = {-1, -1}; /* Coordinates for get point selection */
try {
H5.H5Sselect_elements(H5sid, HDF5Constants.H5S_SELECT_SET, 3, coord);
}
catch (Throwable err) {
err.printStackTrace();
fail("H5.H5Sget_select_elem_pointlist: " + err);
}
H5.H5Sget_select_elem_pointlist(H5sid, 0, 3, getcoord);
}
@Test
2022-04-20 02:08:09 +08:00
public void testH5Sget_select_elem_pointlist()
{
long coord[][] = {{0, 1}, {2, 3}, {4, 5}}; /* Coordinates for point selection */
long getcoord[] = {-1, -1, -1, -1, -1, -1}; /* Coordinates for get point selection */
try {
H5.H5Sselect_elements(H5sid, HDF5Constants.H5S_SELECT_SET, 3, coord);
H5.H5Sget_select_elem_pointlist(H5sid, 0, 3, getcoord);
assertTrue("H5.H5Sget_select_elem_pointlist", coord[0][0] == getcoord[0]);
assertTrue("H5.H5Sget_select_elem_pointlist", coord[0][1] == getcoord[1]);
assertTrue("H5.H5Sget_select_elem_pointlist", coord[1][0] == getcoord[2]);
assertTrue("H5.H5Sget_select_elem_pointlist", coord[1][1] == getcoord[3]);
assertTrue("H5.H5Sget_select_elem_pointlist", coord[2][0] == getcoord[4]);
assertTrue("H5.H5Sget_select_elem_pointlist", coord[2][1] == getcoord[5]);
}
catch (Throwable err) {
err.printStackTrace();
fail("H5.H5Sget_select_elem_pointlist: " + err);
}
}
@Test
2022-04-20 02:08:09 +08:00
public void testH5Sget_select_bounds()
{
long lowbounds[] = {-1, -1};
long hibounds[] = {-1, -1};
try {
H5.H5Sget_select_bounds(H5sid, lowbounds, hibounds);
assertTrue("H5.H5Sget_select_bounds", 0 == lowbounds[0]);
assertTrue("H5.H5Sget_select_bounds", 0 == lowbounds[1]);
2022-04-20 02:08:09 +08:00
assertTrue("H5.H5Sget_select_bounds", (H5dims[0] - 1) == hibounds[0]);
assertTrue("H5.H5Sget_select_bounds", (H5dims[1] - 1) == hibounds[1]);
}
catch (Throwable err) {
err.printStackTrace();
fail("H5.H5Sget_select_bounds: " + err);
}
}
@Test
2022-04-20 02:08:09 +08:00
public void testH5Soffset_simple()
{
long coord[][] = {{2, 2}, {2, 4}, {4, 2}, {4, 4}}; /* Coordinates for point selection */
long lowbounds[] = {-1, -1};
long hibounds[] = {-1, -1};
try {
H5.H5Sselect_elements(H5sid, HDF5Constants.H5S_SELECT_SET, 4, coord);
H5.H5Sget_select_bounds(H5sid, lowbounds, hibounds);
assertTrue("H5.H5Sget_select_bounds", 2 == lowbounds[0]);
assertTrue("H5.H5Sget_select_bounds", 2 == lowbounds[1]);
2022-04-20 02:08:09 +08:00
assertTrue("H5.H5Sget_select_bounds", (H5dims[0] - 1) == hibounds[0]);
assertTrue("H5.H5Sget_select_bounds", (H5dims[1] - 1) == hibounds[1]);
}
catch (Throwable err) {
err.printStackTrace();
fail("H5.H5Sget_select_bounds: " + err);
}
try {
2022-04-20 02:08:09 +08:00
long offset[] = {-1, -1};
H5.H5Soffset_simple(H5sid, offset);
H5.H5Sget_select_bounds(H5sid, lowbounds, hibounds);
assertTrue("H5.H5Sget_select_bounds", 1 == lowbounds[0]);
assertTrue("H5.H5Sget_select_bounds", 1 == lowbounds[1]);
2022-04-20 02:08:09 +08:00
assertTrue("H5.H5Sget_select_bounds", (H5dims[0] - 2) == hibounds[0]);
assertTrue("H5.H5Sget_select_bounds", (H5dims[1] - 2) == hibounds[1]);
}
catch (Throwable err) {
err.printStackTrace();
fail("H5.H5Soffset_simple: " + err);
}
}
@Test
2022-04-20 02:08:09 +08:00
public void testH5Sget_select_hyper()
{
long space1 = HDF5Constants.H5I_INVALID_HID;
long start[] = {0, 0};
long stride[] = {1, 1};
long count[] = {1, 1};
long block[] = {4, 4};
long nblocks; // Number of hyperslab blocks
long blocks[] = {-1, -1, -1, -1, -1, -1, -1, -1}; // List of blocks
try {
// Copy "all" selection & space
space1 = H5.H5Scopy(H5sid);
assertTrue("H5.H5Scopy", H5sid > 0);
// 'AND' "all" selection with another hyperslab
H5.H5Sselect_hyperslab(space1, HDF5Constants.H5S_SELECT_AND, start, stride, count, block);
// Verify that there is only one block
nblocks = H5.H5Sget_select_hyper_nblocks(space1);
assertTrue("H5Sget_select_hyper_nblocks", nblocks == 1);
// Retrieve the block defined
H5.H5Sget_select_hyper_blocklist(space1, 0, nblocks, blocks);
// Verify that the correct block is defined
assertTrue("H5.H5Sget_select_hyper_blocklist", start[0] == blocks[0]);
assertTrue("H5.H5Sget_select_hyper_blocklist", start[1] == blocks[1]);
2022-04-20 02:08:09 +08:00
assertTrue("H5.H5Sget_select_hyper_blocklist", (block[0] - 1) == blocks[2]);
assertTrue("H5.H5Sget_select_hyper_blocklist", (block[1] - 1) == blocks[3]);
}
catch (Throwable err) {
err.printStackTrace();
fail("H5.H5Sget_select_bounds: " + err);
}
finally {
2022-04-20 02:08:09 +08:00
try {
H5.H5Sclose(space1);
}
catch (Exception ex) {
}
}
}
@Test
2022-04-20 02:08:09 +08:00
public void testH5Sget_select_valid()
{
long space1 = HDF5Constants.H5I_INVALID_HID;
long start[] = {1, 0};
long stride[] = {1, 1};
long count[] = {2, 3};
long block[] = {1, 1};
long offset[] = {0, 0}; // Offset of selection
try {
// Copy "all" selection & space
space1 = H5.H5Scopy(H5sid);
assertTrue("H5.H5Scopy", H5sid > 0);
// 'AND' "all" selection with another hyperslab
H5.H5Sselect_hyperslab(space1, HDF5Constants.H5S_SELECT_SET, start, stride, count, block);
// Check a valid offset
2022-04-20 02:08:09 +08:00
offset[0] = -1;
offset[1] = 0;
H5.H5Soffset_simple(space1, offset);
assertTrue("H5Sselect_valid", H5.H5Sselect_valid(space1));
// Check an invalid offset
2022-04-20 02:08:09 +08:00
offset[0] = 10;
offset[1] = 0;
H5.H5Soffset_simple(space1, offset);
assertFalse("H5Sselect_valid", H5.H5Sselect_valid(space1));
/* Reset offset */
2022-04-20 02:08:09 +08:00
offset[0] = 0;
offset[1] = 0;
H5.H5Soffset_simple(space1, offset);
assertTrue("H5Sselect_valid", H5.H5Sselect_valid(space1));
}
catch (Throwable err) {
err.printStackTrace();
fail("testH5Sget_select_valid: " + err);
}
finally {
2022-04-20 02:08:09 +08:00
try {
H5.H5Sclose(space1);
}
catch (Exception ex) {
}
}
}
@Test
2022-04-20 02:08:09 +08:00
public void testH5Shyper_regular()
{
long start[] = {1, 0};
long stride[] = {1, 1};
long count[] = {2, 3};
long block[] = {1, 1};
long q_start[] = new long[2];
long q_stride[] = new long[2];
long q_count[] = new long[2];
long q_block[] = new long[2];
boolean is_regular = false;
try {
// Set "regular" hyperslab selection
H5.H5Sselect_hyperslab(H5sid, HDF5Constants.H5S_SELECT_SET, start, stride, count, block);
// Query if 'hyperslab' selection is regular hyperslab (should be TRUE)
is_regular = H5.H5Sis_regular_hyperslab(H5sid);
assertTrue("H5.H5Sis_regular_hyperslab", is_regular);
// Retrieve the hyperslab parameters
H5.H5Sget_regular_hyperslab(H5sid, q_start, q_stride, q_count, q_block);
/* Verify the hyperslab parameters */
2022-04-20 02:08:09 +08:00
for (int u = 0; u < H5rank; u++) {
assertTrue("H5Sget_regular_hyperslab, start", start[u] == q_start[u]);
assertTrue("H5Sget_regular_hyperslab, stride", stride[u] == q_stride[u]);
assertTrue("H5Sget_regular_hyperslab, count", count[u] == q_count[u]);
assertTrue("H5Sget_regular_hyperslab, block", block[u] == q_block[u]);
} /* end for */
}
catch (Throwable err) {
err.printStackTrace();
fail("testH5Sget_select_valid: " + err);
}
}
}