Commit 30ceb2f5 authored by Giovanni La Mura's avatar Giovanni La Mura
Browse files

Prepare valgrind output tests

parent c3111f39
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -692,6 +692,8 @@ ClusterOutputInfo::ClusterOutputInfo(const std::string &hdf5_file_name) {
    status = hdf_file->read("VEC_DIR_MULC", str_type, vec_dir_mulc);
    vec_dir_mulclr = new double[16 * ndirs * xi_block_size];
    status = hdf_file->read("VEC_DIR_MULCLR", str_type, vec_dir_mulclr);
    status = hdf_file->close();
    delete hdf_file;
  } else {
    if (hdf_file != NULL) delete hdf_file;
    UnrecognizedFormatException ex("Error: " + hdf5_file_name + " not recognized as a valid HDF5 file!");
+15 −1
Original line number Diff line number Diff line
@@ -22,17 +22,31 @@

using namespace std;

int test_cluster_hdf5_output();
int test_cluster_case_3();

int main() {
  int result = 0;
  // result += test_sphere(); // 1 if failed
  result += test_cluster_hdf5_output(); // 1 if failed
  // result += test_cluster_devel(); // 10 if failed
  result += test_cluster_case_3(); // 100 if failed
  // result += test_inclusion(); // 1000 if failed
  return result;
}

int test_cluster_hdf5_output() {
  int result = 0;
  try {
    const string hdf5_file = "../../test_data/cluster/c_OCLU_24.hd5";
    ClusterOutputInfo *oi = new ClusterOutputInfo(hdf5_file);
    oi->write("c_OCLU_24", "LEGACY");
    delete oi;
  } catch (const exception& ex) {
    result = 1;
  }
  return result;
}

int test_cluster_case_3() {
  int result = 0;
  try {