public void DisposeOfProperly() { int N = H5Base.nObjects; using (H5File hf = H5File.Open(testfile, mode: "r")) { Assert.Equal(N + 2, H5Base.nObjects); // +file +root H5DataSet DSET = hf.Root["datasets/float2d"]; Assert.Equal(N + 3, H5Base.nObjects); // +dataset Assert.NotNull(DSET); Assert.Equal(2, DSET.Rank); Assert.Equal(Edge, DSET.Dims[0]); Assert.Equal(Edge, DSET.Dims[1]); Assert.Equal(Edge, DSET.MaxDims[0]); Assert.Equal(Edge, DSET.MaxDims[1]); Assert.Equal(Square, DSET.Length); Assert.Equal(typeof(float), DSET.PrimitiveType); // check, that the object count is stable.. Assert.Equal(N + 3, H5Base.nObjects); // +/- 0 DSET.Dispose(); Assert.Equal(N + 2, H5Base.nObjects); // -dataset } Assert.Equal(N + 0, H5Base.nObjects); // -root -file }
public void Properties() { using (H5File hf = H5File.Open(testfile, mode: "r")) { H5DataSet DSET = hf.Root["datasets/float2d"]; Assert.NotNull(DSET); Assert.Equal(2, DSET.Rank); Assert.Equal(Edge, DSET.Dims[0]); Assert.Equal(Edge, DSET.Dims[1]); Assert.Equal(Edge, DSET.MaxDims[0]); Assert.Equal(Edge, DSET.MaxDims[1]); Assert.Equal(Square, DSET.Length); Assert.Equal(typeof(float), DSET.PrimitiveType); DSET.Dispose(); } }