コード例 #1
0
        public void H5Pget_virtual_dsetnameTestVDS1()
        {
            hid_t vds = H5D.open(m_vds_class_file, "VDS");

            Assert.IsTrue(vds >= 0);

            hid_t dcpl = H5D.get_create_plist(vds);

            Assert.IsTrue(dcpl >= 0);

            IntPtr count = IntPtr.Zero;

            Assert.IsTrue(H5P.get_virtual_count(dcpl, ref count) >= 0);
            Assert.IsTrue(3 == count.ToInt32());

            string[] names = { "A", "B", "C" };

            for (int i = 0; i < count.ToInt32(); ++i)
            {
                size_t  index = new ssize_t(i);
                ssize_t len   = H5P.get_virtual_filename(dcpl, index, null,
                                                         IntPtr.Zero);
                Assert.IsTrue(len.ToInt32() > 0);
                StringBuilder name = new StringBuilder(len.ToInt32() + 1);
                len = H5P.get_virtual_dsetname(dcpl, index, name, len + 1);
                Assert.IsTrue(len.ToInt32() > 0);
                Assert.IsTrue(name.ToString() == names[i]);
            }

            Assert.IsTrue(H5P.close(dcpl) >= 0);
            Assert.IsTrue(H5D.close(vds) >= 0);
        }