Add explicit to test files.
This CL updates the test files to have explicit added for single parameter constructors and removed from zero parameter constructors. Bug: dawn:1339 Change-Id: I21339148bba5e7e89debc38ec426ba15e0d734e2 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/87021 Auto-Submit: Dan Sinclair <dsinclair@chromium.org> Kokoro: Kokoro <noreply+kokoro@google.com> Reviewed-by: Ben Clayton <bclayton@google.com> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
parent
92bef59295
commit
cccadddcb0
|
@ -273,7 +273,7 @@ class DawnTestBase {
|
|||
friend class DawnPerfTestBase;
|
||||
|
||||
public:
|
||||
DawnTestBase(const AdapterTestParam& param);
|
||||
explicit DawnTestBase(const AdapterTestParam& param);
|
||||
virtual ~DawnTestBase();
|
||||
|
||||
void SetUp();
|
||||
|
@ -327,7 +327,7 @@ class DawnTestBase {
|
|||
virtual std::unique_ptr<dawn::platform::Platform> CreateTestPlatform();
|
||||
|
||||
struct PrintToStringParamName {
|
||||
PrintToStringParamName(const char* test);
|
||||
explicit PrintToStringParamName(const char* test);
|
||||
std::string SanitizeParamName(std::string paramName, size_t index) const;
|
||||
|
||||
template <class ParamType>
|
||||
|
@ -750,7 +750,7 @@ namespace detail {
|
|||
template <typename T, typename U>
|
||||
class ExpectEq : public Expectation {
|
||||
public:
|
||||
ExpectEq(T singleValue, T tolerance = {});
|
||||
explicit ExpectEq(T singleValue, T tolerance = {});
|
||||
ExpectEq(const T* values, const unsigned int count, T tolerance = {});
|
||||
|
||||
testing::AssertionResult Check(const void* data, size_t size) override;
|
||||
|
|
|
@ -46,7 +46,7 @@ class ParamGenerator {
|
|||
public:
|
||||
using value_type = ParamStruct;
|
||||
|
||||
ParamGenerator(std::vector<Params>... params) : mParams(params...), mIsEmpty(false) {
|
||||
explicit ParamGenerator(std::vector<Params>... params) : mParams(params...), mIsEmpty(false) {
|
||||
for (bool isEmpty : {params.empty()...}) {
|
||||
mIsEmpty |= isEmpty;
|
||||
}
|
||||
|
|
|
@ -74,7 +74,7 @@ class FakePersistentCache : public dawn::platform::CachingInterface {
|
|||
// Test platform that only supports caching.
|
||||
class DawnTestPlatform : public dawn::platform::Platform {
|
||||
public:
|
||||
DawnTestPlatform(dawn::platform::CachingInterface* cachingInterface)
|
||||
explicit DawnTestPlatform(dawn::platform::CachingInterface* cachingInterface)
|
||||
: mCachingInterface(cachingInterface) {
|
||||
}
|
||||
~DawnTestPlatform() override = default;
|
||||
|
|
|
@ -423,7 +423,7 @@ class DepthStencilSamplingTest : public DawnTestWithParams<DepthStencilSamplingT
|
|||
using StencilData = std::array<uint32_t, 4>;
|
||||
|
||||
public:
|
||||
ExtraStencilComponentsExpectation(uint32_t expected) : mExpected(expected) {
|
||||
explicit ExtraStencilComponentsExpectation(uint32_t expected) : mExpected(expected) {
|
||||
}
|
||||
|
||||
~ExtraStencilComponentsExpectation() override = default;
|
||||
|
|
|
@ -40,7 +40,7 @@ class OcclusionExpectation : public detail::Expectation {
|
|||
|
||||
~OcclusionExpectation() override = default;
|
||||
|
||||
OcclusionExpectation(Result expected) {
|
||||
explicit OcclusionExpectation(Result expected) {
|
||||
mExpected = expected;
|
||||
}
|
||||
|
||||
|
|
|
@ -76,7 +76,7 @@ class ExpectFloatWithTolerance : public detail::Expectation {
|
|||
// An expectation for float16 buffers that can correctly compare NaNs (all NaNs are equivalent).
|
||||
class ExpectFloat16 : public detail::Expectation {
|
||||
public:
|
||||
ExpectFloat16(std::vector<uint16_t> expected) : mExpected(std::move(expected)) {
|
||||
explicit ExpectFloat16(std::vector<uint16_t> expected) : mExpected(std::move(expected)) {
|
||||
}
|
||||
|
||||
testing::AssertionResult Check(const void* data, size_t size) override {
|
||||
|
|
|
@ -22,10 +22,10 @@ class RCTest : public RefCounted {
|
|||
RCTest() : RefCounted() {
|
||||
}
|
||||
|
||||
RCTest(uint64_t payload) : RefCounted(payload) {
|
||||
explicit RCTest(uint64_t payload) : RefCounted(payload) {
|
||||
}
|
||||
|
||||
RCTest(bool* deleted) : mDeleted(deleted) {
|
||||
explicit RCTest(bool* deleted) : mDeleted(deleted) {
|
||||
}
|
||||
|
||||
~RCTest() override {
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
namespace {
|
||||
|
||||
struct Foo : public PlacementAllocated {
|
||||
Foo(int value) : value(value) {
|
||||
explicit Foo(int value) : value(value) {
|
||||
}
|
||||
|
||||
int value;
|
||||
|
|
|
@ -90,7 +90,7 @@ struct FakeStorage {
|
|||
// a single range (and that each subresource was seen only once).
|
||||
struct RangeTracker {
|
||||
template <typename T>
|
||||
RangeTracker(const SubresourceStorage<T>& s)
|
||||
explicit RangeTracker(const SubresourceStorage<T>& s)
|
||||
: mTracked(s.GetAspectsForTesting(),
|
||||
s.GetArrayLayerCountForTesting(),
|
||||
s.GetMipLevelCountForTesting(),
|
||||
|
|
|
@ -24,7 +24,7 @@ namespace dawn::native {
|
|||
|
||||
class BindGroupLayoutMock final : public BindGroupLayoutBase {
|
||||
public:
|
||||
BindGroupLayoutMock(DeviceBase* device) : BindGroupLayoutBase(device) {
|
||||
explicit BindGroupLayoutMock(DeviceBase* device) : BindGroupLayoutBase(device) {
|
||||
ON_CALL(*this, DestroyImpl).WillByDefault([this]() {
|
||||
this->BindGroupLayoutBase::DestroyImpl();
|
||||
});
|
||||
|
|
|
@ -24,7 +24,7 @@ namespace dawn::native {
|
|||
|
||||
class BindGroupMock : public BindGroupBase {
|
||||
public:
|
||||
BindGroupMock(DeviceBase* device) : BindGroupBase(device) {
|
||||
explicit BindGroupMock(DeviceBase* device) : BindGroupBase(device) {
|
||||
ON_CALL(*this, DestroyImpl).WillByDefault([this]() {
|
||||
this->BindGroupBase::DestroyImpl();
|
||||
});
|
||||
|
|
|
@ -24,7 +24,7 @@ namespace dawn::native {
|
|||
|
||||
class CommandBufferMock : public CommandBufferBase {
|
||||
public:
|
||||
CommandBufferMock(DeviceBase* device) : CommandBufferBase(device) {
|
||||
explicit CommandBufferMock(DeviceBase* device) : CommandBufferBase(device) {
|
||||
ON_CALL(*this, DestroyImpl).WillByDefault([this]() {
|
||||
this->CommandBufferBase::DestroyImpl();
|
||||
});
|
||||
|
|
|
@ -24,7 +24,7 @@ namespace dawn::native {
|
|||
|
||||
class ComputePipelineMock : public ComputePipelineBase {
|
||||
public:
|
||||
ComputePipelineMock(DeviceBase* device) : ComputePipelineBase(device) {
|
||||
explicit ComputePipelineMock(DeviceBase* device) : ComputePipelineBase(device) {
|
||||
ON_CALL(*this, DestroyImpl).WillByDefault([this]() {
|
||||
this->ComputePipelineBase::DestroyImpl();
|
||||
});
|
||||
|
|
|
@ -24,7 +24,7 @@ namespace dawn::native {
|
|||
|
||||
class ExternalTextureMock : public ExternalTextureBase {
|
||||
public:
|
||||
ExternalTextureMock(DeviceBase* device) : ExternalTextureBase(device) {
|
||||
explicit ExternalTextureMock(DeviceBase* device) : ExternalTextureBase(device) {
|
||||
ON_CALL(*this, DestroyImpl).WillByDefault([this]() {
|
||||
this->ExternalTextureBase::DestroyImpl();
|
||||
});
|
||||
|
|
|
@ -24,7 +24,7 @@ namespace dawn::native {
|
|||
|
||||
class PipelineLayoutMock : public PipelineLayoutBase {
|
||||
public:
|
||||
PipelineLayoutMock(DeviceBase* device) : PipelineLayoutBase(device) {
|
||||
explicit PipelineLayoutMock(DeviceBase* device) : PipelineLayoutBase(device) {
|
||||
ON_CALL(*this, DestroyImpl).WillByDefault([this]() {
|
||||
this->PipelineLayoutBase::DestroyImpl();
|
||||
});
|
||||
|
|
|
@ -24,7 +24,7 @@ namespace dawn::native {
|
|||
|
||||
class QuerySetMock : public QuerySetBase {
|
||||
public:
|
||||
QuerySetMock(DeviceBase* device) : QuerySetBase(device) {
|
||||
explicit QuerySetMock(DeviceBase* device) : QuerySetBase(device) {
|
||||
ON_CALL(*this, DestroyImpl).WillByDefault([this]() {
|
||||
this->QuerySetBase::DestroyImpl();
|
||||
});
|
||||
|
|
|
@ -24,7 +24,7 @@ namespace dawn::native {
|
|||
|
||||
class RenderPipelineMock : public RenderPipelineBase {
|
||||
public:
|
||||
RenderPipelineMock(DeviceBase* device) : RenderPipelineBase(device) {
|
||||
explicit RenderPipelineMock(DeviceBase* device) : RenderPipelineBase(device) {
|
||||
ON_CALL(*this, DestroyImpl).WillByDefault([this]() {
|
||||
this->RenderPipelineBase::DestroyImpl();
|
||||
});
|
||||
|
|
|
@ -24,7 +24,7 @@ namespace dawn::native {
|
|||
|
||||
class SamplerMock : public SamplerBase {
|
||||
public:
|
||||
SamplerMock(DeviceBase* device) : SamplerBase(device) {
|
||||
explicit SamplerMock(DeviceBase* device) : SamplerBase(device) {
|
||||
ON_CALL(*this, DestroyImpl).WillByDefault([this]() {
|
||||
this->SamplerBase::DestroyImpl();
|
||||
});
|
||||
|
|
|
@ -27,7 +27,7 @@ namespace dawn::native {
|
|||
|
||||
class ShaderModuleMock : public ShaderModuleBase {
|
||||
public:
|
||||
ShaderModuleMock(DeviceBase* device);
|
||||
explicit ShaderModuleMock(DeviceBase* device);
|
||||
~ShaderModuleMock() override = default;
|
||||
|
||||
MOCK_METHOD(void, DestroyImpl, (), (override));
|
||||
|
|
|
@ -24,7 +24,7 @@ namespace dawn::native {
|
|||
|
||||
class SwapChainMock : public SwapChainBase {
|
||||
public:
|
||||
SwapChainMock(DeviceBase* device) : SwapChainBase(device) {
|
||||
explicit SwapChainMock(DeviceBase* device) : SwapChainBase(device) {
|
||||
ON_CALL(*this, DestroyImpl).WillByDefault([this]() {
|
||||
this->SwapChainBase::DestroyImpl();
|
||||
});
|
||||
|
|
|
@ -37,7 +37,7 @@ namespace dawn::native {
|
|||
|
||||
class TextureViewMock : public TextureViewBase {
|
||||
public:
|
||||
TextureViewMock(TextureBase* texture) : TextureViewBase(texture) {
|
||||
explicit TextureViewMock(TextureBase* texture) : TextureViewBase(texture) {
|
||||
}
|
||||
~TextureViewMock() override = default;
|
||||
|
||||
|
|
|
@ -117,7 +117,7 @@ class ValidationTest : public testing::Test {
|
|||
|
||||
struct DummyRenderPass : public wgpu::RenderPassDescriptor {
|
||||
public:
|
||||
DummyRenderPass(const wgpu::Device& device);
|
||||
explicit DummyRenderPass(const wgpu::Device& device);
|
||||
wgpu::Texture attachment;
|
||||
wgpu::TextureFormat attachmentFormat;
|
||||
uint32_t width;
|
||||
|
|
|
@ -71,7 +71,7 @@ inline testing::Matcher<MatcherLambdaArgument<Lambda>> MatchesLambda(Lambda lamb
|
|||
|
||||
class StringMessageMatcher : public testing::MatcherInterface<const char*> {
|
||||
public:
|
||||
explicit StringMessageMatcher() {
|
||||
StringMessageMatcher() {
|
||||
}
|
||||
|
||||
bool MatchAndExplain(const char* message,
|
||||
|
|
|
@ -30,7 +30,7 @@ namespace dawn::native::vulkan {
|
|||
|
||||
class ExternalSemaphoreDmaBuf : public VulkanImageWrappingTestBackend::ExternalSemaphore {
|
||||
public:
|
||||
ExternalSemaphoreDmaBuf(int handle) : mHandle(handle) {
|
||||
explicit ExternalSemaphoreDmaBuf(int handle) : mHandle(handle) {
|
||||
}
|
||||
~ExternalSemaphoreDmaBuf() override {
|
||||
if (mHandle != -1) {
|
||||
|
@ -77,7 +77,7 @@ namespace dawn::native::vulkan {
|
|||
|
||||
class VulkanImageWrappingTestBackendDmaBuf : public VulkanImageWrappingTestBackend {
|
||||
public:
|
||||
VulkanImageWrappingTestBackendDmaBuf(const wgpu::Device& device) {
|
||||
explicit VulkanImageWrappingTestBackendDmaBuf(const wgpu::Device& device) {
|
||||
}
|
||||
|
||||
~VulkanImageWrappingTestBackendDmaBuf() {
|
||||
|
|
|
@ -32,7 +32,7 @@ namespace dawn::native::vulkan {
|
|||
|
||||
class ExternalSemaphoreOpaqueFD : public VulkanImageWrappingTestBackend::ExternalSemaphore {
|
||||
public:
|
||||
ExternalSemaphoreOpaqueFD(int handle) : mHandle(handle) {
|
||||
explicit ExternalSemaphoreOpaqueFD(int handle) : mHandle(handle) {
|
||||
}
|
||||
~ExternalSemaphoreOpaqueFD() override {
|
||||
if (mHandle != -1) {
|
||||
|
@ -94,7 +94,8 @@ namespace dawn::native::vulkan {
|
|||
|
||||
class VulkanImageWrappingTestBackendOpaqueFD : public VulkanImageWrappingTestBackend {
|
||||
public:
|
||||
VulkanImageWrappingTestBackendOpaqueFD(const wgpu::Device& device) : mDevice(device) {
|
||||
explicit VulkanImageWrappingTestBackendOpaqueFD(const wgpu::Device& device)
|
||||
: mDevice(device) {
|
||||
mDeviceVk = dawn::native::vulkan::ToBackend(dawn::native::FromAPI(device.Get()));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue