Add (failing) test for #22

This commit is contained in:
Dmitry Marakasov 2014-12-27 02:02:54 +03:00
parent baf0e7c98a
commit f5216c309f
2 changed files with 19 additions and 0 deletions

View File

@ -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
View 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()