mirror of
https://github.com/boostorg/unordered.git
synced 2025-07-31 03:47:16 +02:00
Catch exceptions by reference
This commit is contained in:
@ -90,7 +90,7 @@ template <class T> struct swap_base : public test::exception_base
|
|||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
d.x.swap(d.y);
|
d.x.swap(d.y);
|
||||||
} catch (std::runtime_error) {
|
} catch (std::runtime_error&) {
|
||||||
}
|
}
|
||||||
|
|
||||||
DISABLE_EXCEPTIONS;
|
DISABLE_EXCEPTIONS;
|
||||||
|
@ -25,13 +25,13 @@ namespace at_tests {
|
|||||||
try {
|
try {
|
||||||
x.at("one");
|
x.at("one");
|
||||||
BOOST_ERROR("Should have thrown.");
|
BOOST_ERROR("Should have thrown.");
|
||||||
} catch (std::out_of_range) {
|
} catch (std::out_of_range&) {
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
x_const.at("one");
|
x_const.at("one");
|
||||||
BOOST_ERROR("Should have thrown.");
|
BOOST_ERROR("Should have thrown.");
|
||||||
} catch (std::out_of_range) {
|
} catch (std::out_of_range&) {
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOST_LIGHTWEIGHT_TEST_OSTREAM << "Add elements" << std::endl;
|
BOOST_LIGHTWEIGHT_TEST_OSTREAM << "Add elements" << std::endl;
|
||||||
@ -51,13 +51,13 @@ namespace at_tests {
|
|||||||
try {
|
try {
|
||||||
x.at("three");
|
x.at("three");
|
||||||
BOOST_ERROR("Should have thrown.");
|
BOOST_ERROR("Should have thrown.");
|
||||||
} catch (std::out_of_range) {
|
} catch (std::out_of_range&) {
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
x_const.at("three");
|
x_const.at("three");
|
||||||
BOOST_ERROR("Should have thrown.");
|
BOOST_ERROR("Should have thrown.");
|
||||||
} catch (std::out_of_range) {
|
} catch (std::out_of_range&) {
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOST_LIGHTWEIGHT_TEST_OSTREAM << "Finished" << std::endl;
|
BOOST_LIGHTWEIGHT_TEST_OSTREAM << "Finished" << std::endl;
|
||||||
|
Reference in New Issue
Block a user