} // test_getting_info static void Main(string[] args) { Console.WriteLine(); Console.WriteLine("TEST: HDF5DotNet High-level Table API"); Console.WriteLine(); try { // Suppress error printing from the C library. H5E.suppressPrinting(); make_table(); // create and write to a table to test test_getting_info(); // test getting table and field info } catch (HDFException anyHDF5E) { Console.WriteLine(anyHDF5E.Message); nerrors++; } catch (System.Exception sysE) { Console.WriteLine(sysE.TargetSite); Console.WriteLine(sysE.Message); nerrors++; } Console.WriteLine(); if (nerrors > 0) { Console.WriteLine("Test(s) failed: ", nerrors, "occurred!"); } else { Console.WriteLine("---- All table tests passed."); } Console.WriteLine(); }
} // test_copy static void Main(string[] args) { Console.WriteLine(); Console.WriteLine("TEST: HDF5DotNet Datatype API"); Console.WriteLine(); try { // Suppress error printing from the C library. H5E.suppressPrinting(); // Create the file H5FileId fileId = H5F.create("test_types.h5", H5F.CreateMode.ACC_TRUNC); // Invokes individual datatype tests test_classes(); test_integer_dtype(); test_float_dtype(); test_compound_dtype(fileId); test_enum_dtype(fileId); test_vlen_dtype(fileId); test_copy(); // Close the file H5F.close(fileId); } catch (HDFException anyHDF5E) { Console.WriteLine(anyHDF5E.Message); nerrors++; } catch (System.Exception sysE) { Console.WriteLine(sysE.TargetSite); Console.WriteLine(sysE.Message); nerrors++; } // Report results. Console.WriteLine(); if (nerrors > 0) { Console.WriteLine("Test(s) failed: {0}", nerrors, "occurred!"); } else { Console.WriteLine("---- All datatype tests passed."); } Console.WriteLine(); }
static void Main(string[] args) { Console.WriteLine(); Console.WriteLine("TEST: HDF5DotNet Dataset API"); Console.WriteLine(); try { const string FILE_NAME = ("Dataset.h5"); // Suppress error printing from the C library. H5E.suppressPrinting(); // Create a new file using H5F_ACC_TRUNC access, // default file creation properties, and default file // access properties. H5FileId fileId = H5F.create(FILE_NAME, H5F.CreateMode.ACC_TRUNC); test_create(fileId); // test creating dataset test_onedim_array(fileId); // test writing one-dimensional array test_twodims_array(); // test writing multiple-dimensional arrays test_fivedims_array(fileId); // Close the file. H5F.close(fileId); } catch (HDFException anyHDF5E) { Console.WriteLine(anyHDF5E.Message); nerrors++; } catch (System.Exception sysE) { Console.WriteLine(sysE.TargetSite); Console.WriteLine(sysE.Message); nerrors++; } Console.WriteLine(); if (nerrors > 0) { Console.WriteLine("Test(s) failed: ", nerrors, "occurred!"); } else { Console.WriteLine("---- All dataset tests passed."); } Console.WriteLine(); }
} // test_chunked_dset static void Main(string[] args) { Console.WriteLine(); Console.WriteLine("TEST: HDF5DotNet Property List API"); Console.WriteLine(); try { const string FILE_NAME = ("Dataset.h5"); // Suppress error printing from the C library. H5E.suppressPrinting(); // Create a new file using H5F_ACC_TRUNC access, // default file creation properties, and default file // access properties. H5FileId fileId = H5F.create(FILE_NAME, H5F.CreateMode.ACC_TRUNC); test_buffer(); test_chunked_dset(); // Close the file. H5F.close(fileId); } catch (HDFException anyHDF5E) { Console.WriteLine(anyHDF5E.Message); nerrors++; } catch (System.Exception sysE) { Console.WriteLine(sysE.TargetSite); Console.WriteLine(sysE.Message); nerrors++; } Console.WriteLine(); if (nerrors > 0) { Console.WriteLine("Test(s) failed: ", nerrors, "occurred!"); } else { Console.WriteLine("---- All property list tests passed."); } Console.WriteLine(); }
static void Main(string[] args) { Console.WriteLine(); Console.WriteLine("TEST: HDF5DotNet Attribute API"); Console.WriteLine(); try { // Suppress error printing from the C library. H5E.suppressPrinting(); test_attr_basic_write(); // test basic writing attributes test_attr_basic_read(); // test basic reading attributes test_attr_plist(); // test attribute property lists test_attr_compound_write(); // test writing compound values to attributes test_attr_compound_read(); // test reading compound values from attributes test_attr_iterate(); // test iterating attributes test_attr_delete(); // test deleting attributes } catch (HDFException anyHDF5E) { Console.WriteLine(anyHDF5E.Message); nerrors++; } catch (System.Exception sysE) { Console.WriteLine(sysE.TargetSite); Console.WriteLine(sysE.Message); nerrors++; } Console.WriteLine(); if (nerrors > 0) { Console.WriteLine("Test(s) failed: ", nerrors, "occurred!"); } else { Console.WriteLine("---- All attribute tests passed."); } Console.WriteLine(); }
} // test_group_info static void Main(string[] args) { Console.WriteLine(); Console.WriteLine("TEST: HDF5DotNet Group API"); Console.WriteLine(); try { // Suppress error printing from the C library. H5E.suppressPrinting(); test_group_basics(); test_group_iterate(); test_group_info(); } catch (HDFException anyHDF5E) { Console.WriteLine(anyHDF5E.Message); nerrors++; } catch (System.Exception sysE) { Console.WriteLine(sysE.TargetSite); Console.WriteLine(sysE.Message); nerrors++; } Console.WriteLine(); if (nerrors > 0) { Console.WriteLine("Test(s) failed: {0}", nerrors, "occurred!"); } else { Console.WriteLine("---- All group tests passed."); } Console.WriteLine(); }
} // test_select static void Main(string[] args) { Console.WriteLine(); Console.WriteLine("TEST: HDF5DotNet Dataspace API"); Console.WriteLine(); try { // Suppress error printing from the C library. H5E.suppressPrinting(); test_h5s_basic(); // test basic dataspace functionalities test_h5s_scalar(); // test scalar dataspace test_select(); // test dataspace select } catch (HDFException anyHDF5E) { Console.WriteLine(anyHDF5E.Message); nerrors++; } catch (System.Exception sysE) { Console.WriteLine(sysE.TargetSite); Console.WriteLine(sysE.Message); nerrors++; } Console.WriteLine(); if (nerrors > 0) { Console.WriteLine("Test failed: ", nerrors, "occurred!"); } else { Console.WriteLine("All dataspace tests passed."); } Console.WriteLine(); }