Require semicolon after DAWN_TEST_PARAM_STRUCT

Bug: None
Change-Id: I6b9fb69c6d02abb2a210f10d91b02c5b77b48cdc
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/71760
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Brandon Jones <bajones@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
Corentin Wallez 2021-12-07 09:29:46 +00:00 committed by Dawn LUCI CQ
parent 683401528f
commit 87ef49c461
10 changed files with 17 additions and 16 deletions

View File

@ -647,8 +647,8 @@ using DawnTest = DawnTestWithParams<>;
// Instantiate the test once for each backend provided in the first param list.
// The test will be parameterized over the following param lists.
// Use it like this:
// DAWN_INSTANTIATE_TEST_P(MyTestFixture, {MetalBackend, OpenGLBackend}, {A, B, C}, {1, 2, 3})
// MyTestFixture must extend DawnTestWithParam<Param> where Param is a struct that extends
// DAWN_INSTANTIATE_TEST_P(MyTestFixture, {MetalBackend(), OpenGLBackend()}, {A, B, C}, {1, 2, 3})
// MyTestFixture must extend DawnTestWithParams<Param> where Param is a struct that extends
// AdapterTestParam, and whose constructor looks like:
// Param(AdapterTestParam, ABorC, 12or3, ..., otherParams... )
// You must also teach GTest how to print this struct.
@ -674,7 +674,7 @@ using DawnTest = DawnTestWithParams<>;
// It is recommended to use alias declarations so that stringified types are more readable.
// Example:
// using MyParam = unsigned int;
// DAWN_TEST_PARAM_STRUCT(FooParams, MyParam)
// DAWN_TEST_PARAM_STRUCT(FooParams, MyParam);
#define DAWN_TEST_PARAM_STRUCT(StructName, ...) \
struct DAWN_PP_CONCATENATE(_Dawn_, StructName) { \
DAWN_PP_EXPAND(DAWN_PP_EXPAND(DAWN_PP_FOR_EACH)(DAWN_TEST_PARAM_STRUCT_DECL_STRUCT_FIELD, \
@ -697,7 +697,8 @@ using DawnTest = DawnTestWithParams<>;
o << static_cast<const AdapterTestParam&>(param); \
o << "; " << static_cast<const DAWN_PP_CONCATENATE(_Dawn_, StructName)&>(param); \
return o; \
}
} \
static_assert(true, "require semicolon")
namespace detail {
// Helper functions used for DAWN_INSTANTIATE_TEST

View File

@ -35,7 +35,7 @@ struct CopyConfig {
namespace {
using TextureFormat = wgpu::TextureFormat;
DAWN_TEST_PARAM_STRUCT(CompressedTextureFormatTestParams, TextureFormat)
DAWN_TEST_PARAM_STRUCT(CompressedTextureFormatTestParams, TextureFormat);
} // namespace
class CompressedTextureFormatTest : public DawnTestWithParams<CompressedTextureFormatTestParams> {

View File

@ -129,7 +129,7 @@ std::ostream& operator<<(std::ostream& o, Field field) {
return o;
}
DAWN_TEST_PARAM_STRUCT(ComputeLayoutMemoryBufferTestParams, StorageClass, Field)
DAWN_TEST_PARAM_STRUCT(ComputeLayoutMemoryBufferTestParams, StorageClass, Field);
class ComputeLayoutMemoryBufferTests
: public DawnTestWithParams<ComputeLayoutMemoryBufferTestParams> {

View File

@ -326,7 +326,7 @@ namespace {
// The CopyTests Texture to Texture in this class will validate both CopyTextureToTexture and
// CopyTextureToTextureInternal.
using UsageCopySrc = bool;
DAWN_TEST_PARAM_STRUCT(CopyTestsParams, UsageCopySrc)
DAWN_TEST_PARAM_STRUCT(CopyTestsParams, UsageCopySrc);
} // namespace
class CopyTests_T2T : public CopyTests, public DawnTestWithParams<CopyTestsParams> {
@ -2468,4 +2468,4 @@ DAWN_INSTANTIATE_TEST(ClearBufferTests,
MetalBackend(),
OpenGLBackend(),
OpenGLESBackend(),
VulkanBackend());
VulkanBackend());

View File

@ -29,7 +29,7 @@ namespace {
static constexpr uint64_t kDefaultTextureHeight = 1;
using Alpha = wgpu::AlphaOp;
DAWN_TEST_PARAM_STRUCT(AlphaTestParams, Alpha)
DAWN_TEST_PARAM_STRUCT(AlphaTestParams, Alpha);
using SrcFormat = wgpu::TextureFormat;
using DstFormat = wgpu::TextureFormat;
@ -48,8 +48,8 @@ namespace {
return o;
}
DAWN_TEST_PARAM_STRUCT(FormatTestParams, SrcFormat, DstFormat)
DAWN_TEST_PARAM_STRUCT(SubRectTestParams, SrcOrigin, DstOrigin, CopySize, FlipY)
DAWN_TEST_PARAM_STRUCT(FormatTestParams, SrcFormat, DstFormat);
DAWN_TEST_PARAM_STRUCT(SubRectTestParams, SrcOrigin, DstOrigin, CopySize, FlipY);
} // anonymous namespace

View File

@ -49,7 +49,7 @@ namespace {
return o;
}
DAWN_TEST_PARAM_STRUCT(DepthStencilLoadOpTestParams, Format, Check)
DAWN_TEST_PARAM_STRUCT(DepthStencilLoadOpTestParams, Format, Check);
constexpr static uint32_t kRTSize = 16;
constexpr uint32_t kMipLevelCount = 2u;

View File

@ -406,7 +406,7 @@ namespace {
using OOBRead = bool;
using OOBWrite = bool;
DAWN_TEST_PARAM_STRUCT(ClampedOOBDynamicBufferOffsetParams, ReadBufferUsage, OOBRead, OOBWrite)
DAWN_TEST_PARAM_STRUCT(ClampedOOBDynamicBufferOffsetParams, ReadBufferUsage, OOBRead, OOBWrite);
} // anonymous namespace
class ClampedOOBDynamicBufferOffsetTests

View File

@ -39,7 +39,7 @@ namespace {
DepthOrArrayLayers,
MipCount,
Mip,
SampleCount)
SampleCount);
template <typename T>
class ExpectNonZero : public detail::CustomTextureExpectation {

View File

@ -22,7 +22,7 @@ constexpr static uint32_t kSize = 4;
namespace {
using TextureFormat = wgpu::TextureFormat;
DAWN_TEST_PARAM_STRUCT(ReadOnlyDepthStencilAttachmentTestsParams, TextureFormat)
DAWN_TEST_PARAM_STRUCT(ReadOnlyDepthStencilAttachmentTestsParams, TextureFormat);
} // namespace
class ReadOnlyDepthStencilAttachmentTests

View File

@ -374,7 +374,7 @@ namespace {
using DimAOuter = uint32_t;
using DimInner = uint32_t;
using DimBOuter = uint32_t;
DAWN_TEST_PARAM_STRUCT(ShaderRobustnessParams, MatMulMethod, DimAOuter, DimInner, DimBOuter)
DAWN_TEST_PARAM_STRUCT(ShaderRobustnessParams, MatMulMethod, DimAOuter, DimInner, DimBOuter);
} // namespace