Пример #1
0
        public void TestReadStructure()
        {
            Hdf5.Settings.EnableErrorReporting(true);
            Hdf5Utils.LogWarning = (s) => Errors.Add(s);
            Hdf5Utils.LogError   = (s) => Errors.Add(s);
            string fileName = @"testfile.h5";

            if (File.Exists(fileName))
            {
                var tree = Hdf5.ReadTreeFileStructure(fileName);
                var flat = Hdf5.ReadFlatFileStructure(fileName);
                File.Delete(fileName);
                if (Errors.Any())
                {
                    foreach (string error in Errors)
                    {
                        Console.WriteLine(error);
                    }
                }
                Assert.IsFalse(File.Exists(fileName));
                Assert.IsTrue(tree != null);
                Assert.IsTrue(flat != null);
            }
        }