Add stub surface test

This commit is contained in:
Dmitry Marakasov 2016-01-25 19:27:18 +03:00
parent ed3fbb8953
commit b0ea9e7216
2 changed files with 26 additions and 1 deletions

View File

@ -15,9 +15,17 @@ SET(LIVE_TESTS
)
IF(SDL2PP_WITH_MIXER)
SET(LIVE_TESTS ${LIVE_TESTS} live_mixer)
SET(LIVE_TESTS ${LIVE_TESTS}
live_mixer
)
ENDIF(SDL2PP_WITH_MIXER)
IF(SDL2PP_WITH_IMAGE)
SET(CLI_TESTS ${CLI_TESTS}
test_surface
)
ENDIF(SDL2PP_WITH_IMAGE)
# disable self-move warning: it's deliberately used in tests
INCLUDE(AppendCXXFlagIfSupported)
APPEND_CXX_FLAG_IF_SUPPORTED(-Wno-self-move CMAKE_CXX_FLAGS)

17
tests/test_surface.cc Normal file
View File

@ -0,0 +1,17 @@
#include <SDL2/SDL_main.h>
#include <SDL2pp/Surface.hh>
#include "testing.h"
using namespace SDL2pp;
BEGIN_TEST(int, char*[])
Surface crate(TESTDATA_DIR "/crate.png");
{
EXPECT_EQUAL(crate.GetWidth(), 32);
EXPECT_EQUAL(crate.GetHeight(), 32);
EXPECT_EQUAL(crate.GetSize(), Point(32, 32));
}
END_TEST()