Add tests for sfVideoMode

This commit is contained in:
Chris Thrasher committed 2024-12-22 17:37:54 -06:00
1 parent ab1a1a2299
commit 0066e8f352
2 files changed
+39

No files matched your search

+38
View File
@@ -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({}));
}
}