mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-20 18:29:23 +00:00
Add Buffer::MapReadAsync validation tests.
This also expands the Buffer validation tests to cover more creation code paths and SetSubData. It also introduces a mechanism for ValidationTests to check for device errors.
This commit is contained in:
committed by
Corentin Wallez
parent
43bfaae340
commit
68358b5c23
@@ -19,6 +19,11 @@
|
||||
#include "nxt/nxtcpp.h"
|
||||
#include "nxt/nxtcpp_traits.h"
|
||||
|
||||
#define ASSERT_DEVICE_ERROR(statement) \
|
||||
StartExpectDeviceError(); \
|
||||
statement; \
|
||||
ASSERT_TRUE(EndExpectDeviceError());
|
||||
|
||||
class ValidationTest : public testing::Test {
|
||||
public:
|
||||
ValidationTest();
|
||||
@@ -38,12 +43,19 @@ class ValidationTest : public testing::Test {
|
||||
template<typename Builder>
|
||||
Builder AssertWillBeError(Builder builder, std::string debugName = "");
|
||||
|
||||
void StartExpectDeviceError();
|
||||
bool EndExpectDeviceError();
|
||||
|
||||
void TearDown() override;
|
||||
|
||||
protected:
|
||||
nxt::Device device;
|
||||
|
||||
private:
|
||||
static void OnDeviceError(const char* message, nxtCallbackUserdata userdata);
|
||||
bool expectError = false;
|
||||
bool error = false;
|
||||
|
||||
struct BuilderStatusExpectations {
|
||||
bool expectSuccess;
|
||||
std::string debugName;
|
||||
|
||||
Reference in New Issue
Block a user