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:
Austin Eng 2020-04-16 21:36:33 +00:00 committed by Commit Bot service account
parent 319672791e
commit 3aa5be9749
2 changed files with 17 additions and 9 deletions

View File

@ -63,7 +63,11 @@
StartExpectDeviceError(); \ StartExpectDeviceError(); \
statement; \ statement; \
FlushWire(); \ FlushWire(); \
ASSERT_TRUE(EndExpectDeviceError()) if (!EndExpectDeviceError()) { \
FAIL() << "Expected device error in:\n " << #statement; \
} \
do { \
} while (0)
struct RGBA8 { struct RGBA8 {
constexpr RGBA8() : RGBA8(0, 0, 0, 0) { constexpr RGBA8() : RGBA8(0, 0, 0, 0) {

View File

@ -22,7 +22,11 @@
#define ASSERT_DEVICE_ERROR(statement) \ #define ASSERT_DEVICE_ERROR(statement) \
StartExpectDeviceError(); \ StartExpectDeviceError(); \
statement; \ statement; \
ASSERT_TRUE(EndExpectDeviceError()) if (!EndExpectDeviceError()) { \
FAIL() << "Expected device error in:\n " << #statement; \
} \
do { \
} while (0)
class ValidationTest : public testing::Test { class ValidationTest : public testing::Test {
public: public: