mirror of
https://github.com/SFML/SFML.git
synced 2024-11-25 04:41:05 +08:00
Add tests for sf::Vulkan
This commit is contained in:
parent
f40d5ac21d
commit
3750074238
@ -69,6 +69,7 @@ set(WINDOW_SRC
|
|||||||
Window/Joystick.test.cpp
|
Window/Joystick.test.cpp
|
||||||
Window/Keyboard.test.cpp
|
Window/Keyboard.test.cpp
|
||||||
Window/VideoMode.test.cpp
|
Window/VideoMode.test.cpp
|
||||||
|
Window/Vulkan.test.cpp
|
||||||
Window/Window.test.cpp
|
Window/Window.test.cpp
|
||||||
Window/WindowBase.test.cpp
|
Window/WindowBase.test.cpp
|
||||||
)
|
)
|
||||||
|
28
test/Window/Vulkan.test.cpp
Normal file
28
test/Window/Vulkan.test.cpp
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
#include <SFML/Window/Vulkan.hpp>
|
||||||
|
|
||||||
|
#include <catch2/catch_test_macros.hpp>
|
||||||
|
|
||||||
|
TEST_CASE("[Window] sf::Vulkan")
|
||||||
|
{
|
||||||
|
SECTION("getFunction()")
|
||||||
|
{
|
||||||
|
CHECK(sf::Vulkan::getFunction("") == nullptr);
|
||||||
|
CHECK(sf::Vulkan::getFunction(" ") == nullptr);
|
||||||
|
CHECK(sf::Vulkan::getFunction("a string that will never resolve to a Vulkan function") == nullptr);
|
||||||
|
|
||||||
|
CHECKED_IF(sf::Vulkan::isAvailable())
|
||||||
|
{
|
||||||
|
CHECK(sf::Vulkan::getFunction("vkCreateInstance") != nullptr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SECTION("getGraphicsRequiredInstanceExtensions()")
|
||||||
|
{
|
||||||
|
// If Vulkan is not available this function may or may not return a non-empty vector
|
||||||
|
// If Vulkan is available then it will always return a non-empty vector
|
||||||
|
CHECKED_IF(sf::Vulkan::isAvailable())
|
||||||
|
{
|
||||||
|
CHECK(!sf::Vulkan::getGraphicsRequiredInstanceExtensions().empty());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user