From 3741f7373ca7872679c0c479932ac46a7a180ae9 Mon Sep 17 00:00:00 2001 From: Corentin Wallez Date: Thu, 16 Apr 2020 18:08:23 +0000 Subject: [PATCH] Factor compilation of ~MockProcTable in mock_webgpu.cpp GMock generates a lot of code in the destuctor of mock classes, so factor that in mock_webgpu.cpp instead of compiling the code once for each file including mock_webgpu.h. Bug: None Change-Id: I2b5984e911020eb33457bde9c6a45beaa93b3071 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/19725 Commit-Queue: Corentin Wallez Reviewed-by: Austin Eng --- generator/templates/mock_webgpu.cpp | 5 +++-- generator/templates/mock_webgpu.h | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/generator/templates/mock_webgpu.cpp b/generator/templates/mock_webgpu.cpp index 4f48551fa4..6b8c5a6863 100644 --- a/generator/templates/mock_webgpu.cpp +++ b/generator/templates/mock_webgpu.cpp @@ -149,8 +149,9 @@ void ProcTableAsClass::CallFenceOnCompletionCallback(WGPUFence fence, } {% endfor %} -MockProcTable::MockProcTable() { -} +MockProcTable::MockProcTable() = default; + +MockProcTable::~MockProcTable() = default; void MockProcTable::IgnoreAllReleaseCalls() { {% for type in by_category["object"] %} diff --git a/generator/templates/mock_webgpu.h b/generator/templates/mock_webgpu.h index bdef4fbe29..78b9b78ef3 100644 --- a/generator/templates/mock_webgpu.h +++ b/generator/templates/mock_webgpu.h @@ -116,6 +116,7 @@ class ProcTableAsClass { class MockProcTable : public ProcTableAsClass { public: MockProcTable(); + ~MockProcTable() override; void IgnoreAllReleaseCalls();