libSDL2pp/tests/test_error.cc
2015-12-15 22:06:56 +03:00

19 lines
310 B
C++

#include <SDL2/SDL_error.h>
#include <SDL2pp/Exception.hh>
#include "testing.h"
using namespace SDL2pp;
BEGIN_TEST(int, char*[])
SDL_SetError("foo");
try {
throw Exception("");
} catch (SDL2pp::Exception& e) {
SDL_SetError("bar");
EXPECT_EQUAL((std::string)e.GetSDLError(), "foo");
}
END_TEST()