mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-20 18:29:23 +00:00
ValidationTest: Add helper to create a dummy renderpass
This commit is contained in:
committed by
Corentin Wallez
parent
b343e8d920
commit
2dfea9961a
@@ -29,6 +29,8 @@ class ValidationTest : public testing::Test {
|
||||
ValidationTest();
|
||||
~ValidationTest();
|
||||
|
||||
void TearDown() override;
|
||||
|
||||
// Use these methods to add expectations on the validation of a builder. The expectations are
|
||||
// checked on test teardown. Adding an expectation is done like the following:
|
||||
//
|
||||
@@ -46,7 +48,17 @@ class ValidationTest : public testing::Test {
|
||||
void StartExpectDeviceError();
|
||||
bool EndExpectDeviceError();
|
||||
|
||||
void TearDown() override;
|
||||
// Helper functions to create objects to test validation.
|
||||
|
||||
struct DummyRenderPass {
|
||||
nxt::RenderPass renderPass;
|
||||
nxt::Framebuffer framebuffer;
|
||||
nxt::Texture attachment;
|
||||
nxt::TextureFormat attachmentFormat;
|
||||
uint32_t width;
|
||||
uint32_t height;
|
||||
};
|
||||
DummyRenderPass CreateDummyRenderPass();
|
||||
|
||||
protected:
|
||||
nxt::Device device;
|
||||
@@ -72,6 +84,8 @@ class ValidationTest : public testing::Test {
|
||||
static void OnBuilderErrorStatus(nxtBuilderErrorStatus status, const char* message, nxt::CallbackUserdata userdata1, nxt::CallbackUserdata userdata2);
|
||||
};
|
||||
|
||||
// Template implementation details
|
||||
|
||||
template<typename Builder>
|
||||
Builder ValidationTest::AssertWillBeSuccess(Builder builder, std::string debugName) {
|
||||
return AddExpectation(builder, debugName, true);
|
||||
|
||||
Reference in New Issue
Block a user