From 5d89bb3595b075c296859e761991dc0153fe52ca Mon Sep 17 00:00:00 2001 From: Thomas Nipen Date: Mon, 11 Mar 2024 11:07:53 +0100 Subject: [PATCH] Move not_implemented_exception code to gridpp.cpp --- include/gridpp.h | 2 +- src/api/gridpp.cpp | 3 +++ tests/test_swig.py | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/include/gridpp.h b/include/gridpp.h index 252ab128..9529c802 100644 --- a/include/gridpp.h +++ b/include/gridpp.h @@ -1887,7 +1887,7 @@ namespace gridpp { class not_implemented_exception: public std::logic_error { public: - not_implemented_exception() : std::logic_error("Function not yet implemented") { }; + not_implemented_exception(); }; /** Covariance structure function */ diff --git a/src/api/gridpp.cpp b/src/api/gridpp.cpp index 5662863f..259aca5c 100644 --- a/src/api/gridpp.cpp +++ b/src/api/gridpp.cpp @@ -74,3 +74,6 @@ void gridpp::set_debug_level(int level) { int gridpp::get_debug_level() { return gridpp::_debug_level; } +gridpp::not_implemented_exception::not_implemented_exception() : + std::logic_error("Function not yet implemented") { +}; diff --git a/tests/test_swig.py b/tests/test_swig.py index 0d7ec8f1..50fcd2f9 100644 --- a/tests/test_swig.py +++ b/tests/test_swig.py @@ -107,7 +107,7 @@ def test_zero_size_dimension(self): self.assertEqual(0, gridpp.test_vec3_input(np.zeros([3, 0, 0]))) def test_not_implemented_exception(self): - with self.assertRaises(Exception) as e: + with self.assertRaises(RuntimeError) as e: gridpp.test_not_implemented_exception()