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>
diff --git a/src/tests/DawnTest.h b/src/tests/DawnTest.h
index a69e2d0..5e37c91 100644
--- a/src/tests/DawnTest.h
+++ b/src/tests/DawnTest.h
@@ -647,8 +647,8 @@
// 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 @@
// 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 @@
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
diff --git a/src/tests/end2end/CompressedTextureFormatTests.cpp b/src/tests/end2end/CompressedTextureFormatTests.cpp
index 0d0f769..70b90a2 100644
--- a/src/tests/end2end/CompressedTextureFormatTests.cpp
+++ b/src/tests/end2end/CompressedTextureFormatTests.cpp
@@ -35,7 +35,7 @@
namespace {
using TextureFormat = wgpu::TextureFormat;
- DAWN_TEST_PARAM_STRUCT(CompressedTextureFormatTestParams, TextureFormat)
+ DAWN_TEST_PARAM_STRUCT(CompressedTextureFormatTestParams, TextureFormat);
} // namespace
class CompressedTextureFormatTest : public DawnTestWithParams<CompressedTextureFormatTestParams> {
diff --git a/src/tests/end2end/ComputeLayoutMemoryBufferTests.cpp b/src/tests/end2end/ComputeLayoutMemoryBufferTests.cpp
index ddc093e..eeacf70 100644
--- a/src/tests/end2end/ComputeLayoutMemoryBufferTests.cpp
+++ b/src/tests/end2end/ComputeLayoutMemoryBufferTests.cpp
@@ -129,7 +129,7 @@
return o;
}
-DAWN_TEST_PARAM_STRUCT(ComputeLayoutMemoryBufferTestParams, StorageClass, Field)
+DAWN_TEST_PARAM_STRUCT(ComputeLayoutMemoryBufferTestParams, StorageClass, Field);
class ComputeLayoutMemoryBufferTests
: public DawnTestWithParams<ComputeLayoutMemoryBufferTestParams> {
diff --git a/src/tests/end2end/CopyTests.cpp b/src/tests/end2end/CopyTests.cpp
index 8b10239..9e7aae1 100644
--- a/src/tests/end2end/CopyTests.cpp
+++ b/src/tests/end2end/CopyTests.cpp
@@ -326,7 +326,7 @@
// 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 @@
MetalBackend(),
OpenGLBackend(),
OpenGLESBackend(),
- VulkanBackend());
\ No newline at end of file
+ VulkanBackend());
diff --git a/src/tests/end2end/CopyTextureForBrowserTests.cpp b/src/tests/end2end/CopyTextureForBrowserTests.cpp
index cd9d89f..7ee7ae8 100644
--- a/src/tests/end2end/CopyTextureForBrowserTests.cpp
+++ b/src/tests/end2end/CopyTextureForBrowserTests.cpp
@@ -29,7 +29,7 @@
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 @@
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
diff --git a/src/tests/end2end/DepthStencilLoadOpTests.cpp b/src/tests/end2end/DepthStencilLoadOpTests.cpp
index b0c8887..8990408 100644
--- a/src/tests/end2end/DepthStencilLoadOpTests.cpp
+++ b/src/tests/end2end/DepthStencilLoadOpTests.cpp
@@ -49,7 +49,7 @@
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;
diff --git a/src/tests/end2end/DynamicBufferOffsetTests.cpp b/src/tests/end2end/DynamicBufferOffsetTests.cpp
index c55ef5a..77f1e7e 100644
--- a/src/tests/end2end/DynamicBufferOffsetTests.cpp
+++ b/src/tests/end2end/DynamicBufferOffsetTests.cpp
@@ -406,7 +406,7 @@
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
diff --git a/src/tests/end2end/NonzeroTextureCreationTests.cpp b/src/tests/end2end/NonzeroTextureCreationTests.cpp
index 494e03b..63c1a39 100644
--- a/src/tests/end2end/NonzeroTextureCreationTests.cpp
+++ b/src/tests/end2end/NonzeroTextureCreationTests.cpp
@@ -39,7 +39,7 @@
DepthOrArrayLayers,
MipCount,
Mip,
- SampleCount)
+ SampleCount);
template <typename T>
class ExpectNonZero : public detail::CustomTextureExpectation {
diff --git a/src/tests/end2end/ReadOnlyDepthStencilAttachmentTests.cpp b/src/tests/end2end/ReadOnlyDepthStencilAttachmentTests.cpp
index af0338e..0096dbe 100644
--- a/src/tests/end2end/ReadOnlyDepthStencilAttachmentTests.cpp
+++ b/src/tests/end2end/ReadOnlyDepthStencilAttachmentTests.cpp
@@ -22,7 +22,7 @@
namespace {
using TextureFormat = wgpu::TextureFormat;
- DAWN_TEST_PARAM_STRUCT(ReadOnlyDepthStencilAttachmentTestsParams, TextureFormat)
+ DAWN_TEST_PARAM_STRUCT(ReadOnlyDepthStencilAttachmentTestsParams, TextureFormat);
} // namespace
class ReadOnlyDepthStencilAttachmentTests
diff --git a/src/tests/perf_tests/ShaderRobustnessPerf.cpp b/src/tests/perf_tests/ShaderRobustnessPerf.cpp
index f883b86..4d8e8c2 100644
--- a/src/tests/perf_tests/ShaderRobustnessPerf.cpp
+++ b/src/tests/perf_tests/ShaderRobustnessPerf.cpp
@@ -374,7 +374,7 @@
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