Files
Bigfoot/Bigfoot/Tests/Graphics/GraphicsVulkan/VulkanSurface.cpp
T
rboullard c4e9f6f7d9
Bigfoot / Sonarqube (game) (push) Skipped
Bigfoot / Sonarqube (toolmode) (push) Skipped
Bigfoot / Build & Test Debug with clang (Unity Build: OFF, Variant: game) (push) Successful in 1m7s
Bigfoot / Build & Test Debug with clang (Unity Build: OFF, Variant: toolmode) (push) Successful in 1m10s
Bigfoot / Build & Test Debug with clang (Unity Build: ON, Variant: game) (push) Successful in 46s
Bigfoot / Build & Test Debug with clang (Unity Build: ON, Variant: toolmode) (push) Successful in 50s
Bigfoot / Build & Test Debug with clang_asan (Unity Build: OFF, Variant: game) (push) Successful in 6m1s
Bigfoot / Build & Test Debug with clang_asan (Unity Build: OFF, Variant: toolmode) (push) Successful in 2m21s
Bigfoot / Build & Test Debug with clang_asan (Unity Build: ON, Variant: game) (push) Successful in 1m49s
Bigfoot / Build & Test Debug with clang_asan (Unity Build: ON, Variant: toolmode) (push) Successful in 1m56s
Bigfoot / Build & Test Release with clang (Unity Build: OFF, Variant: game) (push) Successful in 1m2s
Bigfoot / Build & Test Release with clang (Unity Build: OFF, Variant: toolmode) (push) Successful in 1m27s
Bigfoot / Build & Test Release with clang (Unity Build: ON, Variant: game) (push) Successful in 49s
Bigfoot / Build & Test Release with clang_asan (Unity Build: OFF, Variant: game) (push) Successful in 9m26s
Bigfoot / Build & Test Release with clang_asan (Unity Build: ON, Variant: toolmode) (push) Successful in 1m39s
Bigfoot / Build & Test RelWithDebInfo with clang (Unity Build: OFF, Variant: toolmode) (push) Successful in 1m18s
Bigfoot / Build & Test RelWithDebInfo with clang (Unity Build: ON, Variant: toolmode) (push) Successful in 52s
Bigfoot / Build & Test RelWithDebInfo with clang_asan (Unity Build: OFF, Variant: game) (push) Successful in 7m59s
Bigfoot / Build & Test RelWithDebInfo with clang_asan (Unity Build: OFF, Variant: toolmode) (push) Successful in 2m23s
Bigfoot / Build & Test RelWithDebInfo with clang_asan (Unity Build: ON, Variant: toolmode) (push) Successful in 1m58s
Bigfoot / Build & Test Release with clang (Unity Build: ON, Variant: toolmode) (push) Successful in 1m13s
Bigfoot / Build & Test Release with clang_asan (Unity Build: OFF, Variant: toolmode) (push) Successful in 1m51s
Bigfoot / Build & Test Release with clang_asan (Unity Build: ON, Variant: game) (push) Successful in 1m32s
Bigfoot / Build & Test RelWithDebInfo with clang (Unity Build: OFF, Variant: game) (push) Successful in 1m12s
Bigfoot / Build & Test RelWithDebInfo with clang (Unity Build: ON, Variant: game) (push) Successful in 50s
Bigfoot / Build & Test RelWithDebInfo with clang_asan (Unity Build: ON, Variant: game) (push) Successful in 1m50s
Bigfoot / Clang Format Checks (push) Successful in 12s
Refactoring generate scripts + scoped asan disabler
2026-09-12 10:37:06 +02:00

61 lines
1.9 KiB
C++

/*********************************************************************
* \file VulkanSurface.cpp
*
* \author Romain BOULLARD
* \date September 2026
*********************************************************************/
#include <GraphicsVulkan/VulkanSurface.hpp>
#include <GraphicsVulkan/VulkanInstance.hpp>
#include <Utils/TargetMacros.h>
#include <SDL3/SDL.h>
#include <gtest/gtest.h>
namespace Bigfoot::Vulkan
{
class VulkanSurfaceFixture: public ::testing::Test
{
protected:
void SetUp() override
{
SDL_Init(SDL_INIT_VIDEO);
m_window = SDL_CreateWindow("VulkanSurfaceTests", 64, 64, SDL_WINDOW_HIDDEN | SDL_WINDOW_VULKAN);
const SDL_PropertiesID windowProperties = SDL_GetWindowProperties(m_window);
#ifdef BIGFOOT_WINDOWS
m_surfaceCreateInfo.m_windowHandle = static_cast<HWND>(
SDL_GetPointerProperty(windowProperties, SDL_PROP_WINDOW_WIN32_HWND_POINTER, nullptr));
m_surfaceCreateInfo.m_windowInstance = GetModuleHandle(nullptr);
#elif defined BIGFOOT_LINUX
m_surfaceCreateInfo.m_display = static_cast<wl_display*>(
SDL_GetPointerProperty(windowProperties, SDL_PROP_WINDOW_WAYLAND_DISPLAY_POINTER, nullptr));
m_surfaceCreateInfo.m_surface = static_cast<wl_surface*>(
SDL_GetPointerProperty(windowProperties, SDL_PROP_WINDOW_WAYLAND_SURFACE_POINTER, nullptr));
#endif
}
void TearDown() override
{
SDL_DestroyWindow(m_window);
SDL_Quit();
}
VulkanInstance m_instance {"VulkanSurfaceTests", Version {1, 0, 0}};
SDL_Window* m_window = nullptr;
SurfaceCreateInfo m_surfaceCreateInfo;
};
/****************************************************************************************/
TEST_F(VulkanSurfaceFixture, Constructor_ShouldCreateAValidSurface)
{
const VulkanSurface surface {m_instance, m_surfaceCreateInfo};
EXPECT_TRUE(surface.GetHandle());
}
} // namespace Bigfoot::Vulkan