mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Add exception handlers to all tutorials and examples
This commit is contained in:
@@ -41,6 +41,7 @@
|
||||
|
||||
int
|
||||
main()
|
||||
try
|
||||
{
|
||||
typedef AutoDiff::Forward<double> AdFW;
|
||||
|
||||
@@ -69,3 +70,8 @@ main()
|
||||
std::cout << "a - 1: " << (a - 1) << '\n';
|
||||
std::cout << "a - b: " << (a - b) << '\n';
|
||||
}
|
||||
catch (const std::exception &e) {
|
||||
std::cerr << "Program threw an exception: " << e.what() << "\n";
|
||||
throw;
|
||||
}
|
||||
|
||||
|
||||
@@ -193,6 +193,7 @@ BOOST_AUTO_TEST_CASE(Addition)
|
||||
#include <iostream>
|
||||
|
||||
int main()
|
||||
try
|
||||
{
|
||||
typedef AutoDiff::ForwardBlock<double> ADB;
|
||||
std::vector<int> blocksizes = { 3, 1, 2 };
|
||||
@@ -233,4 +234,8 @@ int main()
|
||||
m.insert(1,1) = 1;
|
||||
std::cout << m*sqx;
|
||||
}
|
||||
catch (const std::exception &e) {
|
||||
std::cerr << "Program threw an exception: " << e.what() << "\n";
|
||||
throw;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -83,6 +83,7 @@ BOOST_FIXTURE_TEST_CASE(Construction, TestFixture<SetupSimple>)
|
||||
}
|
||||
|
||||
|
||||
|
||||
BOOST_FIXTURE_TEST_CASE(SurfaceDensity, TestFixture<SetupSimple>)
|
||||
{
|
||||
Opm::BlackoilPropsAd boprops_ad(props);
|
||||
|
||||
@@ -63,3 +63,5 @@ BOOST_AUTO_TEST_CASE(ScalarMultiplication)
|
||||
BOOST_CHECK_EQUAL( x3.value().cwiseNotEqual( y3.value() ).count(), 0 );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -31,6 +31,7 @@ BOOST_AUTO_TEST_CASE(Initialisation)
|
||||
}
|
||||
|
||||
|
||||
|
||||
BOOST_AUTO_TEST_CASE(Addition)
|
||||
{
|
||||
typedef AutoDiff::Forward<double> AdFW;
|
||||
|
||||
Reference in New Issue
Block a user