mirror of
https://github.com/libSDL2pp/libSDL2pp.git
synced 2025-08-05 11:56:00 -04:00
Extend Exception test coverage
This commit is contained in:
parent
2781786384
commit
c92125053e
@ -8,12 +8,15 @@
|
|||||||
using namespace SDL2pp;
|
using namespace SDL2pp;
|
||||||
|
|
||||||
BEGIN_TEST(int, char*[])
|
BEGIN_TEST(int, char*[])
|
||||||
SDL_SetError("foo");
|
SDL_SetError("BarError");
|
||||||
|
|
||||||
try {
|
try {
|
||||||
throw Exception("");
|
throw Exception("FooFunction");
|
||||||
} catch (SDL2pp::Exception& e) {
|
} catch (SDL2pp::Exception& e) {
|
||||||
SDL_SetError("bar");
|
// this SDL_SetError should not clobber Exception contents
|
||||||
EXPECT_EQUAL((std::string)e.GetSDLError(), "foo");
|
SDL_SetError("AnotherError");
|
||||||
|
EXPECT_EQUAL(e.GetSDLFunction(), "FooFunction");
|
||||||
|
EXPECT_EQUAL(e.GetSDLError(), "BarError");
|
||||||
|
EXPECT_EQUAL((std::string)e.what(), "FooFunction failed: BarError");
|
||||||
}
|
}
|
||||||
END_TEST()
|
END_TEST()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user