mirror of
https://github.com/libSDL2pp/libSDL2pp.git
synced 2025-08-03 19:05:59 -04:00
Add (failing) test for #22
This commit is contained in:
parent
baf0e7c98a
commit
f5216c309f
@ -3,6 +3,7 @@ SET(CLI_TESTS
|
||||
test_pointrect
|
||||
test_rwops
|
||||
test_optional
|
||||
test_error
|
||||
)
|
||||
|
||||
# tests which test graphics functionality and thus requre working
|
||||
|
18
tests/test_error.cc
Normal file
18
tests/test_error.cc
Normal file
@ -0,0 +1,18 @@
|
||||
#include <SDL2/SDL_error.h>
|
||||
|
||||
#include <SDL2pp/Exception.hh>
|
||||
|
||||
#include "testing.h"
|
||||
|
||||
using namespace SDL2pp;
|
||||
|
||||
BEGIN_TEST()
|
||||
SDL_SetError("foo");
|
||||
|
||||
try {
|
||||
throw Exception("");
|
||||
} catch (SDL2pp::Exception& e) {
|
||||
SDL_SetError("bar");
|
||||
EXPECT_EQUAL((std::string)e.GetSDLError(), "foo");
|
||||
}
|
||||
END_TEST()
|
Loading…
x
Reference in New Issue
Block a user