| 8 | #include <stdexcept> |
| 9 | |
| 10 | TEST(enforce, errMessageCanBeRetrievedFromErrorException) { |
| 11 | try { |
| 12 | Exiv2::Internal::enforce(false, Exiv2::ErrorCode::kerErrorMessage, "an error occurred"); |
| 13 | } catch (const Exiv2::Error& e) { |
| 14 | ASSERT_STREQ(e.what(), "an error occurred"); |
| 15 | } |
| 16 | } |
| 17 | |
| 18 | TEST(enforce, withTrueConditionDoesNotThrow) { |
| 19 | ASSERT_NO_THROW(Exiv2::Internal::enforce(true, Exiv2::ErrorCode::kerErrorMessage)); |