Change exception + test

This commit is contained in:
Joakim Hove
2019-12-13 15:38:55 +01:00
parent 11bf449281
commit b4fd949ca8
2 changed files with 3 additions and 1 deletions

View File

@@ -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];
}

View File

@@ -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)