Skip to content
Snippets Groups Projects
Commit b7108bf8 authored by Stéphane Del Pino's avatar Stéphane Del Pino
Browse files

Simply plugged try/catch in main

parent 5f2bc816
No related branches found
No related tags found
No related merge requests found
......@@ -119,7 +119,7 @@ int main(int argc, char *argv[])
// AcousticSolverTest acoustic_solver(number);
// method_cost_map["AcousticSolverTest"] = timer.seconds();
// }
try {
if (filename != "") {
std::cout << "Reading (gmsh) " << rang::style::underline << filename << rang::style::reset << " ...\n";
GmshReader gmsh_reader(filename);
......@@ -385,6 +385,11 @@ int main(int argc, char *argv[])
}
}
}
catch (const AssertError& error) {
std::cerr << error << '\n';
std::exit(1);
}
Kokkos::finalize();
......
#ifndef PASTIS_ASSERT_HPP
#define PASTIS_ASSERT_HPP
#ifdef NDEBUG
#warning check that this test does not degrade performaces
#define Assert(assertion) \
if (not (assertion)) false;
#else // NDEBUG
#include <rang.hpp>
#include <iostream>
#include <string>
......@@ -53,6 +45,14 @@ class AssertError
~AssertError() = default;
};
#ifdef NDEBUG
#warning check that this test does not degrade performaces
#define Assert(assertion) \
if (not (assertion)) false;
#else // NDEBUG
#define Assert(assertion) \
if (not (assertion)) { \
throw AssertError(__FILE__, \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment