Skip to content
Snippets Groups Projects
Commit da04da2f authored by oliver.sander_at_tu-dresden.de's avatar oliver.sander_at_tu-dresden.de
Browse files

Modernize exception-handling

This fixes a few compiler warnings in the tests.
parent df446d07
Branches
No related tags found
No related merge requests found
Pipeline #27946 failed
......@@ -233,9 +233,9 @@ size_t checkWithHostGrid(size_t host_prerefine=2, int sub_initlevel=-1, size_t s
}
catch (Dune::NotImplemented& e)
{
std::cerr << e << std::endl;
} catch (Dune::Exception e) {
std::cerr << e <<std::endl;
std::cerr << e.what() << std::endl;
} catch (const Dune::Exception& e) {
std::cerr << e.what() <<std::endl;
ret = 1;
}
......@@ -245,9 +245,9 @@ size_t checkWithHostGrid(size_t host_prerefine=2, int sub_initlevel=-1, size_t s
}
catch (Dune::NotImplemented& e)
{
std::cerr << e << std::endl;
} catch (Dune::Exception e) {
std::cerr << e <<std::endl;
std::cerr << e.what() << std::endl;
} catch (const Dune::Exception& e) {
std::cerr << e.what() <<std::endl;
ret = 1;
}
try {
......@@ -255,9 +255,9 @@ size_t checkWithHostGrid(size_t host_prerefine=2, int sub_initlevel=-1, size_t s
checkLeafIntersections(subgrid);
} catch (Dune::NotImplemented& e)
{
std::cerr << e << std::endl;
} catch (Dune::Exception e) {
std::cerr << e <<std::endl;
std::cerr << e.what() << std::endl;
} catch (const Dune::Exception& e) {
std::cerr << e.what() <<std::endl;
ret = 1;
}
......@@ -285,9 +285,9 @@ size_t checkWithHostGrid(size_t host_prerefine=2, int sub_initlevel=-1, size_t s
}
catch (Dune::NotImplemented& e)
{
std::cerr << e << std::endl;
} catch (Dune::Exception e) {
std::cerr << e <<std::endl;
std::cerr << e.what() << std::endl;
} catch (const Dune::Exception& e) {
std::cerr << e.what() <<std::endl;
ret = 1;
}
try {
......@@ -296,9 +296,9 @@ size_t checkWithHostGrid(size_t host_prerefine=2, int sub_initlevel=-1, size_t s
}
catch (Dune::NotImplemented& e)
{
std::cerr << e << std::endl;
} catch (Dune::Exception e) {
std::cerr << e <<std::endl;
std::cerr << e.what() << std::endl;
} catch (const Dune::Exception& e) {
std::cerr << e.what() <<std::endl;
ret = 1;
}
try {
......@@ -307,9 +307,9 @@ size_t checkWithHostGrid(size_t host_prerefine=2, int sub_initlevel=-1, size_t s
}
catch (Dune::NotImplemented& e)
{
std::cerr << e << std::endl;
} catch (Dune::Exception e) {
std::cerr << e <<std::endl;
std::cerr << e.what() << std::endl;
} catch (const Dune::Exception& e) {
std::cerr << e.what() <<std::endl;
ret = 1;
}
......@@ -327,8 +327,8 @@ size_t checkWithHostGrid(size_t host_prerefine=2, int sub_initlevel=-1, size_t s
catch (Dune::NotImplemented& e)
{
std::cerr << e << std::endl;
} catch (Dune::Exception e) {
std::cerr << e <<std::endl;
} catch (const Dune::Exception& e) {
std::cerr << e.what() <<std::endl;
ret = 1;
}
/* // IntersectionIterator tests only make sense if coarse grid elements are fully covered by the subgrid
......@@ -336,11 +336,11 @@ size_t checkWithHostGrid(size_t host_prerefine=2, int sub_initlevel=-1, size_t s
std::cout << "Performing checkIntersectionIterator\n";
checkIntersectionIterator(subgrid);
}
catch (Dune::NotImplemented& e)
catch (const Dune::NotImplemented& e)
{
std::cerr << e << std::endl;
} catch (Dune::Exception e) {
std::cerr << e <<std::endl;
std::cerr << e.what() << std::endl;
} catch (const Dune::Exception& e) {
std::cerr << e.what() <<std::endl;
ret = 1;
}
*/
......@@ -350,9 +350,9 @@ size_t checkWithHostGrid(size_t host_prerefine=2, int sub_initlevel=-1, size_t s
}
catch (Dune::NotImplemented& e)
{
std::cerr << e << std::endl;
} catch (Dune::Exception e) {
std::cerr << e <<std::endl;
std::cerr << e.what() << std::endl;
} catch (const Dune::Exception& e) {
std::cerr << e.what() <<std::endl;
ret = 1;
}
......
......@@ -23,7 +23,7 @@ int main(int argc, char* argv[]) try {
std::cout << "Test for SubGrid with AlbertaGrid<2,2> " << (return_val==0 ? "passed." : "failed.") << std::endl;
return return_val;
} catch (Exception e) {
std::cout << e << std::endl;
} catch (const Exception& e) {
std::cout << e.what() << std::endl;
return 1;
}
......@@ -23,7 +23,7 @@ int main(int argc, char* argv[]) try {
std::cout << "Test for SubGrid with AlbertaGrid<3,3> " << (return_val==0 ? "passed." : "failed.") << std::endl;
return return_val;
} catch (Exception e) {
std::cout << e << std::endl;
} catch (const Exception& e) {
std::cout << e.what() << std::endl;
return 1;
}
......@@ -66,7 +66,7 @@ int main(int argc, char* argv[]) try {
std::cout << "Skip tests for ALUGrid, because it wasn't' found." << std::endl;
return 0;
#endif
} catch (Dune::Exception e) {
std::cout << e << std::endl;
} catch (const Dune::Exception& e) {
std::cout << e.what() << std::endl;
return 1;
}
......@@ -38,7 +38,7 @@ int main (int argc, char *argv[]) try
try {
gridcheck(subGrid);
checkIntersectionIterator(subGrid);
} catch(Dune::NotImplemented e) {
} catch(const Dune::NotImplemented& e) {
std::cout<<e<<std::endl;
}
......@@ -62,8 +62,8 @@ int main (int argc, char *argv[]) try
try{
gridcheck(subGrid);
checkIntersectionIterator(subGrid);
} catch(Dune::NotImplemented e) {
std::cout<<e<<std::endl;
} catch(const Dune::NotImplemented& e) {
std::cout << e.what() << std::endl;
}
return 0;
}
......@@ -71,7 +71,7 @@ int main (int argc, char *argv[]) try
// //////////////////////////////////
// Error handler
// /////////////////////////////////
catch (Exception e) {
std::cout << e << std::endl;
catch (const Exception& e) {
std::cout << e.what() << std::endl;
return 1;
}
......@@ -27,7 +27,7 @@ int main (int argc, char *argv[]) try
// //////////////////////////////////
// Error handler
// /////////////////////////////////
catch (Exception e) {
std::cout << e << std::endl;
catch (const Exception& e) {
std::cout << e.what() << std::endl;
return 1;
}
......@@ -60,8 +60,8 @@ size_t testDim()
gridcheck(subGrid);
checkIntersectionIterator(subGrid);
checkLeafIntersections(subGrid);
} catch(Dune::NotImplemented e) {
std::cout<<e<<std::endl;
} catch(const Dune::NotImplemented& e) {
std::cout << e.what() << std::endl;
}
// refine subgrid
......@@ -84,8 +84,8 @@ size_t testDim()
gridcheck(subGrid);
checkIntersectionIterator(subGrid);
checkLeafIntersections(subGrid);
} catch(Dune::NotImplemented e) {
std::cout<<e<<std::endl;
} catch(const Dune::NotImplemented& e) {
std::cout << e.what() << std::endl;
}
return 0;
}
......@@ -102,8 +102,8 @@ int main (int argc, char *argv[]) try
std::cout << "Test for SubGrid with YaspGrid " << (return_val==0 ? "passed." : "failed.") << std::endl;
return return_val;
} catch (Exception e) {
} catch (const Exception& e) {
std::cout << e << std::endl;
std::cout << e.what() << std::endl;
return 1;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment