[chromium-style] Split mock constructors/destructors to cpp files.
This CL moves the constructors and desctructors for the native unittest mocks into separate cpp files. Bug: dawn:1405 Change-Id: I20dccaa8114f3d7f8b61da1c1495648cb7328148 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/89121 Kokoro: Kokoro <noreply+kokoro@google.com> Reviewed-by: Ben Clayton <bclayton@google.com> Reviewed-by: Austin Eng <enga@chromium.org> Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
This commit is contained in:
parent
e6e96def66
commit
bcdb6e9da8
|
@ -157,19 +157,32 @@ source_set("native_mocks_sources") {
|
||||||
configs += [ "${dawn_root}/src/dawn/native:internal" ]
|
configs += [ "${dawn_root}/src/dawn/native:internal" ]
|
||||||
|
|
||||||
sources = [
|
sources = [
|
||||||
|
"unittests/native/mocks/BindGroupLayoutMock.cpp",
|
||||||
"unittests/native/mocks/BindGroupLayoutMock.h",
|
"unittests/native/mocks/BindGroupLayoutMock.h",
|
||||||
|
"unittests/native/mocks/BindGroupMock.cpp",
|
||||||
"unittests/native/mocks/BindGroupMock.h",
|
"unittests/native/mocks/BindGroupMock.h",
|
||||||
|
"unittests/native/mocks/BufferMock.cpp",
|
||||||
|
"unittests/native/mocks/BufferMock.h",
|
||||||
|
"unittests/native/mocks/CommandBufferMock.cpp",
|
||||||
"unittests/native/mocks/CommandBufferMock.h",
|
"unittests/native/mocks/CommandBufferMock.h",
|
||||||
|
"unittests/native/mocks/ComputePipelineMock.cpp",
|
||||||
"unittests/native/mocks/ComputePipelineMock.h",
|
"unittests/native/mocks/ComputePipelineMock.h",
|
||||||
"unittests/native/mocks/DeviceMock.h",
|
"unittests/native/mocks/DeviceMock.h",
|
||||||
|
"unittests/native/mocks/ExternalTextureMock.cpp",
|
||||||
"unittests/native/mocks/ExternalTextureMock.h",
|
"unittests/native/mocks/ExternalTextureMock.h",
|
||||||
|
"unittests/native/mocks/PipelineLayoutMock.cpp",
|
||||||
"unittests/native/mocks/PipelineLayoutMock.h",
|
"unittests/native/mocks/PipelineLayoutMock.h",
|
||||||
|
"unittests/native/mocks/QuerySetMock.cpp",
|
||||||
"unittests/native/mocks/QuerySetMock.h",
|
"unittests/native/mocks/QuerySetMock.h",
|
||||||
|
"unittests/native/mocks/RenderPipelineMock.cpp",
|
||||||
"unittests/native/mocks/RenderPipelineMock.h",
|
"unittests/native/mocks/RenderPipelineMock.h",
|
||||||
|
"unittests/native/mocks/SamplerMock.cpp",
|
||||||
"unittests/native/mocks/SamplerMock.h",
|
"unittests/native/mocks/SamplerMock.h",
|
||||||
"unittests/native/mocks/ShaderModuleMock.cpp",
|
"unittests/native/mocks/ShaderModuleMock.cpp",
|
||||||
"unittests/native/mocks/ShaderModuleMock.h",
|
"unittests/native/mocks/ShaderModuleMock.h",
|
||||||
|
"unittests/native/mocks/SwapChainMock.cpp",
|
||||||
"unittests/native/mocks/SwapChainMock.h",
|
"unittests/native/mocks/SwapChainMock.h",
|
||||||
|
"unittests/native/mocks/TextureMock.cpp",
|
||||||
"unittests/native/mocks/TextureMock.h",
|
"unittests/native/mocks/TextureMock.h",
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
// Copyright 2022 The Dawn Authors
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
// you may not use this file except in compliance with the License.
|
||||||
|
// You may obtain a copy of the License at
|
||||||
|
//
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
//
|
||||||
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
// See the License for the specific language governing permissions and
|
||||||
|
// limitations under the License.
|
||||||
|
|
||||||
|
#include "dawn/tests/unittests/native/mocks/BindGroupLayoutMock.h"
|
||||||
|
|
||||||
|
namespace dawn::native {
|
||||||
|
|
||||||
|
BindGroupLayoutMock::BindGroupLayoutMock(DeviceBase* device) : BindGroupLayoutBase(device) {
|
||||||
|
ON_CALL(*this, DestroyImpl).WillByDefault([this]() {
|
||||||
|
this->BindGroupLayoutBase::DestroyImpl();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
BindGroupLayoutMock::~BindGroupLayoutMock() = default;
|
||||||
|
|
||||||
|
} // namespace dawn::native
|
|
@ -24,12 +24,8 @@ namespace dawn::native {
|
||||||
|
|
||||||
class BindGroupLayoutMock final : public BindGroupLayoutBase {
|
class BindGroupLayoutMock final : public BindGroupLayoutBase {
|
||||||
public:
|
public:
|
||||||
explicit BindGroupLayoutMock(DeviceBase* device) : BindGroupLayoutBase(device) {
|
explicit BindGroupLayoutMock(DeviceBase* device);
|
||||||
ON_CALL(*this, DestroyImpl).WillByDefault([this]() {
|
~BindGroupLayoutMock() override;
|
||||||
this->BindGroupLayoutBase::DestroyImpl();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
~BindGroupLayoutMock() override = default;
|
|
||||||
|
|
||||||
MOCK_METHOD(void, DestroyImpl, (), (override));
|
MOCK_METHOD(void, DestroyImpl, (), (override));
|
||||||
};
|
};
|
||||||
|
|
|
@ -0,0 +1,25 @@
|
||||||
|
// Copyright 2022 The Dawn Authors
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
// you may not use this file except in compliance with the License.
|
||||||
|
// You may obtain a copy of the License at
|
||||||
|
//
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
//
|
||||||
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
// See the License for the specific language governing permissions and
|
||||||
|
// limitations under the License.
|
||||||
|
|
||||||
|
#include "dawn/tests/unittests/native/mocks/BindGroupMock.h"
|
||||||
|
|
||||||
|
namespace dawn::native {
|
||||||
|
|
||||||
|
BindGroupMock::BindGroupMock(DeviceBase* device) : BindGroupBase(device) {
|
||||||
|
ON_CALL(*this, DestroyImpl).WillByDefault([this]() { this->BindGroupBase::DestroyImpl(); });
|
||||||
|
}
|
||||||
|
|
||||||
|
BindGroupMock::~BindGroupMock() = default;
|
||||||
|
|
||||||
|
} // namespace dawn::native
|
|
@ -24,10 +24,8 @@ namespace dawn::native {
|
||||||
|
|
||||||
class BindGroupMock : public BindGroupBase {
|
class BindGroupMock : public BindGroupBase {
|
||||||
public:
|
public:
|
||||||
explicit BindGroupMock(DeviceBase* device) : BindGroupBase(device) {
|
explicit BindGroupMock(DeviceBase* device);
|
||||||
ON_CALL(*this, DestroyImpl).WillByDefault([this]() { this->BindGroupBase::DestroyImpl(); });
|
~BindGroupMock() override;
|
||||||
}
|
|
||||||
~BindGroupMock() override = default;
|
|
||||||
|
|
||||||
MOCK_METHOD(void, DestroyImpl, (), (override));
|
MOCK_METHOD(void, DestroyImpl, (), (override));
|
||||||
};
|
};
|
||||||
|
|
|
@ -0,0 +1,26 @@
|
||||||
|
// Copyright 2022 The Dawn Authors
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
// you may not use this file except in compliance with the License.
|
||||||
|
// You may obtain a copy of the License at
|
||||||
|
//
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
//
|
||||||
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
// See the License for the specific language governing permissions and
|
||||||
|
// limitations under the License.
|
||||||
|
|
||||||
|
#include "dawn/tests/unittests/native/mocks/BufferMock.h"
|
||||||
|
|
||||||
|
namespace dawn::native {
|
||||||
|
|
||||||
|
BufferMock::BufferMock(DeviceBase* device, BufferBase::BufferState state)
|
||||||
|
: BufferBase(device, state) {
|
||||||
|
ON_CALL(*this, DestroyImpl).WillByDefault([this]() { this->BufferBase::DestroyImpl(); });
|
||||||
|
}
|
||||||
|
|
||||||
|
BufferMock::~BufferMock() = default;
|
||||||
|
|
||||||
|
} // namespace dawn::native
|
|
@ -24,10 +24,8 @@ namespace dawn::native {
|
||||||
|
|
||||||
class BufferMock : public BufferBase {
|
class BufferMock : public BufferBase {
|
||||||
public:
|
public:
|
||||||
BufferMock(DeviceBase* device, BufferBase::BufferState state) : BufferBase(device, state) {
|
BufferMock(DeviceBase* device, BufferBase::BufferState state);
|
||||||
ON_CALL(*this, DestroyImpl).WillByDefault([this]() { this->BufferBase::DestroyImpl(); });
|
~BufferMock() override;
|
||||||
}
|
|
||||||
~BufferMock() override = default;
|
|
||||||
|
|
||||||
MOCK_METHOD(void, DestroyImpl, (), (override));
|
MOCK_METHOD(void, DestroyImpl, (), (override));
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,25 @@
|
||||||
|
// Copyright 2022 The Dawn Authors
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
// you may not use this file except in compliance with the License.
|
||||||
|
// You may obtain a copy of the License at
|
||||||
|
//
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
//
|
||||||
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
// See the License for the specific language governing permissions and
|
||||||
|
// limitations under the License.
|
||||||
|
|
||||||
|
#include "dawn/tests/unittests/native/mocks/CommandBufferMock.h"
|
||||||
|
|
||||||
|
namespace dawn::native {
|
||||||
|
|
||||||
|
CommandBufferMock::CommandBufferMock(DeviceBase* device) : CommandBufferBase(device) {
|
||||||
|
ON_CALL(*this, DestroyImpl).WillByDefault([this]() { this->CommandBufferBase::DestroyImpl(); });
|
||||||
|
}
|
||||||
|
|
||||||
|
CommandBufferMock::~CommandBufferMock() = default;
|
||||||
|
|
||||||
|
} // namespace dawn::native
|
|
@ -24,12 +24,8 @@ namespace dawn::native {
|
||||||
|
|
||||||
class CommandBufferMock : public CommandBufferBase {
|
class CommandBufferMock : public CommandBufferBase {
|
||||||
public:
|
public:
|
||||||
explicit CommandBufferMock(DeviceBase* device) : CommandBufferBase(device) {
|
explicit CommandBufferMock(DeviceBase* device);
|
||||||
ON_CALL(*this, DestroyImpl).WillByDefault([this]() {
|
~CommandBufferMock() override;
|
||||||
this->CommandBufferBase::DestroyImpl();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
~CommandBufferMock() override = default;
|
|
||||||
|
|
||||||
MOCK_METHOD(void, DestroyImpl, (), (override));
|
MOCK_METHOD(void, DestroyImpl, (), (override));
|
||||||
};
|
};
|
||||||
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
// Copyright 2022 The Dawn Authors
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
// you may not use this file except in compliance with the License.
|
||||||
|
// You may obtain a copy of the License at
|
||||||
|
//
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
//
|
||||||
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
// See the License for the specific language governing permissions and
|
||||||
|
// limitations under the License.
|
||||||
|
|
||||||
|
#include "dawn/tests/unittests/native/mocks/ComputePipelineMock.h"
|
||||||
|
|
||||||
|
namespace dawn::native {
|
||||||
|
|
||||||
|
ComputePipelineMock::ComputePipelineMock(DeviceBase* device) : ComputePipelineBase(device) {
|
||||||
|
ON_CALL(*this, DestroyImpl).WillByDefault([this]() {
|
||||||
|
this->ComputePipelineBase::DestroyImpl();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
ComputePipelineMock::~ComputePipelineMock() = default;
|
||||||
|
|
||||||
|
} // namespace dawn::native
|
|
@ -24,12 +24,8 @@ namespace dawn::native {
|
||||||
|
|
||||||
class ComputePipelineMock : public ComputePipelineBase {
|
class ComputePipelineMock : public ComputePipelineBase {
|
||||||
public:
|
public:
|
||||||
explicit ComputePipelineMock(DeviceBase* device) : ComputePipelineBase(device) {
|
explicit ComputePipelineMock(DeviceBase* device);
|
||||||
ON_CALL(*this, DestroyImpl).WillByDefault([this]() {
|
~ComputePipelineMock() override;
|
||||||
this->ComputePipelineBase::DestroyImpl();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
~ComputePipelineMock() override = default;
|
|
||||||
|
|
||||||
MOCK_METHOD(MaybeError, Initialize, (), (override));
|
MOCK_METHOD(MaybeError, Initialize, (), (override));
|
||||||
MOCK_METHOD(size_t, ComputeContentHash, (), (override));
|
MOCK_METHOD(size_t, ComputeContentHash, (), (override));
|
||||||
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
// Copyright 2022 The Dawn Authors
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
// you may not use this file except in compliance with the License.
|
||||||
|
// You may obtain a copy of the License at
|
||||||
|
//
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
//
|
||||||
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
// See the License for the specific language governing permissions and
|
||||||
|
// limitations under the License.
|
||||||
|
|
||||||
|
#include "dawn/tests/unittests/native/mocks/ExternalTextureMock.h"
|
||||||
|
|
||||||
|
namespace dawn::native {
|
||||||
|
|
||||||
|
ExternalTextureMock::ExternalTextureMock(DeviceBase* device) : ExternalTextureBase(device) {
|
||||||
|
ON_CALL(*this, DestroyImpl).WillByDefault([this]() {
|
||||||
|
this->ExternalTextureBase::DestroyImpl();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
ExternalTextureMock::~ExternalTextureMock() = default;
|
||||||
|
|
||||||
|
} // namespace dawn::native
|
|
@ -24,12 +24,8 @@ namespace dawn::native {
|
||||||
|
|
||||||
class ExternalTextureMock : public ExternalTextureBase {
|
class ExternalTextureMock : public ExternalTextureBase {
|
||||||
public:
|
public:
|
||||||
explicit ExternalTextureMock(DeviceBase* device) : ExternalTextureBase(device) {
|
explicit ExternalTextureMock(DeviceBase* device);
|
||||||
ON_CALL(*this, DestroyImpl).WillByDefault([this]() {
|
~ExternalTextureMock() override;
|
||||||
this->ExternalTextureBase::DestroyImpl();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
~ExternalTextureMock() override = default;
|
|
||||||
|
|
||||||
MOCK_METHOD(void, DestroyImpl, (), (override));
|
MOCK_METHOD(void, DestroyImpl, (), (override));
|
||||||
};
|
};
|
||||||
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
// Copyright 2022 The Dawn Authors
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
// you may not use this file except in compliance with the License.
|
||||||
|
// You may obtain a copy of the License at
|
||||||
|
//
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
//
|
||||||
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
// See the License for the specific language governing permissions and
|
||||||
|
// limitations under the License.
|
||||||
|
|
||||||
|
#include "dawn/tests/unittests/native/mocks/PipelineLayoutMock.h"
|
||||||
|
|
||||||
|
namespace dawn::native {
|
||||||
|
|
||||||
|
PipelineLayoutMock::PipelineLayoutMock(DeviceBase* device) : PipelineLayoutBase(device) {
|
||||||
|
ON_CALL(*this, DestroyImpl).WillByDefault([this]() {
|
||||||
|
this->PipelineLayoutBase::DestroyImpl();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
PipelineLayoutMock::~PipelineLayoutMock() = default;
|
||||||
|
|
||||||
|
} // namespace dawn::native
|
|
@ -24,12 +24,8 @@ namespace dawn::native {
|
||||||
|
|
||||||
class PipelineLayoutMock : public PipelineLayoutBase {
|
class PipelineLayoutMock : public PipelineLayoutBase {
|
||||||
public:
|
public:
|
||||||
explicit PipelineLayoutMock(DeviceBase* device) : PipelineLayoutBase(device) {
|
explicit PipelineLayoutMock(DeviceBase* device);
|
||||||
ON_CALL(*this, DestroyImpl).WillByDefault([this]() {
|
~PipelineLayoutMock() override;
|
||||||
this->PipelineLayoutBase::DestroyImpl();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
~PipelineLayoutMock() override = default;
|
|
||||||
|
|
||||||
MOCK_METHOD(void, DestroyImpl, (), (override));
|
MOCK_METHOD(void, DestroyImpl, (), (override));
|
||||||
};
|
};
|
||||||
|
|
|
@ -0,0 +1,25 @@
|
||||||
|
// Copyright 2022 The Dawn Authors
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
// you may not use this file except in compliance with the License.
|
||||||
|
// You may obtain a copy of the License at
|
||||||
|
//
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
//
|
||||||
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
// See the License for the specific language governing permissions and
|
||||||
|
// limitations under the License.
|
||||||
|
|
||||||
|
#include "dawn/tests/unittests/native/mocks/QuerySetMock.h"
|
||||||
|
|
||||||
|
namespace dawn::native {
|
||||||
|
|
||||||
|
QuerySetMock::QuerySetMock(DeviceBase* device) : QuerySetBase(device) {
|
||||||
|
ON_CALL(*this, DestroyImpl).WillByDefault([this]() { this->QuerySetBase::DestroyImpl(); });
|
||||||
|
}
|
||||||
|
|
||||||
|
QuerySetMock::~QuerySetMock() = default;
|
||||||
|
|
||||||
|
} // namespace dawn::native
|
|
@ -24,10 +24,8 @@ namespace dawn::native {
|
||||||
|
|
||||||
class QuerySetMock : public QuerySetBase {
|
class QuerySetMock : public QuerySetBase {
|
||||||
public:
|
public:
|
||||||
explicit QuerySetMock(DeviceBase* device) : QuerySetBase(device) {
|
explicit QuerySetMock(DeviceBase* device);
|
||||||
ON_CALL(*this, DestroyImpl).WillByDefault([this]() { this->QuerySetBase::DestroyImpl(); });
|
~QuerySetMock() override;
|
||||||
}
|
|
||||||
~QuerySetMock() override = default;
|
|
||||||
|
|
||||||
MOCK_METHOD(void, DestroyImpl, (), (override));
|
MOCK_METHOD(void, DestroyImpl, (), (override));
|
||||||
};
|
};
|
||||||
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
// Copyright 2022 The Dawn Authors
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
// you may not use this file except in compliance with the License.
|
||||||
|
// You may obtain a copy of the License at
|
||||||
|
//
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
//
|
||||||
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
// See the License for the specific language governing permissions and
|
||||||
|
// limitations under the License.
|
||||||
|
|
||||||
|
#include "dawn/tests/unittests/native/mocks/RenderPipelineMock.h"
|
||||||
|
|
||||||
|
namespace dawn::native {
|
||||||
|
|
||||||
|
RenderPipelineMock::RenderPipelineMock(DeviceBase* device) : RenderPipelineBase(device) {
|
||||||
|
ON_CALL(*this, DestroyImpl).WillByDefault([this]() {
|
||||||
|
this->RenderPipelineBase::DestroyImpl();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
RenderPipelineMock::~RenderPipelineMock() = default;
|
||||||
|
|
||||||
|
} // namespace dawn::native
|
|
@ -24,12 +24,8 @@ namespace dawn::native {
|
||||||
|
|
||||||
class RenderPipelineMock : public RenderPipelineBase {
|
class RenderPipelineMock : public RenderPipelineBase {
|
||||||
public:
|
public:
|
||||||
explicit RenderPipelineMock(DeviceBase* device) : RenderPipelineBase(device) {
|
explicit RenderPipelineMock(DeviceBase* device);
|
||||||
ON_CALL(*this, DestroyImpl).WillByDefault([this]() {
|
~RenderPipelineMock() override;
|
||||||
this->RenderPipelineBase::DestroyImpl();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
~RenderPipelineMock() override = default;
|
|
||||||
|
|
||||||
MOCK_METHOD(MaybeError, Initialize, (), (override));
|
MOCK_METHOD(MaybeError, Initialize, (), (override));
|
||||||
MOCK_METHOD(size_t, ComputeContentHash, (), (override));
|
MOCK_METHOD(size_t, ComputeContentHash, (), (override));
|
||||||
|
|
|
@ -0,0 +1,25 @@
|
||||||
|
// Copyright 2022 The Dawn Authors
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
// you may not use this file except in compliance with the License.
|
||||||
|
// You may obtain a copy of the License at
|
||||||
|
//
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
//
|
||||||
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
// See the License for the specific language governing permissions and
|
||||||
|
// limitations under the License.
|
||||||
|
|
||||||
|
#include "dawn/tests/unittests/native/mocks/SamplerMock.h"
|
||||||
|
|
||||||
|
namespace dawn::native {
|
||||||
|
|
||||||
|
SamplerMock::SamplerMock(DeviceBase* device) : SamplerBase(device) {
|
||||||
|
ON_CALL(*this, DestroyImpl).WillByDefault([this]() { this->SamplerBase::DestroyImpl(); });
|
||||||
|
}
|
||||||
|
|
||||||
|
SamplerMock::~SamplerMock() = default;
|
||||||
|
|
||||||
|
} // namespace dawn::native
|
|
@ -24,10 +24,8 @@ namespace dawn::native {
|
||||||
|
|
||||||
class SamplerMock : public SamplerBase {
|
class SamplerMock : public SamplerBase {
|
||||||
public:
|
public:
|
||||||
explicit SamplerMock(DeviceBase* device) : SamplerBase(device) {
|
explicit SamplerMock(DeviceBase* device);
|
||||||
ON_CALL(*this, DestroyImpl).WillByDefault([this]() { this->SamplerBase::DestroyImpl(); });
|
~SamplerMock() override;
|
||||||
}
|
|
||||||
~SamplerMock() override = default;
|
|
||||||
|
|
||||||
MOCK_METHOD(void, DestroyImpl, (), (override));
|
MOCK_METHOD(void, DestroyImpl, (), (override));
|
||||||
};
|
};
|
||||||
|
|
|
@ -20,6 +20,8 @@ ShaderModuleMock::ShaderModuleMock(DeviceBase* device) : ShaderModuleBase(device
|
||||||
ON_CALL(*this, DestroyImpl).WillByDefault([this]() { this->ShaderModuleBase::DestroyImpl(); });
|
ON_CALL(*this, DestroyImpl).WillByDefault([this]() { this->ShaderModuleBase::DestroyImpl(); });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ShaderModuleMock::~ShaderModuleMock() = default;
|
||||||
|
|
||||||
ResultOrError<Ref<ShaderModuleMock>> ShaderModuleMock::Create(DeviceBase* device,
|
ResultOrError<Ref<ShaderModuleMock>> ShaderModuleMock::Create(DeviceBase* device,
|
||||||
const char* source) {
|
const char* source) {
|
||||||
ShaderModuleMock* mock = new ShaderModuleMock(device);
|
ShaderModuleMock* mock = new ShaderModuleMock(device);
|
||||||
|
|
|
@ -28,7 +28,7 @@ namespace dawn::native {
|
||||||
class ShaderModuleMock : public ShaderModuleBase {
|
class ShaderModuleMock : public ShaderModuleBase {
|
||||||
public:
|
public:
|
||||||
explicit ShaderModuleMock(DeviceBase* device);
|
explicit ShaderModuleMock(DeviceBase* device);
|
||||||
~ShaderModuleMock() override = default;
|
~ShaderModuleMock() override;
|
||||||
|
|
||||||
MOCK_METHOD(void, DestroyImpl, (), (override));
|
MOCK_METHOD(void, DestroyImpl, (), (override));
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,25 @@
|
||||||
|
// Copyright 2022 The Dawn Authors
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
// you may not use this file except in compliance with the License.
|
||||||
|
// You may obtain a copy of the License at
|
||||||
|
//
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
//
|
||||||
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
// See the License for the specific language governing permissions and
|
||||||
|
// limitations under the License.
|
||||||
|
|
||||||
|
#include "dawn/tests/unittests/native/mocks/SwapChainMock.h"
|
||||||
|
|
||||||
|
namespace dawn::native {
|
||||||
|
|
||||||
|
SwapChainMock::SwapChainMock(DeviceBase* device) : SwapChainBase(device) {
|
||||||
|
ON_CALL(*this, DestroyImpl).WillByDefault([this]() { this->SwapChainBase::DestroyImpl(); });
|
||||||
|
}
|
||||||
|
|
||||||
|
SwapChainMock::~SwapChainMock() = default;
|
||||||
|
|
||||||
|
} // namespace dawn::native
|
|
@ -24,10 +24,8 @@ namespace dawn::native {
|
||||||
|
|
||||||
class SwapChainMock : public SwapChainBase {
|
class SwapChainMock : public SwapChainBase {
|
||||||
public:
|
public:
|
||||||
explicit SwapChainMock(DeviceBase* device) : SwapChainBase(device) {
|
explicit SwapChainMock(DeviceBase* device);
|
||||||
ON_CALL(*this, DestroyImpl).WillByDefault([this]() { this->SwapChainBase::DestroyImpl(); });
|
~SwapChainMock() override;
|
||||||
}
|
|
||||||
~SwapChainMock() override = default;
|
|
||||||
|
|
||||||
MOCK_METHOD(void, DestroyImpl, (), (override));
|
MOCK_METHOD(void, DestroyImpl, (), (override));
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,30 @@
|
||||||
|
// Copyright 2022 The Dawn Authors
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
// you may not use this file except in compliance with the License.
|
||||||
|
// You may obtain a copy of the License at
|
||||||
|
//
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
//
|
||||||
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
// See the License for the specific language governing permissions and
|
||||||
|
// limitations under the License.
|
||||||
|
|
||||||
|
#include "dawn/tests/unittests/native/mocks/TextureMock.h"
|
||||||
|
|
||||||
|
namespace dawn::native {
|
||||||
|
|
||||||
|
TextureMock::TextureMock(DeviceBase* device, TextureBase::TextureState state)
|
||||||
|
: TextureBase(device, state) {
|
||||||
|
ON_CALL(*this, DestroyImpl).WillByDefault([this]() { this->TextureBase::DestroyImpl(); });
|
||||||
|
}
|
||||||
|
|
||||||
|
TextureMock::~TextureMock() = default;
|
||||||
|
|
||||||
|
TextureViewMock::TextureViewMock(TextureBase* texture) : TextureViewBase(texture) {}
|
||||||
|
|
||||||
|
TextureViewMock::~TextureViewMock() = default;
|
||||||
|
|
||||||
|
} // namespace dawn::native
|
|
@ -24,18 +24,16 @@ namespace dawn::native {
|
||||||
|
|
||||||
class TextureMock : public TextureBase {
|
class TextureMock : public TextureBase {
|
||||||
public:
|
public:
|
||||||
TextureMock(DeviceBase* device, TextureBase::TextureState state) : TextureBase(device, state) {
|
TextureMock(DeviceBase* device, TextureBase::TextureState state);
|
||||||
ON_CALL(*this, DestroyImpl).WillByDefault([this]() { this->TextureBase::DestroyImpl(); });
|
~TextureMock() override;
|
||||||
}
|
|
||||||
~TextureMock() override = default;
|
|
||||||
|
|
||||||
MOCK_METHOD(void, DestroyImpl, (), (override));
|
MOCK_METHOD(void, DestroyImpl, (), (override));
|
||||||
};
|
};
|
||||||
|
|
||||||
class TextureViewMock : public TextureViewBase {
|
class TextureViewMock : public TextureViewBase {
|
||||||
public:
|
public:
|
||||||
explicit TextureViewMock(TextureBase* texture) : TextureViewBase(texture) {}
|
explicit TextureViewMock(TextureBase* texture);
|
||||||
~TextureViewMock() override = default;
|
~TextureViewMock() override;
|
||||||
|
|
||||||
MOCK_METHOD(void, DestroyImpl, (), (override));
|
MOCK_METHOD(void, DestroyImpl, (), (override));
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue