mirror of
https://github.com/SFML/CSFML.git
synced 2026-10-27 21:36: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
@@ -27,6 +27,7 @@ add_executable(test-csfml-system
|
||||
System/Time.test.cpp
|
||||
System/Vector2.test.cpp
|
||||
System/Vector3.test.cpp
|
||||
System/Version.test.cpp
|
||||
)
|
||||
target_link_libraries(test-csfml-system PRIVATE csfml-system Catch2::Catch2WithMain)
|
||||
set_target_warnings(test-csfml-system)
|
||||
|
||||
@@ -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