Change exception + test
This commit is contained in:
@@ -287,7 +287,7 @@ std::size_t UDQSet::defined_size() const {
|
||||
|
||||
const UDQScalar& UDQSet::operator[](std::size_t index) const {
|
||||
if (index >= this->size())
|
||||
throw std::invalid_argument("Index out of range");
|
||||
throw std::out_of_range("Index out of range in UDQset::operator[]");
|
||||
return this->values[index];
|
||||
}
|
||||
|
||||
|
||||
@@ -110,6 +110,8 @@ BOOST_AUTO_TEST_CASE(UDQWellSetTest) {
|
||||
BOOST_CHECK_EQUAL(ws["P1"].value(), 1.0);
|
||||
|
||||
BOOST_REQUIRE_THROW(ws.assign("NO_SUCH_WELL", 1.0), std::out_of_range);
|
||||
BOOST_REQUIRE_THROW(ws[10], std::out_of_range);
|
||||
BOOST_REQUIRE_THROW(ws["NO_SUCH_WELL"], std::out_of_range);
|
||||
|
||||
ws.assign("*", 2.0);
|
||||
for (const auto& w : wells)
|
||||
|
||||
Reference in New Issue
Block a user