mirror of
https://github.com/libSDL2pp/libSDL2pp.git
synced 2025-08-03 10:55:57 -04:00

- Always include SDL2/SDL_main.h in all tests to handle main() correctly - Link all tests with SDL2pp (and thus with libSDL2main)
20 lines
337 B
C++
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()
|