File tree Expand file tree Collapse file tree 2 files changed +39
-0
lines changed
Expand file tree Collapse file tree 2 files changed +39
-0
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ add_executable(test-csfml-window
3737 Window/Keyboard.test .cpp
3838 Window/Mouse.test .cpp
3939 Window/Sensor.test .cpp
40+ Window/VideoMode.test .cpp
4041 Window/Window.test .cpp
4142 Window/WindowBase.test .cpp
4243)
Original file line number Diff line number Diff line change 1+ #include < CSFML/Window/VideoMode.h>
2+
3+ #include < catch2/catch_test_macros.hpp>
4+
5+ TEST_CASE (" [Window] sfVideoMode" )
6+ {
7+ SECTION (" Construction" )
8+ {
9+ const sfVideoMode videoMode{};
10+ CHECK (videoMode.width == 0 );
11+ CHECK (videoMode.height == 0 );
12+ CHECK (videoMode.bitsPerPixel == 0 );
13+ }
14+
15+ SECTION (" sfVideoMode_getDesktopMode()" )
16+ {
17+ const sfVideoMode videoMode = sfVideoMode_getDesktopMode ();
18+ CHECK (videoMode.width != 0 );
19+ CHECK (videoMode.height != 0 );
20+ CHECK (videoMode.bitsPerPixel != 0 );
21+ }
22+
23+ SECTION (" sfVideoMode_getFullscreenModes()" )
24+ {
25+ std::size_t count = 0 ;
26+ const sfVideoMode* videoModes = sfVideoMode_getFullscreenModes (&count);
27+ REQUIRE (count > 0 );
28+ const sfVideoMode& videoMode = videoModes[0 ];
29+ CHECK (videoMode.width != 0 );
30+ CHECK (videoMode.height != 0 );
31+ CHECK (videoMode.bitsPerPixel != 0 );
32+ }
33+
34+ SECTION (" sfVideoMode_isValid" )
35+ {
36+ CHECK (!sfVideoMode_isValid ({}));
37+ }
38+ }
You can’t perform that action at this time.
0 commit comments