mirror of
https://github.com/SFML/CSFML.git
synced 2026-10-26 21:16:13 +01:00
Add sfGetVersion to retrieve the runtime SFML version
This commit is contained in:
6 files changed
+124
No files matched your search
@@ -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);
|
||||
}
|
||||
Reference in new issue
Block a user