Пример #1
0
 public void H5Oget_info_by_nameTest2()
 {
     H5O.info_t info = new H5O.info_t();
     Assert.IsFalse(
         H5O.get_info_by_name(Utilities.RandomInvalidHandle(), ".",
         ref info) >= 0);
 }
Пример #2
0
 public void H5Oget_info_by_idxTest2()
 {
     H5O.info_t info = new H5O.info_t();
     Assert.IsFalse(
         H5O.get_info_by_idx(Utilities.RandomInvalidHandle(), "A",
         H5.index_t.NAME, H5.iter_order_t.NATIVE, 44, ref info) >= 0);
 }
Пример #3
0
        public void H5Oget_info_by_idxTest1()
        {
            Assert.IsTrue(
                H5G.close(H5G.create(m_v0_test_file, "A")) >= 0);
            Assert.IsTrue(
                H5G.close(H5G.create(m_v0_test_file, "AA")) >= 0);
            Assert.IsTrue(
                H5G.close(H5G.create(m_v0_test_file, "AAA")) >= 0);
            Assert.IsTrue(
                H5G.close(H5G.create(m_v0_test_file, "AAAA")) >= 0);            

            H5O.info_t info = new H5O.info_t();
            Assert.IsTrue(H5O.get_info_by_idx(m_v0_test_file, ".",
                H5.index_t.NAME, H5.iter_order_t.NATIVE, 2, ref info) >= 0);
            Assert.IsTrue(info.type == H5O.type_t.GROUP);

            Assert.IsTrue(
                H5G.close(H5G.create(m_v2_test_file, "A")) >= 0);
            Assert.IsTrue(
                H5G.close(H5G.create(m_v2_test_file, "AA")) >= 0);
            Assert.IsTrue(
                H5G.close(H5G.create(m_v2_test_file, "AAA")) >= 0);
            Assert.IsTrue(
                H5G.close(H5G.create(m_v2_test_file, "AAAA")) >= 0);

            info = new H5O.info_t();
            Assert.IsTrue(H5O.get_info_by_idx(m_v2_test_file, ".",
                H5.index_t.NAME, H5.iter_order_t.NATIVE, 2, ref info) >= 0);
            Assert.IsTrue(info.type == H5O.type_t.GROUP);
        }
Пример #4
0
        public void H5Oget_info_by_nameTest1()
        {
            Assert.IsTrue(
                H5G.close(H5G.create(m_v0_test_file, "A/B/C", m_lcpl)) >= 0);

            H5O.info_t info = new H5O.info_t();
            Assert.IsTrue(
                H5O.get_info_by_name(m_v0_test_file, "A/B", ref info) >= 0);
            Assert.IsTrue(info.type == H5O.type_t.GROUP);

            Assert.IsTrue(
                H5G.close(H5G.create(m_v2_test_file, "A/B/C", m_lcpl)) >= 0);

            info = new H5O.info_t();
            Assert.IsTrue(
                H5O.get_info_by_name(m_v2_test_file, "A/B", ref info) >= 0);
            Assert.IsTrue(info.type == H5O.type_t.GROUP);
        }
Пример #5
0
        public void H5Oget_infoTest1()
        {
            hid_t gid = H5G.create(m_v0_test_file, "A/B/C", m_lcpl);
            Assert.IsTrue(gid >= 0);

            H5O.info_t info = new H5O.info_t();
            Assert.IsTrue(H5O.get_info(gid, ref info) >= 0);
            Assert.IsTrue(info.type == H5O.type_t.GROUP);

            Assert.IsTrue(H5G.close(gid) >= 0);

            gid = H5G.create(m_v2_test_file, "A/B/C", m_lcpl);
            Assert.IsTrue(gid >= 0);

            info = new H5O.info_t();
            Assert.IsTrue(H5O.get_info(gid, ref info) >= 0);
            Assert.IsTrue(info.type == H5O.type_t.GROUP);

            Assert.IsTrue(H5G.close(gid) >= 0);
        }
Пример #6
0
        public void H5RdereferenceTest2()
        {
            byte[] path =
                Encoding.UTF8.GetBytes(String.Join("/", m_utf8strings));
            // make room for the trailling \0
            byte[] name = new byte[path.Length + 1];
            Array.Copy(path, name, path.Length);

            hid_t gid = H5G.create(m_v2_test_file, path, m_lcpl_utf8);
            Assert.IsTrue(gid >= 0);
            H5O.info_t info = new H5O.info_t();
            Assert.IsTrue(H5O.get_info(gid, ref info) >= 0);
            haddr_t address = info.addr;
            Assert.IsTrue(H5G.close(gid) >= 0);

            byte[] refer = new byte[H5R.OBJ_REF_BUF_SIZE];
            GCHandle hnd = GCHandle.Alloc(refer, GCHandleType.Pinned);

            Assert.IsTrue(
                H5R.create(hnd.AddrOfPinnedObject(), m_v2_test_file, name,
                H5R.type_t.OBJECT, -1) >= 0);

            #if HDF5_VER1_10
            gid = H5R.dereference(m_v2_test_file, H5P.DEFAULT,
                H5R.type_t.OBJECT, hnd.AddrOfPinnedObject());
            #else
            gid = H5R.dereference(m_v2_test_file, H5P.DEFAULT,
                hnd.AddrOfPinnedObject());
            #endif
            Assert.IsTrue(gid >= 0);

            hnd.Free();

            Assert.IsTrue(H5O.get_info(gid, ref info) >= 0);
            Assert.IsTrue(address == info.addr);
            Assert.IsTrue(H5G.close(gid) >= 0);
        }
Пример #7
0
        public void H5RdereferenceTest4()
        {
            byte[] path =
                   Encoding.UTF8.GetBytes(String.Join("/", m_utf8strings));
            // make room for the trailling \0
            byte[] name = new byte[path.Length + 1];
            Array.Copy(path, name, path.Length);

            hsize_t[] dims = new hsize_t[] { 10, 20 };
            hid_t space = H5S.create_simple(2, dims, null);
            Assert.IsTrue(space >= 0);
            hid_t dset = H5D.create(m_v2_test_file, name, H5T.STD_I32LE, space,
                m_lcpl_utf8);

            H5O.info_t info = new H5O.info_t();
            Assert.IsTrue(H5O.get_info(dset, ref info) >= 0);
            haddr_t address = info.addr;
            Assert.IsTrue(H5D.close(dset) >= 0);

            Assert.IsTrue(dset >= 0);
            hsize_t[] start = { 5, 10 };
            hsize_t[] count = { 1, 1 };
            hsize_t[] block = { 2, 4 };
            Assert.IsTrue(
                H5S.select_hyperslab(space, H5S.seloper_t.SET, start, null,
                count, block) >= 0);

            byte[] refer = new byte[H5R.DSET_REG_REF_BUF_SIZE];
            GCHandle hnd = GCHandle.Alloc(refer, GCHandleType.Pinned);

            Assert.IsTrue(
                H5R.create(hnd.AddrOfPinnedObject(), m_v2_test_file, name,
                H5R.type_t.DATASET_REGION, space) >= 0);

            #if HDF5_VER1_10
            dset = H5R.dereference(m_v2_test_file, H5P.DEFAULT,
                H5R.type_t.DATASET_REGION, hnd.AddrOfPinnedObject());
            #else
            dset = H5R.dereference(m_v2_test_file, H5R.type_t.DATASET_REGION,
                 hnd.AddrOfPinnedObject());
            #endif
            Assert.IsTrue(dset >= 0);

            hnd.Free();

            Assert.IsTrue(H5O.get_info(dset, ref info) >= 0);
            Assert.IsTrue(address == info.addr);
            Assert.IsTrue(H5D.close(dset) >= 0);

            Assert.IsTrue(H5S.close(space) >= 0);
        }