mirror of
https://github.com/libSDL2pp/libSDL2pp.git
synced 2025-09-09 15:28:29 -04:00
Add stub surface test
This commit is contained in:
parent
ed3fbb8953
commit
b0ea9e7216
@ -15,9 +15,17 @@ SET(LIVE_TESTS
|
|||||||
)
|
)
|
||||||
|
|
||||||
IF(SDL2PP_WITH_MIXER)
|
IF(SDL2PP_WITH_MIXER)
|
||||||
SET(LIVE_TESTS ${LIVE_TESTS} live_mixer)
|
SET(LIVE_TESTS ${LIVE_TESTS}
|
||||||
|
live_mixer
|
||||||
|
)
|
||||||
ENDIF(SDL2PP_WITH_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
|
# disable self-move warning: it's deliberately used in tests
|
||||||
INCLUDE(AppendCXXFlagIfSupported)
|
INCLUDE(AppendCXXFlagIfSupported)
|
||||||
APPEND_CXX_FLAG_IF_SUPPORTED(-Wno-self-move CMAKE_CXX_FLAGS)
|
APPEND_CXX_FLAG_IF_SUPPORTED(-Wno-self-move CMAKE_CXX_FLAGS)
|
||||||
|
17
tests/test_surface.cc
Normal file
17
tests/test_surface.cc
Normal 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()
|
Loading…
x
Reference in New Issue
Block a user