mirror of
https://github.com/SFML/CSFML.git
synced 2026-10-24 21:53:37 +02:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0066e8f352 |
No files matched your search
@@ -37,6 +37,7 @@ add_executable(test-csfml-window
|
||||
Window/Keyboard.test.cpp
|
||||
Window/Mouse.test.cpp
|
||||
Window/Sensor.test.cpp
|
||||
Window/VideoMode.test.cpp
|
||||
Window/Window.test.cpp
|
||||
Window/WindowBase.test.cpp
|
||||
)
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
#include <CSFML/Window/VideoMode.h>
|
||||
|
||||
#include <catch2/catch_test_macros.hpp>
|
||||
|
||||
TEST_CASE("[Window] sfVideoMode")
|
||||
{
|
||||
SECTION("Construction")
|
||||
{
|
||||
const sfVideoMode videoMode{};
|
||||
CHECK(videoMode.size.x == 0);
|
||||
CHECK(videoMode.size.y == 0);
|
||||
CHECK(videoMode.bitsPerPixel == 0);
|
||||
}
|
||||
|
||||
SECTION("sfVideoMode_getDesktopMode()")
|
||||
{
|
||||
const sfVideoMode videoMode = sfVideoMode_getDesktopMode();
|
||||
CHECK(videoMode.size.x != 0);
|
||||
CHECK(videoMode.size.y != 0);
|
||||
CHECK(videoMode.bitsPerPixel != 0);
|
||||
}
|
||||
|
||||
SECTION("sfVideoMode_getFullscreenModes()")
|
||||
{
|
||||
std::size_t count = 0;
|
||||
const sfVideoMode* videoModes = sfVideoMode_getFullscreenModes(&count);
|
||||
REQUIRE(count > 0);
|
||||
const sfVideoMode& videoMode = videoModes[0];
|
||||
CHECK(videoMode.size.x != 0);
|
||||
CHECK(videoMode.size.y != 0);
|
||||
CHECK(videoMode.bitsPerPixel != 0);
|
||||
}
|
||||
|
||||
SECTION("sfVideoMode_isValid")
|
||||
{
|
||||
CHECK(!sfVideoMode_isValid({}));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user