Add sfGetVersion to retrieve the runtime SFML version

This commit is contained in:
Lukas Dürrenberger committed 2026-10-04 22:10:41 +02:00
1 parent 0a4871cfbe
commit a08585812d
6 files changed
+124

No files matched your search

+15
View File
@@ -0,0 +1,15 @@
#include <CSFML/System/Version.h>
#include <catch2/catch_test_macros.hpp>
#include <string>
TEST_CASE("[System] sfGetVersion")
{
const sfVersion version = sfGetVersion();
CHECK(version.major == 3);
CHECK(version.minor >= 1);
CHECK(version.patch >= 0);
REQUIRE(version.string != nullptr);
CHECK(std::string(version.string).rfind(std::to_string(version.major) + "." + std::to_string(version.minor), 0) == 0);
}