public void H5Pset_append_flushTestSWMR2() { hid_t dapl = H5P.create(H5P.DATASET_ACCESS); Assert.IsTrue(dapl >= 0); hsize_t[] boundary = { 1, 1 }; H5D.append_cb_t cb = append_func; Assert.IsTrue( H5P.set_append_flush(dapl, 2, boundary, cb, IntPtr.Zero) >= 0); hsize_t[] check_boundary = { 0, 0, 0 }; H5D.append_cb_t check_cb = null; IntPtr check_ptr = new IntPtr(4711); Assert.IsTrue( H5P.get_append_flush(dapl, 2, check_boundary, ref check_cb, ref check_ptr) >= 0); Assert.IsTrue(check_boundary[0] == 1); Assert.IsTrue(check_boundary[1] == 1); Assert.IsTrue(check_boundary[2] == 0); Assert.IsTrue(check_cb == cb); Assert.IsTrue(check_ptr == IntPtr.Zero); Assert.IsTrue(H5P.close(dapl) >= 0); }
public void H5DOappendTestSWMR1() { hsize_t[] dims = { 6, 0 }; hsize_t[] maxdims = { 6, H5S.UNLIMITED }; hsize_t[] chunk_dims = { 2, 5 }; int[] cbuf = new int [6]; hid_t dsp = H5S.create_simple(2, dims, maxdims); Assert.IsTrue(dsp >= 0); hid_t dcpl = H5P.create(H5P.DATASET_CREATE); Assert.IsTrue(dcpl >= 0); Assert.IsTrue(H5P.set_chunk(dcpl, 2, chunk_dims) >= 0); hsize_t[] boundary = { 0, 1 }; hid_t dapl = H5P.create(H5P.DATASET_ACCESS); Assert.IsTrue(dapl >= 0); H5D.append_cb_t cb = DOappend_func; Assert.IsTrue( H5P.set_append_flush(dapl, 2, boundary, cb, new IntPtr(99)) >= 0); hid_t dst = H5D.create(m_v3_test_file_swmr, "dset", H5T.NATIVE_INT, dsp, H5P.DEFAULT, dcpl, dapl); Assert.IsTrue(dst >= 0); GCHandle hnd = GCHandle.Alloc(cbuf, GCHandleType.Pinned); for (int i = 0; i < 3; ++i) { for (int j = 0; j < 6; ++j) { cbuf[j] = ((i * 6) + (j + 1)) * -1; } Assert.IsTrue( H5DO.append(dst, H5P.DEFAULT, 1, new IntPtr(1), H5T.NATIVE_INT, hnd.AddrOfPinnedObject()) >= 0); } hnd.Free(); Assert.IsTrue(H5D.close(dst) >= 0); Assert.IsTrue(H5P.close(dapl) >= 0); Assert.IsTrue(H5P.close(dcpl) >= 0); Assert.IsTrue(H5S.close(dsp) >= 0); }
public void H5Pset_append_flushTestSWMR1() { hid_t dapl = H5P.create(H5P.DATASET_ACCESS); Assert.IsTrue(dapl >= 0); hsize_t[] boundary = { 1, 1 }; H5D.append_cb_t cb = append_func; Assert.IsTrue( H5P.set_append_flush(dapl, 2, boundary, cb, IntPtr.Zero) >= 0); Assert.IsTrue(H5P.close(dapl) >= 0); }