libSDL2pp/tests/test_error.cc
Dmitry Marakasov 7dd543053c Fix more SDL_main issues
- Always include SDL2/SDL_main.h in all tests to handle main() correctly
- Link all tests with SDL2pp (and thus with libSDL2main)
2016-01-05 18:28:52 +03:00

20 lines
337 B
C++

#include <SDL2/SDL_main.h>
#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()