public void H5SencodeTest2() { size_t nalloc = IntPtr.Zero; Assert.IsFalse(H5S.encode(Utilities.RandomInvalidHandle(), null, ref nalloc) >= 0); }
public void H5SdecodeTest1() { hsize_t[] dims = { 1, 2, 3 }; hid_t space = H5S.create_simple(dims.Length, dims, dims); Assert.IsTrue(space > 0); size_t nalloc = new IntPtr(); Assert.IsTrue(H5S.encode(space, null, ref nalloc) >= 0); byte[] buf = new byte [nalloc.ToInt32()]; Assert.IsTrue(H5S.encode(space, buf, ref nalloc) >= 0); Assert.IsTrue(H5S.close(space) >= 0); space = H5S.decode(buf); Assert.IsTrue(space >= 0); Assert.IsTrue(H5S.get_simple_extent_ndims(space) == dims.Length); hsize_t[] tdims = new hsize_t[dims.Length]; Assert.IsTrue( H5S.get_simple_extent_dims(space, tdims, null) == dims.Length); for (int i = 0; i < dims.Length; ++i) { Assert.IsTrue(tdims[i] == dims[i]); } Assert.IsTrue(H5S.close(space) >= 0); }
public void H5SencodeTest1() { hsize_t[] dims = { 1, 2, 3 }; hid_t space = H5S.create_simple(dims.Length, dims, dims); Assert.IsTrue(space > 0); size_t nalloc = new IntPtr(); Assert.IsTrue(H5S.encode(space, null, ref nalloc) >= 0); byte[] buf = new byte [nalloc.ToInt32()]; Assert.IsTrue(H5S.encode(space, buf, ref nalloc) >= 0); Assert.IsTrue(H5S.close(space) >= 0); }