public static unsafe void AddOpaque(long fileId, ContainerType container)
        {
            long res;

            var length = (ulong)TestData.SmallData.Length * 2;
            var typeId = H5T.create(H5T.class_t.OPAQUE, new IntPtr(2));

            res = H5T.set_tag(typeId, "Opaque Test Tag");

            TestUtils.Add(container, fileId, "opaque", "opaque", typeId, TestData.SmallData.AsSpan(), length);

            res = H5T.close(typeId);
        }
Exemple #2
0
        public void H5Tget_tagTest1()
        {
            hid_t dtype = H5T.create(H5T.class_t.OPAQUE, new IntPtr(1024));

            Assert.IsTrue(dtype >= 0);

            Assert.IsTrue(
                H5T.set_tag(dtype, "Mary had a little lamb...") >= 0);

            IntPtr tag = H5T.get_tag(dtype);

            Assert.IsTrue(tag.ToInt64() >= 0);

            Assert.IsTrue(Marshal.PtrToStringAnsi(tag)
                          == "Mary had a little lamb...");

            Assert.IsTrue(H5.free_memory(tag) >= 0);

            Assert.IsTrue(H5T.close(dtype) >= 0);
        }