Print the failing statement in ASSERT_DEVICE_ERROR
Makes it easier to track where and why a test failed. Bug: none Change-Id: Icdccde97db68c32c35af6c044a3eacd4d4978b61 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/19701 Reviewed-by: Kai Ninomiya <kainino@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Austin Eng <enga@chromium.org>
This commit is contained in:
parent
319672791e
commit
3aa5be9749
|
@ -59,11 +59,15 @@
|
|||
|
||||
// Should only be used to test validation of function that can't be tested by regular validation
|
||||
// tests;
|
||||
#define ASSERT_DEVICE_ERROR(statement) \
|
||||
StartExpectDeviceError(); \
|
||||
statement; \
|
||||
FlushWire(); \
|
||||
ASSERT_TRUE(EndExpectDeviceError())
|
||||
#define ASSERT_DEVICE_ERROR(statement) \
|
||||
StartExpectDeviceError(); \
|
||||
statement; \
|
||||
FlushWire(); \
|
||||
if (!EndExpectDeviceError()) { \
|
||||
FAIL() << "Expected device error in:\n " << #statement; \
|
||||
} \
|
||||
do { \
|
||||
} while (0)
|
||||
|
||||
struct RGBA8 {
|
||||
constexpr RGBA8() : RGBA8(0, 0, 0, 0) {
|
||||
|
|
|
@ -19,10 +19,14 @@
|
|||
#include "dawn_native/DawnNative.h"
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
#define ASSERT_DEVICE_ERROR(statement) \
|
||||
StartExpectDeviceError(); \
|
||||
statement; \
|
||||
ASSERT_TRUE(EndExpectDeviceError())
|
||||
#define ASSERT_DEVICE_ERROR(statement) \
|
||||
StartExpectDeviceError(); \
|
||||
statement; \
|
||||
if (!EndExpectDeviceError()) { \
|
||||
FAIL() << "Expected device error in:\n " << #statement; \
|
||||
} \
|
||||
do { \
|
||||
} while (0)
|
||||
|
||||
class ValidationTest : public testing::Test {
|
||||
public:
|
||||
|
|
Loading…
Reference in New Issue