Remove redundant parentheses on lambdas
They're optional if the lambda has no parameters.
Change-Id: I0aefcbe52fc7bd7859723bec5c67dff9b0c3fb9a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/138600
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
diff --git a/src/dawn/native/Blob.cpp b/src/dawn/native/Blob.cpp
index 78b18e7..64243b4 100644
--- a/src/dawn/native/Blob.cpp
+++ b/src/dawn/native/Blob.cpp
@@ -33,7 +33,7 @@
uint8_t* data = new uint8_t[allocatedSize];
uint8_t* ptr = AlignPtr(data, alignment);
ASSERT(ptr + size <= data + allocatedSize);
- return Blob::UnsafeCreateWithDeleter(ptr, size, [=]() { delete[] data; });
+ return Blob::UnsafeCreateWithDeleter(ptr, size, [=] { delete[] data; });
} else {
return Blob();
}
diff --git a/src/dawn/native/Blob.h b/src/dawn/native/Blob.h
index 807082c..bb692a0 100644
--- a/src/dawn/native/Blob.h
+++ b/src/dawn/native/Blob.h
@@ -68,7 +68,7 @@
size_t size = vec.size() * sizeof(T);
// Move the vector into a new allocation so we can destruct it in the deleter.
auto* wrapped_vec = new std::vector<T>(std::move(vec));
- return Blob::UnsafeCreateWithDeleter(data, size, [wrapped_vec]() { delete wrapped_vec; });
+ return Blob::UnsafeCreateWithDeleter(data, size, [wrapped_vec] { delete wrapped_vec; });
}
} // namespace dawn::native
diff --git a/src/dawn/native/Device.cpp b/src/dawn/native/Device.cpp
index 477b0a9..8b96acf 100644
--- a/src/dawn/native/Device.cpp
+++ b/src/dawn/native/Device.cpp
@@ -1872,7 +1872,7 @@
WGPUCreatePipelineAsyncStatus status =
CreatePipelineAsyncStatusFromErrorType(error->GetType());
mCallbackTaskManager->AddCallbackTask(
- [callback, message = error->GetFormattedMessage(), status, userdata]() {
+ [callback, message = error->GetFormattedMessage(), status, userdata] {
callback(status, nullptr, message.c_str(), userdata);
});
} else {
@@ -1907,7 +1907,7 @@
WGPUCreatePipelineAsyncStatus status =
CreatePipelineAsyncStatusFromErrorType(error->GetType());
mCallbackTaskManager->AddCallbackTask(
- [callback, message = error->GetFormattedMessage(), status, userdata]() {
+ [callback, message = error->GetFormattedMessage(), status, userdata] {
callback(status, nullptr, message.c_str(), userdata);
});
} else {
diff --git a/src/dawn/native/ErrorInjector.h b/src/dawn/native/ErrorInjector.h
index a65d80b..2c58cc4 100644
--- a/src/dawn/native/ErrorInjector.h
+++ b/src/dawn/native/ErrorInjector.h
@@ -48,7 +48,7 @@
#if defined(DAWN_ENABLE_ERROR_INJECTION)
#define INJECT_ERROR_OR_RUN(stmt, ...) \
- [&]() { \
+ [&] { \
if (DAWN_UNLIKELY(::dawn::native::ErrorInjectorEnabled())) { \
/* Only used for testing and fuzzing, so it's okay if this is deoptimized */ \
auto injectedError = ::dawn::native::MaybeInjectError(__VA_ARGS__); \
diff --git a/src/dawn/native/ShaderModule.cpp b/src/dawn/native/ShaderModule.cpp
index 0d49e3d..ecb2ab5 100644
--- a/src/dawn/native/ShaderModule.cpp
+++ b/src/dawn/native/ShaderModule.cpp
@@ -523,7 +523,7 @@
// error in metadata.infringedLimits. This is to delay the emission of these validation
// errors until the entry point is used.
#define DelayedInvalidIf(invalid, ...) \
- ([&]() { \
+ ([&] { \
if (invalid) { \
metadata->infringedLimitErrors.push_back(absl::StrFormat(__VA_ARGS__)); \
} \
diff --git a/src/dawn/native/d3d/BlobD3D.cpp b/src/dawn/native/d3d/BlobD3D.cpp
index b57690b..f1f623f 100644
--- a/src/dawn/native/d3d/BlobD3D.cpp
+++ b/src/dawn/native/d3d/BlobD3D.cpp
@@ -20,7 +20,7 @@
// Detach so the deleter callback can "own" the reference
ID3DBlob* ptr = blob.Detach();
return Blob::UnsafeCreateWithDeleter(reinterpret_cast<uint8_t*>(ptr->GetBufferPointer()),
- ptr->GetBufferSize(), [=]() {
+ ptr->GetBufferSize(), [=] {
// Reattach and drop to delete it.
ComPtr<ID3DBlob> b;
b.Attach(ptr);
@@ -32,7 +32,7 @@
// Detach so the deleter callback can "own" the reference
IDxcBlob* ptr = blob.Detach();
return Blob::UnsafeCreateWithDeleter(reinterpret_cast<uint8_t*>(ptr->GetBufferPointer()),
- ptr->GetBufferSize(), [=]() {
+ ptr->GetBufferSize(), [=] {
// Reattach and drop to delete it.
ComPtr<IDxcBlob> b;
b.Attach(ptr);
diff --git a/src/dawn/native/metal/BackendMTL.mm b/src/dawn/native/metal/BackendMTL.mm
index ddc09bf..46fb215 100644
--- a/src/dawn/native/metal/BackendMTL.mm
+++ b/src/dawn/native/metal/BackendMTL.mm
@@ -445,7 +445,7 @@
}
if (@available(macOS 10.15, iOS 14.0, *)) {
- auto ShouldLeakCounterSets = [this]() {
+ auto ShouldLeakCounterSets = [this] {
// Intentionally leak counterSets to workaround an issue where the driver
// over-releases the handle if it is accessed more than once. It becomes a zombie.
// For more information, see crbug.com/1443658.
diff --git a/src/dawn/native/opengl/TextureGL.cpp b/src/dawn/native/opengl/TextureGL.cpp
index b548781..fe8f1fd 100644
--- a/src/dawn/native/opengl/TextureGL.cpp
+++ b/src/dawn/native/opengl/TextureGL.cpp
@@ -407,7 +407,7 @@
gl.Disable(GL_SCISSOR_TEST);
gl.ColorMask(true, true, true, true);
- auto DoClear = [&]() {
+ auto DoClear = [&] {
switch (baseType) {
case TextureComponentType::Float: {
gl.ClearBufferfv(GL_COLOR, 0,
diff --git a/src/dawn/native/vulkan/CommandBufferVk.cpp b/src/dawn/native/vulkan/CommandBufferVk.cpp
index fbd3115..e6ab4af 100644
--- a/src/dawn/native/vulkan/CommandBufferVk.cpp
+++ b/src/dawn/native/vulkan/CommandBufferVk.cpp
@@ -1117,7 +1117,7 @@
// on our infra).
ClampFragDepthArgs clampFragDepthArgs = {0.0f, 1.0f};
bool clampFragDepthArgsDirty = true;
- auto ApplyClampFragDepthArgs = [&]() {
+ auto ApplyClampFragDepthArgs = [&] {
if (!clampFragDepthArgsDirty || lastPipeline == nullptr) {
return;
}
diff --git a/src/dawn/platform/WorkerThread.cpp b/src/dawn/platform/WorkerThread.cpp
index bf71df7..90351dc 100644
--- a/src/dawn/platform/WorkerThread.cpp
+++ b/src/dawn/platform/WorkerThread.cpp
@@ -76,7 +76,7 @@
std::unique_ptr<AsyncWaitableEvent> waitableEvent = std::make_unique<AsyncWaitableEvent>();
std::function<void()> doTask = [callback, userdata,
- waitableEventImpl = waitableEvent->GetWaitableEventImpl()]() {
+ waitableEventImpl = waitableEvent->GetWaitableEventImpl()] {
callback(userdata);
waitableEventImpl->MarkAsComplete();
};
diff --git a/src/dawn/tests/DawnTest.cpp b/src/dawn/tests/DawnTest.cpp
index 612efee..695642d 100644
--- a/src/dawn/tests/DawnTest.cpp
+++ b/src/dawn/tests/DawnTest.cpp
@@ -425,7 +425,7 @@
void DawnTestEnvironment::SelectPreferredAdapterProperties(const native::Instance* instance) {
// Get the first available preferred device type.
std::optional<wgpu::AdapterType> preferredDeviceType;
- [&]() {
+ [&] {
for (wgpu::AdapterType devicePreference : mDevicePreferences) {
for (bool compatibilityMode : {false, true}) {
wgpu::RequestAdapterOptions adapterOptions;
diff --git a/src/dawn/tests/end2end/BufferTests.cpp b/src/dawn/tests/end2end/BufferTests.cpp
index aef2815..cce1607 100644
--- a/src/dawn/tests/end2end/BufferTests.cpp
+++ b/src/dawn/tests/end2end/BufferTests.cpp
@@ -881,7 +881,7 @@
wgpu::Buffer buffer = BufferMappedAtCreationWithData(
wgpu::BufferUsage::MapWrite | wgpu::BufferUsage::CopySrc, {myData});
- ASSERT_DEVICE_ERROR([&]() {
+ ASSERT_DEVICE_ERROR([&] {
bool done = false;
buffer.MapAsync(
wgpu::MapMode::Write, 0, 4,
diff --git a/src/dawn/tests/end2end/ComputeLayoutMemoryBufferTests.cpp b/src/dawn/tests/end2end/ComputeLayoutMemoryBufferTests.cpp
index 54bbb63..c402164 100644
--- a/src/dawn/tests/end2end/ComputeLayoutMemoryBufferTests.cpp
+++ b/src/dawn/tests/end2end/ComputeLayoutMemoryBufferTests.cpp
@@ -167,12 +167,12 @@
// bytes and avoid NaN or Inf.
constexpr uint8_t dataMask = ~paddingMask;
// Get a data byte
- auto NextDataByte = [&]() {
+ auto NextDataByte = [&] {
dataByte += 0x11u;
return static_cast<uint8_t>((dataByte ^ dataXorKey) & dataMask);
};
// Get a padding byte
- auto NextPaddingByte = [&]() {
+ auto NextPaddingByte = [&] {
paddingByte += 0x13u;
return static_cast<uint8_t>((paddingByte ^ paddingXorKey) | paddingMask);
};
diff --git a/src/dawn/tests/end2end/SubresourceRenderAttachmentTests.cpp b/src/dawn/tests/end2end/SubresourceRenderAttachmentTests.cpp
index 33cff40..4ab2a88 100644
--- a/src/dawn/tests/end2end/SubresourceRenderAttachmentTests.cpp
+++ b/src/dawn/tests/end2end/SubresourceRenderAttachmentTests.cpp
@@ -46,7 +46,7 @@
float expectedDepth = 0.3f;
uint8_t expectedStencil = 7;
- utils::ComboRenderPassDescriptor renderPass = [&]() {
+ utils::ComboRenderPassDescriptor renderPass = [&] {
switch (type) {
case Type::Color: {
utils::ComboRenderPassDescriptor renderPass({renderTargetView});
diff --git a/src/dawn/tests/unittests/ContentLessObjectCacheTests.cpp b/src/dawn/tests/unittests/ContentLessObjectCacheTests.cpp
index b117814..6c67223 100644
--- a/src/dawn/tests/unittests/ContentLessObjectCacheTests.cpp
+++ b/src/dawn/tests/unittests/ContentLessObjectCacheTests.cpp
@@ -181,7 +181,7 @@
ContentLessObjectCache<RefCountedT, TypeParam> cache;
std::vector<Ref<RefCountedT>> objects(kNumObjects);
- auto f = [&]() {
+ auto f = [&] {
for (size_t i = 0; i < kNumObjects; i++) {
Ref<RefCountedT> object =
AcquireRef(new RefCountedT(i, [&](RefCountedT* x) { cache.Erase(x); }));
@@ -220,9 +220,9 @@
EXPECT_TRUE(cache.Insert(object.Get()).second);
// Thread A will release the last reference of the original object.
- auto threadA = [&]() { object = nullptr; };
+ auto threadA = [&] { object = nullptr; };
// Thread B will try to Find the entry before it is completely destroyed.
- auto threadB = [&]() {
+ auto threadB = [&] {
signalA.Wait();
TypeParam blueprint(1);
EXPECT_TRUE(cache.Find(&blueprint) == nullptr);
@@ -252,10 +252,10 @@
AcquireRef(new RefCountedT(1, [&](RefCountedT* x) { cache.Erase(x); }));
// Thread A will release the last reference of the original object.
- auto threadA = [&]() { object1 = nullptr; };
+ auto threadA = [&] { object1 = nullptr; };
// Thread B will try to Insert a hash equivalent entry before the original is completely
// destroyed.
- auto threadB = [&]() {
+ auto threadB = [&] {
signalA.Wait();
EXPECT_TRUE(cache.Insert(object2.Get()).second);
signalB.Fire();
diff --git a/src/dawn/tests/unittests/PerThreadProcTests.cpp b/src/dawn/tests/unittests/PerThreadProcTests.cpp
index bd33879..fa5e5cd 100644
--- a/src/dawn/tests/unittests/PerThreadProcTests.cpp
+++ b/src/dawn/tests/unittests/PerThreadProcTests.cpp
@@ -67,7 +67,7 @@
wgpu::Device deviceB =
wgpu::Device::Acquire(reinterpret_cast<WGPUDevice>(mAdapterBase.APICreateDevice()));
- std::thread threadA([&]() {
+ std::thread threadA([&] {
DawnProcTable procs = native::GetProcs();
procs.deviceCreateBuffer = [](WGPUDevice device,
WGPUBufferDescriptor const* descriptor) -> WGPUBuffer {
@@ -88,7 +88,7 @@
dawnProcSetPerThreadProcs(nullptr);
});
- std::thread threadB([&]() {
+ std::thread threadB([&] {
DawnProcTable procs = native::GetProcs();
procs.deviceCreateBuffer = [](WGPUDevice device,
WGPUBufferDescriptor const* bufferDesc) -> WGPUBuffer {
diff --git a/src/dawn/tests/unittests/RefCountedTests.cpp b/src/dawn/tests/unittests/RefCountedTests.cpp
index 40ee4e9..9c05049 100644
--- a/src/dawn/tests/unittests/RefCountedTests.cpp
+++ b/src/dawn/tests/unittests/RefCountedTests.cpp
@@ -72,7 +72,7 @@
bool deleted = false;
auto* test = new RCTest(&deleted);
- auto referenceManyTimes = [test]() {
+ auto referenceManyTimes = [test] {
for (uint32_t i = 0; i < 100000; ++i) {
test->Reference();
}
@@ -84,7 +84,7 @@
t2.join();
EXPECT_EQ(test->GetRefCountForTesting(), 200001u);
- auto releaseManyTimes = [test]() {
+ auto releaseManyTimes = [test] {
for (uint32_t i = 0; i < 100000; ++i) {
test->Release();
}
diff --git a/src/dawn/tests/unittests/native/BlobTests.cpp b/src/dawn/tests/unittests/native/BlobTests.cpp
index 05f8a7d..c3b653a 100644
--- a/src/dawn/tests/unittests/native/BlobTests.cpp
+++ b/src/dawn/tests/unittests/native/BlobTests.cpp
@@ -58,7 +58,7 @@
testing::StrictMock<testing::MockFunction<void()>> mockDeleter;
{
// Make a blob with a mock deleter.
- Blob b = Blob::UnsafeCreateWithDeleter(data, sizeof(data), [&]() { mockDeleter.Call(); });
+ Blob b = Blob::UnsafeCreateWithDeleter(data, sizeof(data), [&] { mockDeleter.Call(); });
// Check the contents.
EXPECT_FALSE(b.Empty());
EXPECT_EQ(b.Size(), sizeof(data));
@@ -77,7 +77,7 @@
testing::StrictMock<testing::MockFunction<void()>> mockDeleter;
{
// Make a blob with a mock deleter.
- Blob b = Blob::UnsafeCreateWithDeleter(data, 0, [&]() { mockDeleter.Call(); });
+ Blob b = Blob::UnsafeCreateWithDeleter(data, 0, [&] { mockDeleter.Call(); });
// Check the contents.
EXPECT_TRUE(b.Empty());
EXPECT_EQ(b.Size(), 0u);
@@ -95,7 +95,7 @@
testing::StrictMock<testing::MockFunction<void()>> mockDeleter;
{
// Make a blob with a mock deleter.
- Blob b = Blob::UnsafeCreateWithDeleter(nullptr, 0, [&]() { mockDeleter.Call(); });
+ Blob b = Blob::UnsafeCreateWithDeleter(nullptr, 0, [&] { mockDeleter.Call(); });
// Check the contents.
EXPECT_TRUE(b.Empty());
EXPECT_EQ(b.Size(), 0u);
@@ -150,7 +150,7 @@
// Create another blob with a mock deleter.
testing::StrictMock<testing::MockFunction<void()>> mockDeleter;
- Blob b2 = Blob::UnsafeCreateWithDeleter(nullptr, 0, [&]() { mockDeleter.Call(); });
+ Blob b2 = Blob::UnsafeCreateWithDeleter(nullptr, 0, [&] { mockDeleter.Call(); });
// Move b1 into b2, replacing b2's contents, and expect the deleter to be called.
EXPECT_CALL(mockDeleter, Call());
@@ -191,7 +191,7 @@
size_t size = sizeof(data) - offset;
testing::StrictMock<testing::MockFunction<void()>> mockDeleter;
Blob b =
- Blob::UnsafeCreateWithDeleter(&data[offset], size, [&]() { mockDeleter.Call(); });
+ Blob::UnsafeCreateWithDeleter(&data[offset], size, [&] { mockDeleter.Call(); });
bool alreadyAligned = IsPtrAligned(&data[offset], alignment);
// The backing store should be deleted at the end of the scope, or because it was
diff --git a/src/dawn/tests/unittests/native/StreamTests.cpp b/src/dawn/tests/unittests/native/StreamTests.cpp
index fb5b5d1..c6f5f08 100644
--- a/src/dawn/tests/unittests/native/StreamTests.cpp
+++ b/src/dawn/tests/unittests/native/StreamTests.cpp
@@ -194,7 +194,7 @@
// Test that ByteVectorSink serializes Blobs as expected.
TEST(SerializeTests, Blob) {
uint8_t data[] = "dawn native Blob";
- Blob blob = Blob::UnsafeCreateWithDeleter(data, sizeof(data), []() {});
+ Blob blob = Blob::UnsafeCreateWithDeleter(data, sizeof(data), [] {});
ByteVectorSink expected;
StreamIn(&expected, sizeof(data));
diff --git a/src/dawn/tests/unittests/native/mocks/BindGroupLayoutMock.cpp b/src/dawn/tests/unittests/native/mocks/BindGroupLayoutMock.cpp
index 6a57746..b4b4173 100644
--- a/src/dawn/tests/unittests/native/mocks/BindGroupLayoutMock.cpp
+++ b/src/dawn/tests/unittests/native/mocks/BindGroupLayoutMock.cpp
@@ -20,9 +20,7 @@
const BindGroupLayoutDescriptor* descriptor,
PipelineCompatibilityToken pipelineCompatibilityToken)
: BindGroupLayoutBase(device, descriptor, pipelineCompatibilityToken) {
- ON_CALL(*this, DestroyImpl).WillByDefault([this]() {
- this->BindGroupLayoutBase::DestroyImpl();
- });
+ ON_CALL(*this, DestroyImpl).WillByDefault([this] { this->BindGroupLayoutBase::DestroyImpl(); });
SetContentHash(ComputeContentHash());
}
diff --git a/src/dawn/tests/unittests/native/mocks/BindGroupMock.cpp b/src/dawn/tests/unittests/native/mocks/BindGroupMock.cpp
index 81e6459..457fe70 100644
--- a/src/dawn/tests/unittests/native/mocks/BindGroupMock.cpp
+++ b/src/dawn/tests/unittests/native/mocks/BindGroupMock.cpp
@@ -19,7 +19,7 @@
BindGroupMock::BindGroupMock(DeviceMock* device, const BindGroupDescriptor* descriptor)
: BindGroupDataHolder(descriptor->layout->GetBindingDataSize()),
BindGroupBase(device, descriptor, mBindingDataAllocation) {
- ON_CALL(*this, DestroyImpl).WillByDefault([this]() { this->BindGroupBase::DestroyImpl(); });
+ ON_CALL(*this, DestroyImpl).WillByDefault([this] { this->BindGroupBase::DestroyImpl(); });
}
BindGroupMock::~BindGroupMock() = default;
diff --git a/src/dawn/tests/unittests/native/mocks/BufferMock.cpp b/src/dawn/tests/unittests/native/mocks/BufferMock.cpp
index 5cffcec..d58139c 100644
--- a/src/dawn/tests/unittests/native/mocks/BufferMock.cpp
+++ b/src/dawn/tests/unittests/native/mocks/BufferMock.cpp
@@ -23,9 +23,9 @@
mBackingData = std::unique_ptr<uint8_t[]>(new uint8_t[GetSize()]);
mAllocatedSize = GetSize();
- ON_CALL(*this, DestroyImpl).WillByDefault([this]() { this->BufferBase::DestroyImpl(); });
+ ON_CALL(*this, DestroyImpl).WillByDefault([this] { this->BufferBase::DestroyImpl(); });
ON_CALL(*this, GetMappedPointer).WillByDefault(Return(mBackingData.get()));
- ON_CALL(*this, IsCPUWritableAtCreation).WillByDefault([this]() {
+ ON_CALL(*this, IsCPUWritableAtCreation).WillByDefault([this] {
return (GetUsage() & (wgpu::BufferUsage::MapRead | wgpu::BufferUsage::MapWrite)) != 0;
});
}
diff --git a/src/dawn/tests/unittests/native/mocks/CommandBufferMock.cpp b/src/dawn/tests/unittests/native/mocks/CommandBufferMock.cpp
index 579cdda..45fa5cd 100644
--- a/src/dawn/tests/unittests/native/mocks/CommandBufferMock.cpp
+++ b/src/dawn/tests/unittests/native/mocks/CommandBufferMock.cpp
@@ -26,7 +26,7 @@
// directly passed in.
ASSERT(device == encoder->GetDevice());
- ON_CALL(*this, DestroyImpl).WillByDefault([this]() { this->CommandBufferBase::DestroyImpl(); });
+ ON_CALL(*this, DestroyImpl).WillByDefault([this] { this->CommandBufferBase::DestroyImpl(); });
}
CommandBufferMock::~CommandBufferMock() = default;
diff --git a/src/dawn/tests/unittests/native/mocks/ComputePipelineMock.cpp b/src/dawn/tests/unittests/native/mocks/ComputePipelineMock.cpp
index 97280ef..a2a9825 100644
--- a/src/dawn/tests/unittests/native/mocks/ComputePipelineMock.cpp
+++ b/src/dawn/tests/unittests/native/mocks/ComputePipelineMock.cpp
@@ -22,9 +22,7 @@
const ComputePipelineDescriptor* descriptor)
: ComputePipelineBase(device, descriptor) {
ON_CALL(*this, Initialize).WillByDefault([]() -> MaybeError { return {}; });
- ON_CALL(*this, DestroyImpl).WillByDefault([this]() {
- this->ComputePipelineBase::DestroyImpl();
- });
+ ON_CALL(*this, DestroyImpl).WillByDefault([this] { this->ComputePipelineBase::DestroyImpl(); });
}
ComputePipelineMock::~ComputePipelineMock() = default;
diff --git a/src/dawn/tests/unittests/native/mocks/ExternalTextureMock.cpp b/src/dawn/tests/unittests/native/mocks/ExternalTextureMock.cpp
index 0b96a84..addbba5 100644
--- a/src/dawn/tests/unittests/native/mocks/ExternalTextureMock.cpp
+++ b/src/dawn/tests/unittests/native/mocks/ExternalTextureMock.cpp
@@ -21,9 +21,7 @@
ExternalTextureMock::ExternalTextureMock(DeviceMock* device,
const ExternalTextureDescriptor* descriptor)
: ExternalTextureBase(device, descriptor) {
- ON_CALL(*this, DestroyImpl).WillByDefault([this]() {
- this->ExternalTextureBase::DestroyImpl();
- });
+ ON_CALL(*this, DestroyImpl).WillByDefault([this] { this->ExternalTextureBase::DestroyImpl(); });
}
ExternalTextureMock::~ExternalTextureMock() = default;
diff --git a/src/dawn/tests/unittests/native/mocks/PipelineLayoutMock.cpp b/src/dawn/tests/unittests/native/mocks/PipelineLayoutMock.cpp
index 091450f..95d7bb4 100644
--- a/src/dawn/tests/unittests/native/mocks/PipelineLayoutMock.cpp
+++ b/src/dawn/tests/unittests/native/mocks/PipelineLayoutMock.cpp
@@ -19,9 +19,7 @@
PipelineLayoutMock::PipelineLayoutMock(DeviceMock* device,
const PipelineLayoutDescriptor* descriptor)
: PipelineLayoutBase(device, descriptor) {
- ON_CALL(*this, DestroyImpl).WillByDefault([this]() {
- this->PipelineLayoutBase::DestroyImpl();
- });
+ ON_CALL(*this, DestroyImpl).WillByDefault([this] { this->PipelineLayoutBase::DestroyImpl(); });
SetContentHash(ComputeContentHash());
}
diff --git a/src/dawn/tests/unittests/native/mocks/QuerySetMock.cpp b/src/dawn/tests/unittests/native/mocks/QuerySetMock.cpp
index 6ba771e..f3b787d 100644
--- a/src/dawn/tests/unittests/native/mocks/QuerySetMock.cpp
+++ b/src/dawn/tests/unittests/native/mocks/QuerySetMock.cpp
@@ -18,7 +18,7 @@
QuerySetMock::QuerySetMock(DeviceMock* device, const QuerySetDescriptor* descriptor)
: QuerySetBase(device, descriptor) {
- ON_CALL(*this, DestroyImpl).WillByDefault([this]() { this->QuerySetBase::DestroyImpl(); });
+ ON_CALL(*this, DestroyImpl).WillByDefault([this] { this->QuerySetBase::DestroyImpl(); });
}
QuerySetMock::~QuerySetMock() = default;
diff --git a/src/dawn/tests/unittests/native/mocks/QueueMock.cpp b/src/dawn/tests/unittests/native/mocks/QueueMock.cpp
index f95d055..ead0ada 100644
--- a/src/dawn/tests/unittests/native/mocks/QueueMock.cpp
+++ b/src/dawn/tests/unittests/native/mocks/QueueMock.cpp
@@ -20,7 +20,7 @@
QueueMock::QueueMock(DeviceMock* device, const QueueDescriptor* descriptor)
: QueueBase(device, descriptor) {
- ON_CALL(*this, DestroyImpl).WillByDefault([this]() { this->QueueBase::DestroyImpl(); });
+ ON_CALL(*this, DestroyImpl).WillByDefault([this] { this->QueueBase::DestroyImpl(); });
}
QueueMock::~QueueMock() = default;
diff --git a/src/dawn/tests/unittests/native/mocks/RenderPipelineMock.cpp b/src/dawn/tests/unittests/native/mocks/RenderPipelineMock.cpp
index e2c500e..6f44867 100644
--- a/src/dawn/tests/unittests/native/mocks/RenderPipelineMock.cpp
+++ b/src/dawn/tests/unittests/native/mocks/RenderPipelineMock.cpp
@@ -22,9 +22,7 @@
const RenderPipelineDescriptor* descriptor)
: RenderPipelineBase(device, descriptor) {
ON_CALL(*this, Initialize).WillByDefault([]() -> MaybeError { return {}; });
- ON_CALL(*this, DestroyImpl).WillByDefault([this]() {
- this->RenderPipelineBase::DestroyImpl();
- });
+ ON_CALL(*this, DestroyImpl).WillByDefault([this] { this->RenderPipelineBase::DestroyImpl(); });
}
RenderPipelineMock::~RenderPipelineMock() = default;
diff --git a/src/dawn/tests/unittests/native/mocks/SamplerMock.cpp b/src/dawn/tests/unittests/native/mocks/SamplerMock.cpp
index c4249cd..230a106 100644
--- a/src/dawn/tests/unittests/native/mocks/SamplerMock.cpp
+++ b/src/dawn/tests/unittests/native/mocks/SamplerMock.cpp
@@ -18,7 +18,7 @@
SamplerMock::SamplerMock(DeviceMock* device, const SamplerDescriptor* descriptor)
: SamplerBase(device, descriptor) {
- ON_CALL(*this, DestroyImpl).WillByDefault([this]() { this->SamplerBase::DestroyImpl(); });
+ ON_CALL(*this, DestroyImpl).WillByDefault([this] { this->SamplerBase::DestroyImpl(); });
SetContentHash(ComputeContentHash());
}
diff --git a/src/dawn/tests/unittests/native/mocks/ShaderModuleMock.cpp b/src/dawn/tests/unittests/native/mocks/ShaderModuleMock.cpp
index 2bbb681..e86ba70 100644
--- a/src/dawn/tests/unittests/native/mocks/ShaderModuleMock.cpp
+++ b/src/dawn/tests/unittests/native/mocks/ShaderModuleMock.cpp
@@ -22,7 +22,7 @@
ShaderModuleMock::ShaderModuleMock(DeviceMock* device, const ShaderModuleDescriptor* descriptor)
: ShaderModuleBase(device, descriptor) {
- ON_CALL(*this, DestroyImpl).WillByDefault([this]() { this->ShaderModuleBase::DestroyImpl(); });
+ ON_CALL(*this, DestroyImpl).WillByDefault([this] { this->ShaderModuleBase::DestroyImpl(); });
SetContentHash(ComputeContentHash());
}
diff --git a/src/dawn/tests/unittests/native/mocks/SwapChainMock.cpp b/src/dawn/tests/unittests/native/mocks/SwapChainMock.cpp
index 0301c62..f8d8d1b 100644
--- a/src/dawn/tests/unittests/native/mocks/SwapChainMock.cpp
+++ b/src/dawn/tests/unittests/native/mocks/SwapChainMock.cpp
@@ -20,7 +20,7 @@
Surface* surface,
const SwapChainDescriptor* descriptor)
: SwapChainBase(device, surface, descriptor) {
- ON_CALL(*this, DestroyImpl).WillByDefault([this]() { this->SwapChainBase::DestroyImpl(); });
+ ON_CALL(*this, DestroyImpl).WillByDefault([this] { this->SwapChainBase::DestroyImpl(); });
}
SwapChainMock::~SwapChainMock() = default;
diff --git a/src/dawn/tests/unittests/native/mocks/TextureMock.cpp b/src/dawn/tests/unittests/native/mocks/TextureMock.cpp
index 0980509..7150fae 100644
--- a/src/dawn/tests/unittests/native/mocks/TextureMock.cpp
+++ b/src/dawn/tests/unittests/native/mocks/TextureMock.cpp
@@ -20,14 +20,14 @@
const TextureDescriptor* descriptor,
TextureBase::TextureState state)
: TextureBase(device, descriptor, state) {
- ON_CALL(*this, DestroyImpl).WillByDefault([this]() { this->TextureBase::DestroyImpl(); });
+ ON_CALL(*this, DestroyImpl).WillByDefault([this] { this->TextureBase::DestroyImpl(); });
}
TextureMock::~TextureMock() = default;
TextureViewMock::TextureViewMock(TextureBase* texture, const TextureViewDescriptor* descriptor)
: TextureViewBase(texture, descriptor) {
- ON_CALL(*this, DestroyImpl).WillByDefault([this]() { this->TextureViewBase::DestroyImpl(); });
+ ON_CALL(*this, DestroyImpl).WillByDefault([this] { this->TextureViewBase::DestroyImpl(); });
}
TextureViewMock::~TextureViewMock() = default;
diff --git a/src/dawn/tests/unittests/validation/BufferValidationTests.cpp b/src/dawn/tests/unittests/validation/BufferValidationTests.cpp
index 76a01d2..20a94c7 100644
--- a/src/dawn/tests/unittests/validation/BufferValidationTests.cpp
+++ b/src/dawn/tests/unittests/validation/BufferValidationTests.cpp
@@ -514,7 +514,7 @@
buf.MapAsync(wgpu::MapMode::Read, 0, 4, ToMockBufferMapAsyncCallback, nullptr);
EXPECT_CALL(*mockBufferMapAsyncCallback, Call(WGPUBufferMapAsyncStatus_Success, _))
- .WillOnce(InvokeWithoutArgs([&]() { buf.Unmap(); }));
+ .WillOnce(InvokeWithoutArgs([&] { buf.Unmap(); }));
WaitForAllOperations(device);
}
@@ -523,7 +523,7 @@
buf.MapAsync(wgpu::MapMode::Write, 0, 4, ToMockBufferMapAsyncCallback, nullptr);
EXPECT_CALL(*mockBufferMapAsyncCallback, Call(WGPUBufferMapAsyncStatus_Success, _))
- .WillOnce(InvokeWithoutArgs([&]() { buf.Unmap(); }));
+ .WillOnce(InvokeWithoutArgs([&] { buf.Unmap(); }));
WaitForAllOperations(device);
}
@@ -536,7 +536,7 @@
buf.MapAsync(wgpu::MapMode::Read, 0, 4, ToMockBufferMapAsyncCallback, nullptr);
EXPECT_CALL(*mockBufferMapAsyncCallback, Call(WGPUBufferMapAsyncStatus_Success, _))
- .WillOnce(InvokeWithoutArgs([&]() { buf.Destroy(); }));
+ .WillOnce(InvokeWithoutArgs([&] { buf.Destroy(); }));
WaitForAllOperations(device);
}
@@ -545,7 +545,7 @@
buf.MapAsync(wgpu::MapMode::Write, 0, 4, ToMockBufferMapAsyncCallback, nullptr);
EXPECT_CALL(*mockBufferMapAsyncCallback, Call(WGPUBufferMapAsyncStatus_Success, _))
- .WillOnce(InvokeWithoutArgs([&]() { buf.Destroy(); }));
+ .WillOnce(InvokeWithoutArgs([&] { buf.Destroy(); }));
WaitForAllOperations(device);
}
@@ -560,7 +560,7 @@
wgpu::Buffer buf = CreateMapReadBuffer(4);
EXPECT_CALL(*mockBufferMapAsyncCallback, Call(WGPUBufferMapAsyncStatus_Success, _))
- .WillOnce(InvokeWithoutArgs([&]() {
+ .WillOnce(InvokeWithoutArgs([&] {
EXPECT_CALL(*mockBufferMapAsyncCallback,
Call(WGPUBufferMapAsyncStatus_ValidationError, _));
// Should cause validation error because of already mapped buffer
@@ -582,7 +582,7 @@
wgpu::Buffer buf = CreateMapReadBuffer(4);
EXPECT_CALL(*mockBufferMapAsyncCallback, Call(WGPUBufferMapAsyncStatus_ValidationError, _))
- .WillOnce(InvokeWithoutArgs([&]() {
+ .WillOnce(InvokeWithoutArgs([&] {
// Retry with valid parameter and it should succeed
EXPECT_CALL(*mockBufferMapAsyncCallback, Call(WGPUBufferMapAsyncStatus_Success, _));
buf.MapAsync(wgpu::MapMode::Read, 0, 4, ToMockBufferMapAsyncCallback, nullptr);
@@ -603,7 +603,7 @@
EXPECT_CALL(*mockBufferMapAsyncCallback,
Call(WGPUBufferMapAsyncStatus_UnmappedBeforeCallback, _))
- .WillOnce(InvokeWithoutArgs([&]() {
+ .WillOnce(InvokeWithoutArgs([&] {
// MapAsync call on unmapped buffer should be valid
EXPECT_CALL(*mockBufferMapAsyncCallback, Call(WGPUBufferMapAsyncStatus_Success, _));
buf.MapAsync(wgpu::MapMode::Read, 0, 4, ToMockBufferMapAsyncCallback, nullptr);
@@ -621,7 +621,7 @@
EXPECT_CALL(*mockBufferMapAsyncCallback,
Call(WGPUBufferMapAsyncStatus_DestroyedBeforeCallback, _))
- .WillOnce(InvokeWithoutArgs([&]() {
+ .WillOnce(InvokeWithoutArgs([&] {
// MapAsync call on destroyed buffer should be invalid
EXPECT_CALL(*mockBufferMapAsyncCallback,
Call(WGPUBufferMapAsyncStatus_ValidationError, _));
diff --git a/src/dawn/tests/unittests/wire/WireAdapterTests.cpp b/src/dawn/tests/unittests/wire/WireAdapterTests.cpp
index e0183fb..8f89016 100644
--- a/src/dawn/tests/unittests/wire/WireAdapterTests.cpp
+++ b/src/dawn/tests/unittests/wire/WireAdapterTests.cpp
@@ -58,7 +58,7 @@
// Expect the server to receive the message. Then, mock a fake reply.
apiAdapter = api.GetNewAdapter();
EXPECT_CALL(api, OnInstanceRequestAdapter(apiInstance, NotNull(), NotNull(), NotNull()))
- .WillOnce(InvokeWithoutArgs([&]() {
+ .WillOnce(InvokeWithoutArgs([&] {
EXPECT_CALL(api, AdapterGetProperties(apiAdapter, NotNull()))
.WillOnce(WithArg<1>(Invoke([&](WGPUAdapterProperties* properties) {
*properties = {};
@@ -212,7 +212,7 @@
wgpu::Device device;
EXPECT_CALL(api, OnAdapterRequestDevice(apiAdapter, NotNull(), NotNull(), NotNull()))
- .WillOnce(InvokeWithoutArgs([&]() {
+ .WillOnce(InvokeWithoutArgs([&] {
// Set on device creation to forward callbacks to the client.
EXPECT_CALL(api, OnDeviceSetUncapturedErrorCallback(apiDevice, NotNull(), NotNull()))
.Times(1);
@@ -313,7 +313,7 @@
// wire does not.
WGPUDevice apiDevice = api.GetNewDevice();
EXPECT_CALL(api, OnAdapterRequestDevice(apiAdapter, NotNull(), NotNull(), NotNull()))
- .WillOnce(InvokeWithoutArgs([&]() {
+ .WillOnce(InvokeWithoutArgs([&] {
EXPECT_CALL(api, DeviceEnumerateFeatures(apiDevice, nullptr))
.WillOnce(Return(fakeFeatures.size()));
@@ -351,7 +351,7 @@
// Expect the server to receive the message. Then, mock an error.
EXPECT_CALL(api, OnAdapterRequestDevice(apiAdapter, NotNull(), NotNull(), NotNull()))
- .WillOnce(InvokeWithoutArgs([&]() {
+ .WillOnce(InvokeWithoutArgs([&] {
api.CallAdapterRequestDeviceCallback(apiAdapter, WGPURequestDeviceStatus_Error, nullptr,
"Request device failed");
}));
diff --git a/src/dawn/tests/unittests/wire/WireBufferMappingTests.cpp b/src/dawn/tests/unittests/wire/WireBufferMappingTests.cpp
index ba848c2..d87e9e0 100644
--- a/src/dawn/tests/unittests/wire/WireBufferMappingTests.cpp
+++ b/src/dawn/tests/unittests/wire/WireBufferMappingTests.cpp
@@ -107,9 +107,8 @@
uint32_t bufferContent = 31337;
EXPECT_CALL(api, OnBufferMapAsync(apiBuffer, WGPUMapMode_Read, 0, kBufferSize, _, _))
- .WillOnce(InvokeWithoutArgs([&]() {
- api.CallBufferMapAsyncCallback(apiBuffer, WGPUBufferMapAsyncStatus_Success);
- }));
+ .WillOnce(InvokeWithoutArgs(
+ [&] { api.CallBufferMapAsyncCallback(apiBuffer, WGPUBufferMapAsyncStatus_Success); }));
EXPECT_CALL(api, BufferGetConstMappedRange(apiBuffer, 0, kBufferSize))
.WillOnce(Return(&bufferContent));
@@ -134,7 +133,7 @@
wgpuBufferMapAsync(buffer, WGPUMapMode_Read, 0, kBufferSize, ToMockBufferMapCallback, nullptr);
EXPECT_CALL(api, OnBufferMapAsync(apiBuffer, WGPUMapMode_Read, 0, kBufferSize, _, _))
- .WillOnce(InvokeWithoutArgs([&]() {
+ .WillOnce(InvokeWithoutArgs([&] {
api.CallBufferMapAsyncCallback(apiBuffer, WGPUBufferMapAsyncStatus_ValidationError);
}));
@@ -155,9 +154,8 @@
// Return success
uint32_t bufferContent = 0;
EXPECT_CALL(api, OnBufferMapAsync(apiBuffer, WGPUMapMode_Read, 0, kBufferSize, _, _))
- .WillOnce(InvokeWithoutArgs([&]() {
- api.CallBufferMapAsyncCallback(apiBuffer, WGPUBufferMapAsyncStatus_Success);
- }));
+ .WillOnce(InvokeWithoutArgs(
+ [&] { api.CallBufferMapAsyncCallback(apiBuffer, WGPUBufferMapAsyncStatus_Success); }));
EXPECT_CALL(api, BufferGetConstMappedRange(apiBuffer, 0, kBufferSize))
.WillOnce(Return(&bufferContent));
@@ -179,9 +177,8 @@
uint32_t bufferContent = 31337;
EXPECT_CALL(api, OnBufferMapAsync(apiBuffer, WGPUMapMode_Read, 0, kBufferSize, _, _))
- .WillOnce(InvokeWithoutArgs([&]() {
- api.CallBufferMapAsyncCallback(apiBuffer, WGPUBufferMapAsyncStatus_Success);
- }));
+ .WillOnce(InvokeWithoutArgs(
+ [&] { api.CallBufferMapAsyncCallback(apiBuffer, WGPUBufferMapAsyncStatus_Success); }));
EXPECT_CALL(api, BufferGetConstMappedRange(apiBuffer, 0, kBufferSize))
.WillOnce(Return(&bufferContent));
@@ -205,7 +202,7 @@
wgpuBufferMapAsync(buffer, WGPUMapMode_Read, 0, kBufferSize, ToMockBufferMapCallback, nullptr);
EXPECT_CALL(api, OnBufferMapAsync(apiBuffer, WGPUMapMode_Read, 0, kBufferSize, _, _))
- .WillOnce(InvokeWithoutArgs([&]() {
+ .WillOnce(InvokeWithoutArgs([&] {
api.CallBufferMapAsyncCallback(apiBuffer, WGPUBufferMapAsyncStatus_ValidationError);
}));
@@ -230,9 +227,8 @@
uint32_t bufferContent = 31337;
EXPECT_CALL(api, OnBufferMapAsync(apiBuffer, WGPUMapMode_Read, 0, kBufferSize, _, _))
- .WillOnce(InvokeWithoutArgs([&]() {
- api.CallBufferMapAsyncCallback(apiBuffer, WGPUBufferMapAsyncStatus_Success);
- }));
+ .WillOnce(InvokeWithoutArgs(
+ [&] { api.CallBufferMapAsyncCallback(apiBuffer, WGPUBufferMapAsyncStatus_Success); }));
EXPECT_CALL(api, BufferGetConstMappedRange(apiBuffer, 0, kBufferSize))
.WillOnce(Return(&bufferContent));
@@ -256,7 +252,7 @@
wgpuBufferMapAsync(buffer, WGPUMapMode_Read, 0, kBufferSize, ToMockBufferMapCallback, nullptr);
EXPECT_CALL(api, OnBufferMapAsync(apiBuffer, WGPUMapMode_Read, 0, kBufferSize, _, _))
- .WillOnce(InvokeWithoutArgs([&]() {
+ .WillOnce(InvokeWithoutArgs([&] {
api.CallBufferMapAsyncCallback(apiBuffer, WGPUBufferMapAsyncStatus_ValidationError);
}));
@@ -282,9 +278,8 @@
uint32_t bufferContent = 31337;
EXPECT_CALL(api, OnBufferMapAsync(apiBuffer, WGPUMapMode_Read, 0, kBufferSize, _, _))
- .WillOnce(InvokeWithoutArgs([&]() {
- api.CallBufferMapAsyncCallback(apiBuffer, WGPUBufferMapAsyncStatus_Success);
- }));
+ .WillOnce(InvokeWithoutArgs(
+ [&] { api.CallBufferMapAsyncCallback(apiBuffer, WGPUBufferMapAsyncStatus_Success); }));
EXPECT_CALL(api, BufferGetConstMappedRange(apiBuffer, 0, kBufferSize))
.WillOnce(Return(&bufferContent));
@@ -297,7 +292,7 @@
// Map failure while the buffer is already mapped
wgpuBufferMapAsync(buffer, WGPUMapMode_Read, 0, kBufferSize, ToMockBufferMapCallback, nullptr);
EXPECT_CALL(api, OnBufferMapAsync(apiBuffer, WGPUMapMode_Read, 0, kBufferSize, _, _))
- .WillOnce(InvokeWithoutArgs([&]() {
+ .WillOnce(InvokeWithoutArgs([&] {
api.CallBufferMapAsyncCallback(apiBuffer, WGPUBufferMapAsyncStatus_ValidationError);
}));
@@ -317,16 +312,15 @@
uint32_t bufferContent = 31337;
EXPECT_CALL(api, OnBufferMapAsync(apiBuffer, WGPUMapMode_Read, 0, kBufferSize, _, _))
- .WillOnce(InvokeWithoutArgs([&]() {
- api.CallBufferMapAsyncCallback(apiBuffer, WGPUBufferMapAsyncStatus_Success);
- }));
+ .WillOnce(InvokeWithoutArgs(
+ [&] { api.CallBufferMapAsyncCallback(apiBuffer, WGPUBufferMapAsyncStatus_Success); }));
EXPECT_CALL(api, BufferGetConstMappedRange(apiBuffer, 0, kBufferSize))
.WillOnce(Return(&bufferContent));
FlushClient();
EXPECT_CALL(*mockBufferMapCallback, Call(WGPUBufferMapAsyncStatus_Success, _))
- .WillOnce(InvokeWithoutArgs([&]() { wgpuBufferUnmap(buffer); }));
+ .WillOnce(InvokeWithoutArgs([&] { wgpuBufferUnmap(buffer); }));
FlushServer();
@@ -342,16 +336,15 @@
uint32_t bufferContent = 31337;
EXPECT_CALL(api, OnBufferMapAsync(apiBuffer, WGPUMapMode_Read, 0, kBufferSize, _, _))
- .WillOnce(InvokeWithoutArgs([&]() {
- api.CallBufferMapAsyncCallback(apiBuffer, WGPUBufferMapAsyncStatus_Success);
- }));
+ .WillOnce(InvokeWithoutArgs(
+ [&] { api.CallBufferMapAsyncCallback(apiBuffer, WGPUBufferMapAsyncStatus_Success); }));
EXPECT_CALL(api, BufferGetConstMappedRange(apiBuffer, 0, kBufferSize))
.WillOnce(Return(&bufferContent));
FlushClient();
EXPECT_CALL(*mockBufferMapCallback, Call(WGPUBufferMapAsyncStatus_Success, _))
- .WillOnce(InvokeWithoutArgs([&]() { wgpuBufferRelease(buffer); }));
+ .WillOnce(InvokeWithoutArgs([&] { wgpuBufferRelease(buffer); }));
FlushServer();
@@ -381,9 +374,8 @@
uint32_t updatedContent = 4242;
EXPECT_CALL(api, OnBufferMapAsync(apiBuffer, WGPUMapMode_Write, 0, kBufferSize, _, _))
- .WillOnce(InvokeWithoutArgs([&]() {
- api.CallBufferMapAsyncCallback(apiBuffer, WGPUBufferMapAsyncStatus_Success);
- }));
+ .WillOnce(InvokeWithoutArgs(
+ [&] { api.CallBufferMapAsyncCallback(apiBuffer, WGPUBufferMapAsyncStatus_Success); }));
EXPECT_CALL(api, BufferGetMappedRange(apiBuffer, 0, kBufferSize))
.WillOnce(Return(&serverBufferContent));
@@ -416,7 +408,7 @@
wgpuBufferMapAsync(buffer, WGPUMapMode_Write, 0, kBufferSize, ToMockBufferMapCallback, nullptr);
EXPECT_CALL(api, OnBufferMapAsync(apiBuffer, WGPUMapMode_Write, 0, kBufferSize, _, _))
- .WillOnce(InvokeWithoutArgs([&]() {
+ .WillOnce(InvokeWithoutArgs([&] {
api.CallBufferMapAsyncCallback(apiBuffer, WGPUBufferMapAsyncStatus_ValidationError);
}));
@@ -437,9 +429,8 @@
// Return success
uint32_t bufferContent = 31337;
EXPECT_CALL(api, OnBufferMapAsync(apiBuffer, WGPUMapMode_Write, 0, kBufferSize, _, _))
- .WillOnce(InvokeWithoutArgs([&]() {
- api.CallBufferMapAsyncCallback(apiBuffer, WGPUBufferMapAsyncStatus_Success);
- }));
+ .WillOnce(InvokeWithoutArgs(
+ [&] { api.CallBufferMapAsyncCallback(apiBuffer, WGPUBufferMapAsyncStatus_Success); }));
EXPECT_CALL(api, BufferGetMappedRange(apiBuffer, 0, kBufferSize))
.WillOnce(Return(&bufferContent));
@@ -461,9 +452,8 @@
uint32_t bufferContent = 31337;
EXPECT_CALL(api, OnBufferMapAsync(apiBuffer, WGPUMapMode_Write, 0, kBufferSize, _, _))
- .WillOnce(InvokeWithoutArgs([&]() {
- api.CallBufferMapAsyncCallback(apiBuffer, WGPUBufferMapAsyncStatus_Success);
- }));
+ .WillOnce(InvokeWithoutArgs(
+ [&] { api.CallBufferMapAsyncCallback(apiBuffer, WGPUBufferMapAsyncStatus_Success); }));
EXPECT_CALL(api, BufferGetMappedRange(apiBuffer, 0, kBufferSize))
.WillOnce(Return(&bufferContent));
@@ -485,9 +475,8 @@
uint32_t bufferContent = 31337;
EXPECT_CALL(api, OnBufferMapAsync(apiBuffer, WGPUMapMode_Write, 0, kBufferSize, _, _))
- .WillOnce(InvokeWithoutArgs([&]() {
- api.CallBufferMapAsyncCallback(apiBuffer, WGPUBufferMapAsyncStatus_Success);
- }));
+ .WillOnce(InvokeWithoutArgs(
+ [&] { api.CallBufferMapAsyncCallback(apiBuffer, WGPUBufferMapAsyncStatus_Success); }));
EXPECT_CALL(api, BufferGetMappedRange(apiBuffer, 0, kBufferSize))
.WillOnce(Return(&bufferContent));
@@ -500,7 +489,7 @@
// Map failure while the buffer is already mapped
wgpuBufferMapAsync(buffer, WGPUMapMode_Write, 0, kBufferSize, ToMockBufferMapCallback, nullptr);
EXPECT_CALL(api, OnBufferMapAsync(apiBuffer, WGPUMapMode_Write, 0, kBufferSize, _, _))
- .WillOnce(InvokeWithoutArgs([&]() {
+ .WillOnce(InvokeWithoutArgs([&] {
api.CallBufferMapAsyncCallback(apiBuffer, WGPUBufferMapAsyncStatus_ValidationError);
}));
@@ -520,16 +509,15 @@
uint32_t bufferContent = 31337;
EXPECT_CALL(api, OnBufferMapAsync(apiBuffer, WGPUMapMode_Write, 0, kBufferSize, _, _))
- .WillOnce(InvokeWithoutArgs([&]() {
- api.CallBufferMapAsyncCallback(apiBuffer, WGPUBufferMapAsyncStatus_Success);
- }));
+ .WillOnce(InvokeWithoutArgs(
+ [&] { api.CallBufferMapAsyncCallback(apiBuffer, WGPUBufferMapAsyncStatus_Success); }));
EXPECT_CALL(api, BufferGetMappedRange(apiBuffer, 0, kBufferSize))
.WillOnce(Return(&bufferContent));
FlushClient();
EXPECT_CALL(*mockBufferMapCallback, Call(WGPUBufferMapAsyncStatus_Success, _))
- .WillOnce(InvokeWithoutArgs([&]() { wgpuBufferUnmap(buffer); }));
+ .WillOnce(InvokeWithoutArgs([&] { wgpuBufferUnmap(buffer); }));
FlushServer();
@@ -547,16 +535,15 @@
uint32_t bufferContent = 31337;
EXPECT_CALL(api, OnBufferMapAsync(apiBuffer, WGPUMapMode_Write, 0, kBufferSize, _, _))
- .WillOnce(InvokeWithoutArgs([&]() {
- api.CallBufferMapAsyncCallback(apiBuffer, WGPUBufferMapAsyncStatus_Success);
- }));
+ .WillOnce(InvokeWithoutArgs(
+ [&] { api.CallBufferMapAsyncCallback(apiBuffer, WGPUBufferMapAsyncStatus_Success); }));
EXPECT_CALL(api, BufferGetMappedRange(apiBuffer, 0, kBufferSize))
.WillOnce(Return(&bufferContent));
FlushClient();
EXPECT_CALL(*mockBufferMapCallback, Call(WGPUBufferMapAsyncStatus_Success, _))
- .WillOnce(InvokeWithoutArgs([&]() { wgpuBufferRelease(buffer); }));
+ .WillOnce(InvokeWithoutArgs([&] { wgpuBufferRelease(buffer); }));
FlushServer();
@@ -634,9 +621,8 @@
wgpuBufferMapAsync(buffer, WGPUMapMode_Write, 0, kBufferSize, ToMockBufferMapCallback, nullptr);
EXPECT_CALL(api, OnBufferMapAsync(apiBuffer, WGPUMapMode_Write, 0, kBufferSize, _, _))
- .WillOnce(InvokeWithoutArgs([&]() {
- api.CallBufferMapAsyncCallback(apiBuffer, WGPUBufferMapAsyncStatus_Success);
- }));
+ .WillOnce(InvokeWithoutArgs(
+ [&] { api.CallBufferMapAsyncCallback(apiBuffer, WGPUBufferMapAsyncStatus_Success); }));
EXPECT_CALL(api, BufferGetMappedRange(apiBuffer, 0, kBufferSize))
.WillOnce(Return(&apiBufferData));
@@ -666,7 +652,7 @@
wgpuBufferMapAsync(buffer, WGPUMapMode_Write, 0, kBufferSize, ToMockBufferMapCallback, nullptr);
EXPECT_CALL(api, OnBufferMapAsync(apiBuffer, WGPUMapMode_Write, 0, kBufferSize, _, _))
- .WillOnce(InvokeWithoutArgs([&]() {
+ .WillOnce(InvokeWithoutArgs([&] {
api.CallBufferMapAsyncCallback(apiBuffer, WGPUBufferMapAsyncStatus_ValidationError);
}));
@@ -731,9 +717,8 @@
wgpuBufferMapAsync(buffer, WGPUMapMode_Write, 0, kBufferSize, ToMockBufferMapCallback, this);
EXPECT_CALL(api, OnBufferMapAsync(apiBuffer, WGPUMapMode_Write, 0, kBufferSize, _, _))
- .WillOnce(InvokeWithoutArgs([&]() {
- api.CallBufferMapAsyncCallback(apiBuffer, WGPUBufferMapAsyncStatus_Success);
- }));
+ .WillOnce(InvokeWithoutArgs(
+ [&] { api.CallBufferMapAsyncCallback(apiBuffer, WGPUBufferMapAsyncStatus_Success); }));
EXPECT_CALL(api, BufferGetMappedRange(apiBuffer, 0, kBufferSize)).Times(1);
FlushClient();
@@ -772,7 +757,7 @@
{
uint32_t bufferContent = 31337;
EXPECT_CALL(api, OnBufferMapAsync(apiBuffer, WGPUMapMode_Read, 0, kBufferSize, _, _))
- .WillOnce(InvokeWithoutArgs([&]() {
+ .WillOnce(InvokeWithoutArgs([&] {
api.CallBufferMapAsyncCallback(apiBuffer, WGPUBufferMapAsyncStatus_Success);
}));
EXPECT_CALL(api, BufferGetConstMappedRange(apiBuffer, 0, kBufferSize))
@@ -802,7 +787,7 @@
// Server-side error case
{
EXPECT_CALL(api, OnBufferMapAsync(apiBuffer, WGPUMapMode_Read, 0, kBufferSize, _, _))
- .WillOnce(InvokeWithoutArgs([&]() {
+ .WillOnce(InvokeWithoutArgs([&] {
api.CallBufferMapAsyncCallback(apiBuffer, WGPUBufferMapAsyncStatus_ValidationError);
}));
EXPECT_CALL(*mockBufferMapCallback, Call(WGPUBufferMapAsyncStatus_ValidationError, _))
@@ -888,9 +873,8 @@
ToMockBufferMapCallbackWithNewRequests, &testData);
EXPECT_CALL(api, OnBufferMapAsync(apiBuffer, WGPUMapMode_Write, 0, kBufferSize, _, _))
- .WillOnce(InvokeWithoutArgs([&]() {
- api.CallBufferMapAsyncCallback(apiBuffer, WGPUBufferMapAsyncStatus_Success);
- }));
+ .WillOnce(InvokeWithoutArgs(
+ [&] { api.CallBufferMapAsyncCallback(apiBuffer, WGPUBufferMapAsyncStatus_Success); }));
EXPECT_CALL(api, BufferGetMappedRange(apiBuffer, 0, kBufferSize)).Times(1);
FlushClient();
@@ -908,9 +892,8 @@
ToMockBufferMapCallbackWithNewRequests, &testData);
EXPECT_CALL(api, OnBufferMapAsync(apiBuffer, WGPUMapMode_Write, 0, kBufferSize, _, _))
- .WillOnce(InvokeWithoutArgs([&]() {
- api.CallBufferMapAsyncCallback(apiBuffer, WGPUBufferMapAsyncStatus_Success);
- }));
+ .WillOnce(InvokeWithoutArgs(
+ [&] { api.CallBufferMapAsyncCallback(apiBuffer, WGPUBufferMapAsyncStatus_Success); }));
EXPECT_CALL(api, BufferGetMappedRange(apiBuffer, 0, kBufferSize)).Times(1);
FlushClient();
diff --git a/src/dawn/tests/unittests/wire/WireCreatePipelineAsyncTests.cpp b/src/dawn/tests/unittests/wire/WireCreatePipelineAsyncTests.cpp
index 3ff27ed..f499f16 100644
--- a/src/dawn/tests/unittests/wire/WireCreatePipelineAsyncTests.cpp
+++ b/src/dawn/tests/unittests/wire/WireCreatePipelineAsyncTests.cpp
@@ -117,7 +117,7 @@
ToMockCreateComputePipelineAsyncCallback, this);
EXPECT_CALL(api, OnDeviceCreateComputePipelineAsync(apiDevice, _, _, _))
- .WillOnce(InvokeWithoutArgs([&]() {
+ .WillOnce(InvokeWithoutArgs([&] {
api.CallDeviceCreateComputePipelineAsyncCallback(
apiDevice, WGPUCreatePipelineAsyncStatus_Success, nullptr, "");
}));
@@ -146,7 +146,7 @@
ToMockCreateComputePipelineAsyncCallback, this);
EXPECT_CALL(api, OnDeviceCreateComputePipelineAsync(apiDevice, _, _, _))
- .WillOnce(InvokeWithoutArgs([&]() {
+ .WillOnce(InvokeWithoutArgs([&] {
api.CallDeviceCreateComputePipelineAsyncCallback(
apiDevice, WGPUCreatePipelineAsyncStatus_ValidationError, nullptr,
"Some error message");
@@ -181,7 +181,7 @@
wgpuDeviceCreateRenderPipelineAsync(device, &pipelineDescriptor,
ToMockCreateRenderPipelineAsyncCallback, this);
EXPECT_CALL(api, OnDeviceCreateRenderPipelineAsync(apiDevice, _, _, _))
- .WillOnce(InvokeWithoutArgs([&]() {
+ .WillOnce(InvokeWithoutArgs([&] {
api.CallDeviceCreateRenderPipelineAsyncCallback(
apiDevice, WGPUCreatePipelineAsyncStatus_Success, nullptr, "");
}));
@@ -214,7 +214,7 @@
wgpuDeviceCreateRenderPipelineAsync(device, &pipelineDescriptor,
ToMockCreateRenderPipelineAsyncCallback, this);
EXPECT_CALL(api, OnDeviceCreateRenderPipelineAsync(apiDevice, _, _, _))
- .WillOnce(InvokeWithoutArgs([&]() {
+ .WillOnce(InvokeWithoutArgs([&] {
api.CallDeviceCreateRenderPipelineAsyncCallback(
apiDevice, WGPUCreatePipelineAsyncStatus_ValidationError, nullptr,
"Some error message");
@@ -250,7 +250,7 @@
wgpuDeviceCreateRenderPipelineAsync(device, &pipelineDescriptor,
ToMockCreateRenderPipelineAsyncCallback, this);
EXPECT_CALL(api, OnDeviceCreateRenderPipelineAsync(apiDevice, _, _, _))
- .WillOnce(InvokeWithoutArgs([&]() {
+ .WillOnce(InvokeWithoutArgs([&] {
api.CallDeviceCreateRenderPipelineAsyncCallback(
apiDevice, WGPUCreatePipelineAsyncStatus_Success, nullptr, "");
}));
@@ -278,7 +278,7 @@
wgpuDeviceCreateComputePipelineAsync(device, &descriptor,
ToMockCreateComputePipelineAsyncCallback, this);
EXPECT_CALL(api, OnDeviceCreateComputePipelineAsync(apiDevice, _, _, _))
- .WillOnce(InvokeWithoutArgs([&]() {
+ .WillOnce(InvokeWithoutArgs([&] {
api.CallDeviceCreateComputePipelineAsyncCallback(
apiDevice, WGPUCreatePipelineAsyncStatus_Success, nullptr, "");
}));
diff --git a/src/dawn/tests/unittests/wire/WireDisconnectTests.cpp b/src/dawn/tests/unittests/wire/WireDisconnectTests.cpp
index 62b4cb7..e993852 100644
--- a/src/dawn/tests/unittests/wire/WireDisconnectTests.cpp
+++ b/src/dawn/tests/unittests/wire/WireDisconnectTests.cpp
@@ -114,7 +114,7 @@
// only once.
EXPECT_CALL(mockDeviceLostCallback,
Call(WGPUDeviceLostReason_Undefined, StrEq("lost reason"), this))
- .WillOnce(InvokeWithoutArgs([&]() {
+ .WillOnce(InvokeWithoutArgs([&] {
EXPECT_CALL(mockDeviceLostCallback, Call(_, _, _)).Times(Exactly(0));
GetWireClient()->Disconnect();
}));
diff --git a/src/dawn/tests/unittests/wire/WireInstanceTests.cpp b/src/dawn/tests/unittests/wire/WireInstanceTests.cpp
index 8cb35f4..b583648 100644
--- a/src/dawn/tests/unittests/wire/WireInstanceTests.cpp
+++ b/src/dawn/tests/unittests/wire/WireInstanceTests.cpp
@@ -129,7 +129,7 @@
// Expect the server to receive the message. Then, mock a fake reply.
WGPUAdapter apiAdapter = api.GetNewAdapter();
EXPECT_CALL(api, OnInstanceRequestAdapter(apiInstance, NotNull(), NotNull(), NotNull()))
- .WillOnce(InvokeWithoutArgs([&]() {
+ .WillOnce(InvokeWithoutArgs([&] {
EXPECT_CALL(api, AdapterGetProperties(apiAdapter, NotNull()))
.WillOnce(
SetArgPointee<1>(*reinterpret_cast<WGPUAdapterProperties*>(&fakeProperties)));
@@ -206,7 +206,7 @@
// Expect the server to receive the message. Then, mock a fake reply.
WGPUAdapter apiAdapter = api.GetNewAdapter();
EXPECT_CALL(api, OnInstanceRequestAdapter(apiInstance, NotNull(), NotNull(), NotNull()))
- .WillOnce(InvokeWithoutArgs([&]() {
+ .WillOnce(InvokeWithoutArgs([&] {
EXPECT_CALL(api, AdapterGetProperties(apiAdapter, NotNull()))
.WillOnce(WithArg<1>(Invoke([&](WGPUAdapterProperties* properties) {
*properties = {};
@@ -260,7 +260,7 @@
// Expect the server to receive the message. Then, mock an error.
EXPECT_CALL(api, OnInstanceRequestAdapter(apiInstance, NotNull(), NotNull(), NotNull()))
- .WillOnce(InvokeWithoutArgs([&]() {
+ .WillOnce(InvokeWithoutArgs([&] {
api.CallInstanceRequestAdapterCallback(apiInstance, WGPURequestAdapterStatus_Error,
nullptr, "Some error");
}));
diff --git a/src/dawn/tests/unittests/wire/WireMemoryTransferServiceTests.cpp b/src/dawn/tests/unittests/wire/WireMemoryTransferServiceTests.cpp
index 7ab43a4..179a60c 100644
--- a/src/dawn/tests/unittests/wire/WireMemoryTransferServiceTests.cpp
+++ b/src/dawn/tests/unittests/wire/WireMemoryTransferServiceTests.cpp
@@ -144,19 +144,19 @@
ClientReadHandle* handle = clientMemoryTransferService.NewReadHandle();
EXPECT_CALL(clientMemoryTransferService, OnCreateReadHandle(sizeof(mBufferContent)))
- .WillOnce(InvokeWithoutArgs([=]() { return handle; }));
+ .WillOnce(InvokeWithoutArgs([=] { return handle; }));
return handle;
}
void MockReadHandleCreationFailure() {
EXPECT_CALL(clientMemoryTransferService, OnCreateReadHandle(sizeof(mBufferContent)))
- .WillOnce(InvokeWithoutArgs([=]() { return nullptr; }));
+ .WillOnce(InvokeWithoutArgs([=] { return nullptr; }));
}
void ExpectReadHandleSerialization(ClientReadHandle* handle) {
EXPECT_CALL(clientMemoryTransferService, OnReadHandleSerializeCreateSize(handle))
- .WillOnce(InvokeWithoutArgs([&]() { return sizeof(mSerializeCreateInfo); }));
+ .WillOnce(InvokeWithoutArgs([&] { return sizeof(mSerializeCreateInfo); }));
EXPECT_CALL(clientMemoryTransferService, OnReadHandleSerializeCreate(handle, _))
.WillOnce(WithArg<1>([&](void* serializePointer) {
memcpy(serializePointer, &mSerializeCreateInfo, sizeof(mSerializeCreateInfo));
@@ -183,13 +183,13 @@
EXPECT_CALL(serverMemoryTransferService,
OnDeserializeReadHandle(Pointee(Eq(mSerializeCreateInfo)),
sizeof(mSerializeCreateInfo), _))
- .WillOnce(InvokeWithoutArgs([&]() { return false; }));
+ .WillOnce(InvokeWithoutArgs([&] { return false; }));
}
void ExpectServerReadHandleSerializeDataUpdate(ServerReadHandle* handle) {
EXPECT_CALL(serverMemoryTransferService,
OnReadHandleSizeOfSerializeDataUpdate(handle, _, _))
- .WillOnce(InvokeWithoutArgs([&]() { return sizeof(mReadHandleSerializeDataInfo); }));
+ .WillOnce(InvokeWithoutArgs([&] { return sizeof(mReadHandleSerializeDataInfo); }));
EXPECT_CALL(serverMemoryTransferService,
OnReadHandleSerializeDataUpdate(handle, _, _, _, _))
.WillOnce(WithArg<4>([&](void* serializePointer) {
@@ -221,7 +221,7 @@
ClientWriteHandle* handle = clientMemoryTransferService.NewWriteHandle();
EXPECT_CALL(clientMemoryTransferService, OnCreateWriteHandle(sizeof(mBufferContent)))
- .WillOnce(InvokeWithoutArgs([=]() { return handle; }));
+ .WillOnce(InvokeWithoutArgs([=] { return handle; }));
if (mappedAtCreation) {
EXPECT_CALL(clientMemoryTransferService, OnWriteHandleGetData(handle))
.WillOnce(Return(&mBufferContent));
@@ -232,12 +232,12 @@
void MockWriteHandleCreationFailure() {
EXPECT_CALL(clientMemoryTransferService, OnCreateWriteHandle(sizeof(mBufferContent)))
- .WillOnce(InvokeWithoutArgs([=]() { return nullptr; }));
+ .WillOnce(InvokeWithoutArgs([=] { return nullptr; }));
}
void ExpectWriteHandleSerialization(ClientWriteHandle* handle) {
EXPECT_CALL(clientMemoryTransferService, OnWriteHandleSerializeCreateSize(handle))
- .WillOnce(InvokeWithoutArgs([&]() { return sizeof(mSerializeCreateInfo); }));
+ .WillOnce(InvokeWithoutArgs([&] { return sizeof(mSerializeCreateInfo); }));
EXPECT_CALL(clientMemoryTransferService, OnWriteHandleSerializeCreate(handle, _))
.WillOnce(WithArg<1>([&](void* serializePointer) {
memcpy(serializePointer, &mSerializeCreateInfo, sizeof(mSerializeCreateInfo));
@@ -270,7 +270,7 @@
void ExpectClientWriteHandleSerializeDataUpdate(ClientWriteHandle* handle) {
EXPECT_CALL(clientMemoryTransferService,
OnWriteHandleSizeOfSerializeDataUpdate(handle, _, _))
- .WillOnce(InvokeWithoutArgs([&]() { return sizeof(mWriteHandleSerializeDataInfo); }));
+ .WillOnce(InvokeWithoutArgs([&] { return sizeof(mWriteHandleSerializeDataInfo); }));
EXPECT_CALL(clientMemoryTransferService, OnWriteHandleSerializeDataUpdate(handle, _, _, _))
.WillOnce(WithArg<1>([&](void* serializePointer) {
memcpy(serializePointer, &mWriteHandleSerializeDataInfo,
@@ -351,9 +351,8 @@
// Mock a successful callback
EXPECT_CALL(api, OnBufferMapAsync(apiBuffer, WGPUMapMode_Read, 0, kBufferSize, _, _))
- .WillOnce(InvokeWithoutArgs([&]() {
- api.CallBufferMapAsyncCallback(apiBuffer, WGPUBufferMapAsyncStatus_Success);
- }));
+ .WillOnce(InvokeWithoutArgs(
+ [&] { api.CallBufferMapAsyncCallback(apiBuffer, WGPUBufferMapAsyncStatus_Success); }));
EXPECT_CALL(clientMemoryTransferService, OnReadHandleGetData(clientHandle))
.WillOnce(Return(&mBufferContent));
EXPECT_CALL(api, BufferGetConstMappedRange(apiBuffer, 0, kBufferSize))
@@ -424,7 +423,7 @@
// Mock a failed callback.
EXPECT_CALL(api, OnBufferMapAsync(apiBuffer, WGPUMapMode_Read, 0, kBufferSize, _, _))
- .WillOnce(InvokeWithoutArgs([&]() {
+ .WillOnce(InvokeWithoutArgs([&] {
api.CallBufferMapAsyncCallback(apiBuffer, WGPUBufferMapAsyncStatus_ValidationError);
}));
@@ -501,9 +500,8 @@
// Mock a successful callback
EXPECT_CALL(api, OnBufferMapAsync(apiBuffer, WGPUMapMode_Read, 0, kBufferSize, _, _))
- .WillOnce(InvokeWithoutArgs([&]() {
- api.CallBufferMapAsyncCallback(apiBuffer, WGPUBufferMapAsyncStatus_Success);
- }));
+ .WillOnce(InvokeWithoutArgs(
+ [&] { api.CallBufferMapAsyncCallback(apiBuffer, WGPUBufferMapAsyncStatus_Success); }));
EXPECT_CALL(api, BufferGetConstMappedRange(apiBuffer, 0, kBufferSize))
.WillOnce(Return(&mBufferContent));
@@ -547,9 +545,8 @@
// Mock a successful callback
EXPECT_CALL(api, OnBufferMapAsync(apiBuffer, WGPUMapMode_Read, 0, kBufferSize, _, _))
- .WillOnce(InvokeWithoutArgs([&]() {
- api.CallBufferMapAsyncCallback(apiBuffer, WGPUBufferMapAsyncStatus_Success);
- }));
+ .WillOnce(InvokeWithoutArgs(
+ [&] { api.CallBufferMapAsyncCallback(apiBuffer, WGPUBufferMapAsyncStatus_Success); }));
EXPECT_CALL(clientMemoryTransferService, OnReadHandleGetData(clientHandle))
.WillOnce(Return(&mBufferContent));
EXPECT_CALL(api, BufferGetConstMappedRange(apiBuffer, 0, kBufferSize))
@@ -602,9 +599,8 @@
// Mock a successful callback.
EXPECT_CALL(api, OnBufferMapAsync(apiBuffer, WGPUMapMode_Write, 0, kBufferSize, _, _))
- .WillOnce(InvokeWithoutArgs([&]() {
- api.CallBufferMapAsyncCallback(apiBuffer, WGPUBufferMapAsyncStatus_Success);
- }));
+ .WillOnce(InvokeWithoutArgs(
+ [&] { api.CallBufferMapAsyncCallback(apiBuffer, WGPUBufferMapAsyncStatus_Success); }));
EXPECT_CALL(clientMemoryTransferService, OnWriteHandleGetData(clientHandle))
.WillOnce(Return(&mBufferContent));
EXPECT_CALL(api, BufferGetMappedRange(apiBuffer, 0, kBufferSize))
@@ -682,7 +678,7 @@
// Mock an error callback.
EXPECT_CALL(api, OnBufferMapAsync(apiBuffer, WGPUMapMode_Write, 0, kBufferSize, _, _))
- .WillOnce(InvokeWithoutArgs([&]() {
+ .WillOnce(InvokeWithoutArgs([&] {
api.CallBufferMapAsyncCallback(apiBuffer, WGPUBufferMapAsyncStatus_ValidationError);
}));
@@ -756,9 +752,8 @@
// Mock a successful callback.
EXPECT_CALL(api, OnBufferMapAsync(apiBuffer, WGPUMapMode_Write, 0, kBufferSize, _, _))
- .WillOnce(InvokeWithoutArgs([&]() {
- api.CallBufferMapAsyncCallback(apiBuffer, WGPUBufferMapAsyncStatus_Success);
- }));
+ .WillOnce(InvokeWithoutArgs(
+ [&] { api.CallBufferMapAsyncCallback(apiBuffer, WGPUBufferMapAsyncStatus_Success); }));
EXPECT_CALL(clientMemoryTransferService, OnWriteHandleGetData(clientHandle))
.WillOnce(Return(&mBufferContent));
EXPECT_CALL(api, BufferGetMappedRange(apiBuffer, 0, kBufferSize))
@@ -808,9 +803,8 @@
// Mock a successful callback.
EXPECT_CALL(api, OnBufferMapAsync(apiBuffer, WGPUMapMode_Write, 0, kBufferSize, _, _))
- .WillOnce(InvokeWithoutArgs([&]() {
- api.CallBufferMapAsyncCallback(apiBuffer, WGPUBufferMapAsyncStatus_Success);
- }));
+ .WillOnce(InvokeWithoutArgs(
+ [&] { api.CallBufferMapAsyncCallback(apiBuffer, WGPUBufferMapAsyncStatus_Success); }));
EXPECT_CALL(clientMemoryTransferService, OnWriteHandleGetData(clientHandle))
.WillOnce(Return(&mBufferContent));
EXPECT_CALL(api, BufferGetMappedRange(apiBuffer, 0, kBufferSize))
diff --git a/src/dawn/tests/unittests/wire/WireQueueTests.cpp b/src/dawn/tests/unittests/wire/WireQueueTests.cpp
index cb03140..a169caa 100644
--- a/src/dawn/tests/unittests/wire/WireQueueTests.cpp
+++ b/src/dawn/tests/unittests/wire/WireQueueTests.cpp
@@ -56,7 +56,7 @@
TEST_F(WireQueueTests, OnSubmittedWorkDoneSuccess) {
wgpuQueueOnSubmittedWorkDone(queue, 0u, ToMockQueueWorkDone, this);
EXPECT_CALL(api, OnQueueOnSubmittedWorkDone(apiQueue, 0u, _, _))
- .WillOnce(InvokeWithoutArgs([&]() {
+ .WillOnce(InvokeWithoutArgs([&] {
api.CallQueueOnSubmittedWorkDoneCallback(apiQueue, WGPUQueueWorkDoneStatus_Success);
}));
FlushClient();
@@ -69,7 +69,7 @@
TEST_F(WireQueueTests, OnSubmittedWorkDoneError) {
wgpuQueueOnSubmittedWorkDone(queue, 0u, ToMockQueueWorkDone, this);
EXPECT_CALL(api, OnQueueOnSubmittedWorkDone(apiQueue, 0u, _, _))
- .WillOnce(InvokeWithoutArgs([&]() {
+ .WillOnce(InvokeWithoutArgs([&] {
api.CallQueueOnSubmittedWorkDoneCallback(apiQueue, WGPUQueueWorkDoneStatus_Error);
}));
FlushClient();
@@ -83,7 +83,7 @@
TEST_F(WireQueueTests, OnSubmittedWorkDoneBeforeDisconnect) {
wgpuQueueOnSubmittedWorkDone(queue, 0u, ToMockQueueWorkDone, this);
EXPECT_CALL(api, OnQueueOnSubmittedWorkDone(apiQueue, 0u, _, _))
- .WillOnce(InvokeWithoutArgs([&]() {
+ .WillOnce(InvokeWithoutArgs([&] {
api.CallQueueOnSubmittedWorkDoneCallback(apiQueue, WGPUQueueWorkDoneStatus_Error);
}));
FlushClient();
@@ -130,7 +130,7 @@
TestData testData = {this, &queue, 10};
wgpuQueueOnSubmittedWorkDone(queue, 0u, ToMockQueueWorkDoneWithNewRequests, &testData);
EXPECT_CALL(api, OnQueueOnSubmittedWorkDone(apiQueue, 0u, _, _))
- .WillOnce(InvokeWithoutArgs([&]() {
+ .WillOnce(InvokeWithoutArgs([&] {
api.CallQueueOnSubmittedWorkDoneCallback(apiQueue, WGPUQueueWorkDoneStatus_Error);
}));
FlushClient();
diff --git a/src/dawn/tests/unittests/wire/WireShaderModuleTests.cpp b/src/dawn/tests/unittests/wire/WireShaderModuleTests.cpp
index 26451d8..383cbde 100644
--- a/src/dawn/tests/unittests/wire/WireShaderModuleTests.cpp
+++ b/src/dawn/tests/unittests/wire/WireShaderModuleTests.cpp
@@ -97,7 +97,7 @@
compilationInfo.messages = &message;
EXPECT_CALL(api, OnShaderModuleGetCompilationInfo(apiShaderModule, _, _))
- .WillOnce(InvokeWithoutArgs([&]() {
+ .WillOnce(InvokeWithoutArgs([&] {
api.CallShaderModuleGetCompilationInfoCallback(
apiShaderModule, WGPUCompilationInfoRequestStatus_Success, &compilationInfo);
}));
@@ -137,7 +137,7 @@
compilationInfo.messages = &message;
EXPECT_CALL(api, OnShaderModuleGetCompilationInfo(apiShaderModule, _, _))
- .WillOnce(InvokeWithoutArgs([&]() {
+ .WillOnce(InvokeWithoutArgs([&] {
api.CallShaderModuleGetCompilationInfoCallback(
apiShaderModule, WGPUCompilationInfoRequestStatus_Success, &compilationInfo);
}));
@@ -197,7 +197,7 @@
compilationInfo.messages = &message;
EXPECT_CALL(api, OnShaderModuleGetCompilationInfo(apiShaderModule, _, _))
- .WillOnce(InvokeWithoutArgs([&]() {
+ .WillOnce(InvokeWithoutArgs([&] {
api.CallShaderModuleGetCompilationInfoCallback(
apiShaderModule, WGPUCompilationInfoRequestStatus_Success, &compilationInfo);
}));
@@ -224,7 +224,7 @@
compilationInfo.messages = &message;
EXPECT_CALL(api, OnShaderModuleGetCompilationInfo(apiShaderModule, _, _))
- .WillOnce(InvokeWithoutArgs([&]() {
+ .WillOnce(InvokeWithoutArgs([&] {
api.CallShaderModuleGetCompilationInfoCallback(
apiShaderModule, WGPUCompilationInfoRequestStatus_Success, &compilationInfo);
}));
diff --git a/src/tint/ast/transform/array_length_from_uniform.cc b/src/tint/ast/transform/array_length_from_uniform.cc
index 0101658..eafd805 100644
--- a/src/tint/ast/transform/array_length_from_uniform.cc
+++ b/src/tint/ast/transform/array_length_from_uniform.cc
@@ -97,7 +97,7 @@
// Get (or create, on first call) the uniform buffer that will receive the
// size of each storage buffer in the module.
const Variable* buffer_size_ubo = nullptr;
- auto get_ubo = [&]() {
+ auto get_ubo = [&] {
if (!buffer_size_ubo) {
// Emit an array<vec4<u32>, N>, where N is 1/4 number of elements.
// We do this because UBOs require an element stride that is 16-byte
diff --git a/src/tint/ast/transform/builtin_polyfill.cc b/src/tint/ast/transform/builtin_polyfill.cc
index 75d91b3..01b9f65 100644
--- a/src/tint/ast/transform/builtin_polyfill.cc
+++ b/src/tint/ast/transform/builtin_polyfill.cc
@@ -285,7 +285,7 @@
uint32_t width = WidthOf(ty);
// Returns either u32 or vecN<u32>
- auto U = [&]() {
+ auto U = [&] {
if (width == 1) {
return b.ty.u32();
}
@@ -343,7 +343,7 @@
uint32_t width = WidthOf(ty);
// Returns either u32 or vecN<u32>
- auto U = [&]() {
+ auto U = [&] {
if (width == 1) {
return b.ty.u32();
}
@@ -460,7 +460,7 @@
uint32_t width = WidthOf(ty);
// Returns either u32 or vecN<u32>
- auto U = [&]() {
+ auto U = [&] {
if (width == 1) {
return b.ty.u32();
}
@@ -532,7 +532,7 @@
uint32_t width = WidthOf(ty);
// Returns either u32 or vecN<u32>
- auto U = [&]() {
+ auto U = [&] {
if (width == 1) {
return b.ty.u32();
}
diff --git a/src/tint/ast/transform/demote_to_helper.cc b/src/tint/ast/transform/demote_to_helper.cc
index 8e67ddb..83bfee9 100644
--- a/src/tint/ast/transform/demote_to_helper.cc
+++ b/src/tint/ast/transform/demote_to_helper.cc
@@ -188,7 +188,7 @@
auto* result_struct = sem_call->Type()->As<type::Struct>();
auto* atomic_ty = result_struct->Members()[0]->Type();
result_ty = b.ty(
- utils::GetOrCreate(atomic_cmpxchg_result_types, atomic_ty, [&]() {
+ utils::GetOrCreate(atomic_cmpxchg_result_types, atomic_ty, [&] {
auto name = b.Sym();
b.Structure(
name,
diff --git a/src/tint/ast/transform/direct_variable_access.cc b/src/tint/ast/transform/direct_variable_access.cc
index 3267ae2..dd250a5 100644
--- a/src/tint/ast/transform/direct_variable_access.cc
+++ b/src/tint/ast/transform/direct_variable_access.cc
@@ -868,7 +868,7 @@
/// indices.
void TransformCall(const sem::Call* call) {
// Register a custom handler for the specific call expression
- ctx.Replace(call->Declaration(), [this, call]() {
+ ctx.Replace(call->Declaration(), [this, call] {
auto target_variant = clone_state->current_variant->calls.Find(call);
if (!target_variant) {
// The current variant does not need to transform this call.
diff --git a/src/tint/ast/transform/expand_compound_assignment.cc b/src/tint/ast/transform/expand_compound_assignment.cc
index 3862d2b..f793418 100644
--- a/src/tint/ast/transform/expand_compound_assignment.cc
+++ b/src/tint/ast/transform/expand_compound_assignment.cc
@@ -103,7 +103,7 @@
// foo.bar += rhs;
// After:
// foo.bar = foo.bar + rhs;
- new_lhs = [&]() { return ctx.Clone(lhs); };
+ new_lhs = [&] { return ctx.Clone(lhs); };
} else if (index_accessor && is_vec(index_accessor->object)) {
// This is the case for vector component via an array accessor. We need
// to capture a pointer to the vector and also the index value.
@@ -115,7 +115,7 @@
// (*vec_ptr)[index] = (*vec_ptr)[index] + rhs;
auto lhs_ptr = hoist_pointer_to(index_accessor->object);
auto index = hoist_expr_to_let(index_accessor->index);
- new_lhs = [&, lhs_ptr, index]() { return b.IndexAccessor(b.Deref(lhs_ptr), index); };
+ new_lhs = [&, lhs_ptr, index] { return b.IndexAccessor(b.Deref(lhs_ptr), index); };
} else if (member_accessor && is_vec(member_accessor->object)) {
// This is the case for vector component via a member accessor. We just
// need to capture a pointer to the vector.
@@ -125,7 +125,7 @@
// let vec_ptr = &a[idx()];
// (*vec_ptr).y = (*vec_ptr).y + rhs;
auto lhs_ptr = hoist_pointer_to(member_accessor->object);
- new_lhs = [&, lhs_ptr]() {
+ new_lhs = [&, lhs_ptr] {
return b.MemberAccessor(b.Deref(lhs_ptr), ctx.Clone(member_accessor->member));
};
} else {
@@ -137,7 +137,7 @@
// let lhs_ptr = &a[idx()];
// (*lhs_ptr) = (*lhs_ptr) + rhs;
auto lhs_ptr = hoist_pointer_to(lhs);
- new_lhs = [&, lhs_ptr]() { return b.Deref(lhs_ptr); };
+ new_lhs = [&, lhs_ptr] { return b.Deref(lhs_ptr); };
}
// Replace the statement with a regular assignment statement.
diff --git a/src/tint/ast/transform/module_scope_var_to_entry_point_param.cc b/src/tint/ast/transform/module_scope_var_to_entry_point_param.cc
index 14112f0..1392794 100644
--- a/src/tint/ast/transform/module_scope_var_to_entry_point_param.cc
+++ b/src/tint/ast/transform/module_scope_var_to_entry_point_param.cc
@@ -122,7 +122,7 @@
auto* ty = var->Type()->UnwrapRef();
// Helper to create an AST node for the store type of the variable.
- auto store_type = [&]() { return CreateASTTypeFor(ctx, ty); };
+ auto store_type = [&] { return CreateASTTypeFor(ctx, ty); };
builtin::AddressSpace sc = var->AddressSpace();
switch (sc) {
@@ -324,7 +324,7 @@
// Create a statement to assign the initializer if present.
if (var->initializer) {
- private_initializers.Push([&, name, var]() {
+ private_initializers.Push([&, name, var] {
return ctx.dst->Assign(
ctx.dst->MemberAccessor(PrivateStructVariableName(), name),
ctx.Clone(var->initializer));
@@ -401,7 +401,7 @@
// threadgroup memory arguments.
Symbol workgroup_parameter_symbol;
StructMemberList workgroup_parameter_members;
- auto workgroup_param = [&]() {
+ auto workgroup_param = [&] {
if (!workgroup_parameter_symbol.IsValid()) {
workgroup_parameter_symbol = ctx.dst->Sym();
}
diff --git a/src/tint/ast/transform/num_workgroups_from_uniform.cc b/src/tint/ast/transform/num_workgroups_from_uniform.cc
index 6f7daad..54ecec5 100644
--- a/src/tint/ast/transform/num_workgroups_from_uniform.cc
+++ b/src/tint/ast/transform/num_workgroups_from_uniform.cc
@@ -127,7 +127,7 @@
// Get (or create, on first call) the uniform buffer that will receive the
// number of workgroups.
const Variable* num_workgroups_ubo = nullptr;
- auto get_ubo = [&]() {
+ auto get_ubo = [&] {
if (!num_workgroups_ubo) {
auto* num_workgroups_struct =
b.Structure(b.Sym(), utils::Vector{
diff --git a/src/tint/ast/transform/packed_vec3.cc b/src/tint/ast/transform/packed_vec3.cc
index 62f82d2..126bb7b 100644
--- a/src/tint/ast/transform/packed_vec3.cc
+++ b/src/tint/ast/transform/packed_vec3.cc
@@ -118,7 +118,7 @@
// Create a struct with a single `__packed_vec3` member.
// Give the struct member the same alignment as the original unpacked vec3
// type, to avoid changing the array element stride.
- return b.ty(packed_vec3_wrapper_struct_names.GetOrCreate(vec, [&]() {
+ return b.ty(packed_vec3_wrapper_struct_names.GetOrCreate(vec, [&] {
auto name = b.Symbols().New(
"tint_packed_vec3_" + vec->type()->FriendlyName() +
(array_element ? "_array_element" : "_struct_member"));
@@ -161,7 +161,7 @@
},
[&](const type::Struct* str) -> Type {
if (ContainsVec3(str)) {
- auto name = rewritten_structs.GetOrCreate(str, [&]() {
+ auto name = rewritten_structs.GetOrCreate(str, [&] {
utils::Vector<const StructMember*, 4> members;
for (auto* member : str->Members()) {
// If the member type contains a vec3, rewrite it.
@@ -281,7 +281,7 @@
/// @param ty the unpacked type
/// @returns an expression that holds the unpacked value
const Expression* UnpackComposite(const Expression* expr, const type::Type* ty) {
- auto helper = unpack_helpers.GetOrCreate(ty, [&]() {
+ auto helper = unpack_helpers.GetOrCreate(ty, [&] {
return MakePackUnpackHelper(
"tint_unpack_vec3_in_composite", ty,
[&](const Expression* element,
@@ -297,8 +297,8 @@
return UnpackComposite(element, element_type);
}
},
- [&]() { return RewriteType(ty); }, //
- [&]() { return CreateASTTypeFor(ctx, ty); });
+ [&] { return RewriteType(ty); }, //
+ [&] { return CreateASTTypeFor(ctx, ty); });
});
return b.Call(helper, expr);
}
@@ -309,7 +309,7 @@
/// @param ty the unpacked type
/// @returns an expression that holds the packed value
const Expression* PackComposite(const Expression* expr, const type::Type* ty) {
- auto helper = pack_helpers.GetOrCreate(ty, [&]() {
+ auto helper = pack_helpers.GetOrCreate(ty, [&] {
return MakePackUnpackHelper(
"tint_pack_vec3_in_composite", ty,
[&](const Expression* element,
@@ -326,8 +326,8 @@
return PackComposite(element, element_type);
}
},
- [&]() { return CreateASTTypeFor(ctx, ty); }, //
- [&]() { return RewriteType(ty); });
+ [&] { return CreateASTTypeFor(ctx, ty); }, //
+ [&] { return RewriteType(ty); });
});
return b.Call(helper, expr);
}
diff --git a/src/tint/ast/transform/preserve_padding.cc b/src/tint/ast/transform/preserve_padding.cc
index 3f51fa4..99908e1 100644
--- a/src/tint/ast/transform/preserve_padding.cc
+++ b/src/tint/ast/transform/preserve_padding.cc
@@ -119,7 +119,7 @@
const char* kValueParamName = "value";
auto call_helper = [&](auto&& body) {
EnableExtension();
- auto helper = helpers.GetOrCreate(ty, [&]() {
+ auto helper = helpers.GetOrCreate(ty, [&] {
auto helper_name = b.Symbols().New("assign_and_preserve_padding");
utils::Vector<const Parameter*, 2> params = {
b.Param(kDestParamName,
@@ -136,7 +136,7 @@
ty, //
[&](const type::Array* arr) {
// Call a helper function that uses a loop to assigns each element separately.
- return call_helper([&]() {
+ return call_helper([&] {
utils::Vector<const Statement*, 8> body;
auto* idx = b.Var("i", b.Expr(0_u));
body.Push(
@@ -150,7 +150,7 @@
},
[&](const type::Matrix* mat) {
// Call a helper function that assigns each column separately.
- return call_helper([&]() {
+ return call_helper([&] {
utils::Vector<const Statement*, 4> body;
for (uint32_t i = 0; i < mat->columns(); i++) {
body.Push(MakeAssignment(mat->ColumnType(),
@@ -162,7 +162,7 @@
},
[&](const type::Struct* str) {
// Call a helper function that assigns each member separately.
- return call_helper([&]() {
+ return call_helper([&] {
utils::Vector<const Statement*, 8> body;
for (auto member : str->Members()) {
auto name = member->Name().Name();
diff --git a/src/tint/ast/transform/remove_continue_in_switch.cc b/src/tint/ast/transform/remove_continue_in_switch.cc
index 0ae266d..7843efc 100644
--- a/src/tint/ast/transform/remove_continue_in_switch.cc
+++ b/src/tint/ast/transform/remove_continue_in_switch.cc
@@ -59,7 +59,7 @@
made_changes = true;
auto cont_var_name =
- tint::utils::GetOrCreate(switch_to_cont_var_name, switch_stmt, [&]() {
+ tint::utils::GetOrCreate(switch_to_cont_var_name, switch_stmt, [&] {
// Create and insert 'var tint_continue : bool = false;' before the
// switch.
auto var_name = b.Symbols().New("tint_continue");
diff --git a/src/tint/ast/transform/vectorize_matrix_conversions.cc b/src/tint/ast/transform/vectorize_matrix_conversions.cc
index 66c8251..f012936 100644
--- a/src/tint/ast/transform/vectorize_matrix_conversions.cc
+++ b/src/tint/ast/transform/vectorize_matrix_conversions.cc
@@ -115,7 +115,7 @@
// Replace the matrix conversion to column vector conversions and a matrix construction.
if (!matrix->HasSideEffects()) {
// Simply use the argument's declaration if it has no side effects.
- return build_vectorized_conversion_expression([&]() { //
+ return build_vectorized_conversion_expression([&] { //
return ctx.Clone(matrix->Declaration());
});
} else {
@@ -132,7 +132,7 @@
},
CreateASTTypeFor(ctx, dst_type),
utils::Vector{
- b.Return(build_vectorized_conversion_expression([&]() { //
+ b.Return(build_vectorized_conversion_expression([&] { //
return b.Expr("value");
})),
});
diff --git a/src/tint/ast/transform/vertex_pulling.cc b/src/tint/ast/transform/vertex_pulling.cc
index 54cb8c0..cd9337a 100644
--- a/src/tint/ast/transform/vertex_pulling.cc
+++ b/src/tint/ast/transform/vertex_pulling.cc
@@ -766,7 +766,7 @@
ctx.InsertFront(func->body->statements, b.Decl(func_var));
// Capture mapping from location to the new variable.
LocationInfo info;
- info.expr = [this, func_var]() { return b.Expr(func_var); };
+ info.expr = [this, func_var] { return b.Expr(func_var); };
auto* sem = src->Sem().Get<sem::Parameter>(param);
info.type = sem->Type();
@@ -785,11 +785,11 @@
auto builtin = src->Sem().Get(builtin_attr)->Value();
// Check for existing vertex_index and instance_index builtins.
if (builtin == builtin::BuiltinValue::kVertexIndex) {
- vertex_index_expr = [this, param]() {
+ vertex_index_expr = [this, param] {
return b.Expr(ctx.Clone(param->name->symbol));
};
} else if (builtin == builtin::BuiltinValue::kInstanceIndex) {
- instance_index_expr = [this, param]() {
+ instance_index_expr = [this, param] {
return b.Expr(ctx.Clone(param->name->symbol));
};
}
@@ -815,7 +815,7 @@
utils::Vector<const StructMember*, 8> members_to_clone;
for (auto* member : struct_ty->members) {
auto member_sym = ctx.Clone(member->name->symbol);
- std::function<const Expression*()> member_expr = [this, param_sym, member_sym]() {
+ std::function<const Expression*()> member_expr = [this, param_sym, member_sym] {
return b.MemberAccessor(param_sym, member_sym);
};
@@ -907,7 +907,7 @@
new_function_parameters.Push(
b.Param(name, b.ty.u32(),
utils::Vector{b.Builtin(builtin::BuiltinValue::kVertexIndex)}));
- vertex_index_expr = [this, name]() { return b.Expr(name); };
+ vertex_index_expr = [this, name] { return b.Expr(name); };
break;
}
}
@@ -919,7 +919,7 @@
new_function_parameters.Push(
b.Param(name, b.ty.u32(),
utils::Vector{b.Builtin(builtin::BuiltinValue::kInstanceIndex)}));
- instance_index_expr = [this, name]() { return b.Expr(name); };
+ instance_index_expr = [this, name] { return b.Expr(name); };
break;
}
}
diff --git a/src/tint/inspector/test_inspector_builder.cc b/src/tint/inspector/test_inspector_builder.cc
index c351ec3..6511ef6 100644
--- a/src/tint/inspector/test_inspector_builder.cc
+++ b/src/tint/inspector/test_inspector_builder.cc
@@ -273,7 +273,7 @@
case type::TextureDimension::kCubeArray:
return ty.vec3(scalar);
default:
- [=]() {
+ [=] {
utils::StringStream str;
str << dim;
FAIL() << "Unsupported texture dimension: " << str.str();
@@ -313,19 +313,19 @@
std::function<ast::Type()> func;
switch (component) {
case ComponentType::kF32:
- func = [this]() { return ty.f32(); };
+ func = [this] { return ty.f32(); };
break;
case ComponentType::kI32:
- func = [this]() { return ty.i32(); };
+ func = [this] { return ty.i32(); };
break;
case ComponentType::kU32:
- func = [this]() { return ty.u32(); };
+ func = [this] { return ty.u32(); };
break;
case ComponentType::kF16:
- func = [this]() { return ty.f16(); };
+ func = [this] { return ty.f16(); };
break;
case ComponentType::kUnknown:
- return []() { return ast::Type{}; };
+ return [] { return ast::Type{}; };
}
uint32_t n;
@@ -342,10 +342,10 @@
n = 4;
break;
default:
- return []() { return ast::Type{}; };
+ return [] { return ast::Type{}; };
}
- return [this, func, n]() { return ty.vec(func(), n); };
+ return [this, func, n] { return ty.vec(func(), n); };
}
Inspector& InspectorBuilder::Build() {
@@ -353,7 +353,7 @@
return *inspector_;
}
program_ = std::make_unique<Program>(std::move(*this));
- [&]() {
+ [&] {
ASSERT_TRUE(program_->IsValid()) << diag::Formatter().format(program_->Diagnostics());
}();
inspector_ = std::make_unique<Inspector>(program_.get());
diff --git a/src/tint/inspector/test_inspector_runner.cc b/src/tint/inspector/test_inspector_runner.cc
index 16e4196..9b88ac8 100644
--- a/src/tint/inspector/test_inspector_runner.cc
+++ b/src/tint/inspector/test_inspector_runner.cc
@@ -26,7 +26,7 @@
file_ = std::make_unique<Source::File>("test", shader);
program_ = std::make_unique<Program>(reader::wgsl::Parse(file_.get()));
- [&]() {
+ [&] {
ASSERT_TRUE(program_->IsValid()) << diag::Formatter().format(program_->Diagnostics());
}();
inspector_ = std::make_unique<Inspector>(program_.get());
diff --git a/src/tint/ir/builder.h b/src/tint/ir/builder.h
index 48f9761..3ad87a6 100644
--- a/src/tint/ir/builder.h
+++ b/src/tint/ir/builder.h
@@ -171,7 +171,7 @@
/// @param val the constant value
/// @returns the new constant
ir::Constant* Constant(const constant::Value* val) {
- return ir.constants.GetOrCreate(val, [&]() { return ir.values.Create<ir::Constant>(val); });
+ return ir.constants.GetOrCreate(val, [&] { return ir.values.Create<ir::Constant>(val); });
}
/// Creates a ir::Constant for an i32 Scalar
diff --git a/src/tint/ir/disassembler.cc b/src/tint/ir/disassembler.cc
index e23f88e..f1e93a1 100644
--- a/src/tint/ir/disassembler.cc
+++ b/src/tint/ir/disassembler.cc
@@ -196,7 +196,7 @@
out_ << " [";
bool need_comma = false;
- auto comma = [&]() {
+ auto comma = [&] {
if (need_comma) {
out_ << ", ";
}
@@ -233,7 +233,7 @@
out_ << " [";
bool need_comma = false;
- auto comma = [&]() {
+ auto comma = [&] {
if (need_comma) {
out_ << ", ";
}
diff --git a/src/tint/ir/program_test_helper.h b/src/tint/ir/program_test_helper.h
index d982366..5f20862 100644
--- a/src/tint/ir/program_test_helper.h
+++ b/src/tint/ir/program_test_helper.h
@@ -41,7 +41,7 @@
SetResolveOnBuild(true);
auto program = std::make_unique<Program>(std::move(*this));
- [&]() {
+ [&] {
diag::Formatter formatter;
ASSERT_TRUE(program->IsValid()) << formatter.format(program->Diagnostics());
}();
diff --git a/src/tint/ir/transform/var_for_dynamic_index.cc b/src/tint/ir/transform/var_for_dynamic_index.cc
index 27ddec4..a41e307 100644
--- a/src/tint/ir/transform/var_for_dynamic_index.cc
+++ b/src/tint/ir/transform/var_for_dynamic_index.cc
@@ -121,7 +121,7 @@
if (to_replace.first_dynamic_index > 0) {
PartialAccess partial_access = {
access->Object(), access->Indices().Truncate(to_replace.first_dynamic_index)};
- source_object = source_object_to_value.GetOrCreate(partial_access, [&]() {
+ source_object = source_object_to_value.GetOrCreate(partial_access, [&] {
auto* intermediate_source = builder.Access(to_replace.dynamic_index_source_type,
source_object, partial_access.indices);
intermediate_source->InsertBefore(access);
@@ -130,7 +130,7 @@
}
// Declare a local variable and copy the source object to it.
- auto* local = object_to_local.GetOrCreate(source_object, [&]() {
+ auto* local = object_to_local.GetOrCreate(source_object, [&] {
auto* decl =
builder.Var(ir->Types().ptr(builtin::AddressSpace::kFunction, source_object->Type(),
builtin::Access::kReadWrite));
diff --git a/src/tint/reader/spirv/function.cc b/src/tint/reader/spirv/function.cc
index 6f56081..dd4f35e 100644
--- a/src/tint/reader/spirv/function.cc
+++ b/src/tint/reader/spirv/function.cc
@@ -2899,7 +2899,7 @@
// Push statement blocks for the then-clause and the else-clause.
// But make sure we do it in the right order.
- auto push_else = [this, builder, else_end, construct, false_is_break, false_is_continue]() {
+ auto push_else = [this, builder, else_end, construct, false_is_break, false_is_continue] {
// Push the else clause onto the stack first.
PushNewStatementBlock(construct, else_end, [=](const StatementList& stmts) {
// Only set the else-clause if there are statements to fill it.
@@ -3413,7 +3413,7 @@
auto copy_name = namer_.MakeDerivedName(namer_.Name(phi_id) + "_c" +
std::to_string(block_info.id));
auto copy_sym = builder_.Symbols().Register(copy_name);
- copied_phis.GetOrCreate(phi_id, [copy_sym]() { return copy_sym; });
+ copied_phis.GetOrCreate(phi_id, [copy_sym] { return copy_sym; });
AddStatement(builder_.WrapInStatement(
builder_.Let(copy_sym, builder_.Expr(namer_.Name(phi_id)))));
}
diff --git a/src/tint/reader/wgsl/parser_impl.cc b/src/tint/reader/wgsl/parser_impl.cc
index 835c305..5b5c684 100644
--- a/src/tint/reader/wgsl/parser_impl.cc
+++ b/src/tint/reader/wgsl/parser_impl.cc
@@ -881,7 +881,7 @@
return builder_.ty(builder_.Ident(source.Source(), ident.to_str()));
}
- auto args = expect_template_arg_block("type template arguments", [&]() {
+ auto args = expect_template_arg_block("type template arguments", [&] {
return expect_expression_list("type template argument list",
Token::Type::kTemplateArgsRight);
});
@@ -2075,7 +2075,7 @@
const ast::Identifier* ident = nullptr;
if (peek_is(Token::Type::kTemplateArgsLeft)) {
- auto tmpl_args = expect_template_arg_block("template arguments", [&]() {
+ auto tmpl_args = expect_template_arg_block("template arguments", [&] {
return expect_expression_list("template argument list",
Token::Type::kTemplateArgsRight);
});
diff --git a/src/tint/resolver/builtin_test.cc b/src/tint/resolver/builtin_test.cc
index 07abb21..04e23f6 100644
--- a/src/tint/resolver/builtin_test.cc
+++ b/src/tint/resolver/builtin_test.cc
@@ -2113,7 +2113,7 @@
case type::TextureDimension::kCubeArray:
return ty.vec3(scalar);
default:
- [=]() {
+ [=] {
utils::StringStream str;
str << dim;
FAIL() << "Unsupported texture dimension: " << str.str();
diff --git a/src/tint/resolver/intrinsic_table.cc b/src/tint/resolver/intrinsic_table.cc
index 27cf5cf..9021135 100644
--- a/src/tint/resolver/intrinsic_table.cc
+++ b/src/tint/resolver/intrinsic_table.cc
@@ -1362,7 +1362,7 @@
}
auto eval_stage = match.overload->const_eval_fn ? sem::EvaluationStage::kConstant
: sem::EvaluationStage::kRuntime;
- auto* target = constructors.GetOrCreate(match, [&]() {
+ auto* target = constructors.GetOrCreate(match, [&] {
return builder.create<sem::ValueConstructor>(match.return_type, std::move(params),
eval_stage);
});
@@ -1370,7 +1370,7 @@
}
// Conversion.
- auto* target = converters.GetOrCreate(match, [&]() {
+ auto* target = converters.GetOrCreate(match, [&] {
auto param = builder.create<sem::Parameter>(
nullptr, 0u, match.parameters[0].type, builtin::AddressSpace::kUndefined,
builtin::Access::kUndefined, match.parameters[0].usage);
diff --git a/src/tint/resolver/uniformity.cc b/src/tint/resolver/uniformity.cc
index 45c919e..007de95 100644
--- a/src/tint/resolver/uniformity.cc
+++ b/src/tint/resolver/uniformity.cc
@@ -644,7 +644,7 @@
}
// Add an edge from the variable exit node to its value at this point.
- auto* exit_node = info.var_exit_nodes.GetOrCreate(var, [&]() {
+ auto* exit_node = info.var_exit_nodes.GetOrCreate(var, [&] {
auto name = NameFor(var);
return CreateNode({name, "_value_", info.type, "_exit"});
});
@@ -680,7 +680,7 @@
}
// Add an edge from the variable exit node to its value at this point.
- auto* exit_node = info.var_exit_nodes.GetOrCreate(var, [&]() {
+ auto* exit_node = info.var_exit_nodes.GetOrCreate(var, [&] {
auto name = NameFor(var);
return CreateNode({name, "_value_", info.type, "_exit"});
});
@@ -783,7 +783,7 @@
// Propagate assignments to the loop exit nodes.
for (auto* var : current_function_->local_var_decls) {
- auto* exit_node = info.var_exit_nodes.GetOrCreate(var, [&]() {
+ auto* exit_node = info.var_exit_nodes.GetOrCreate(var, [&] {
auto name = NameFor(var);
return CreateNode({name, "_value_", info.type, "_exit"});
});
@@ -859,7 +859,7 @@
// Propagate assignments to the loop exit nodes.
for (auto* var : current_function_->local_var_decls) {
- auto* exit_node = info.var_exit_nodes.GetOrCreate(var, [&]() {
+ auto* exit_node = info.var_exit_nodes.GetOrCreate(var, [&] {
auto name = NameFor(var);
return CreateNode({name, "_value_", info.type, "_exit"});
});
@@ -1107,7 +1107,7 @@
}
// Add an edge from the variable exit node to its new value.
- auto* exit_node = info.var_exit_nodes.GetOrCreate(var, [&]() {
+ auto* exit_node = info.var_exit_nodes.GetOrCreate(var, [&] {
auto name = NameFor(var);
return CreateNode({name, "_value_", info.type, "_exit"});
});
diff --git a/src/tint/sem/test_helper.h b/src/tint/sem/test_helper.h
index 94f66e4..9433a8c 100644
--- a/src/tint/sem/test_helper.h
+++ b/src/tint/sem/test_helper.h
@@ -30,7 +30,7 @@
/// @return the built program
Program Build() {
diag::Formatter formatter;
- [&]() {
+ [&] {
ASSERT_TRUE(IsValid()) << "Builder program is not valid\n"
<< formatter.format(Diagnostics());
}();
diff --git a/src/tint/transform/manager.cc b/src/tint/transform/manager.cc
index 92d0427c7..def22dd 100644
--- a/src/tint/transform/manager.cc
+++ b/src/tint/transform/manager.cc
@@ -88,7 +88,7 @@
// Helper functions to get the current program state as either an AST program or IR module,
// performing a conversion if necessary.
- auto get_ast = [&]() {
+ auto get_ast = [&] {
#if TINT_BUILD_IR
if (std::holds_alternative<ir::Module*>(target)) {
// Convert the IR module to an AST program.
@@ -100,7 +100,7 @@
return std::get<const Program*>(target);
};
#if TINT_BUILD_IR
- auto get_ir = [&]() {
+ auto get_ir = [&] {
if (std::holds_alternative<const Program*>(target)) {
// Convert the AST program to an IR module.
auto converted = ir::FromProgram(std::get<const Program*>(target));
diff --git a/src/tint/type/struct.cc b/src/tint/type/struct.cc
index 9b3bf49..d8424ae 100644
--- a/src/tint/type/struct.cc
+++ b/src/tint/type/struct.cc
@@ -116,7 +116,7 @@
<< ") */ struct " << struct_name << " {\n";
};
- auto print_struct_end_line = [&]() {
+ auto print_struct_end_line = [&] {
ss << "/* " << std::setw(offset_w + size_w + align_w) << " "
<< "*/ };";
};
diff --git a/src/tint/type/test_helper.h b/src/tint/type/test_helper.h
index 95827b0..c494024 100644
--- a/src/tint/type/test_helper.h
+++ b/src/tint/type/test_helper.h
@@ -30,7 +30,7 @@
/// @return the built program
Program Build() {
diag::Formatter formatter;
- [&]() {
+ [&] {
ASSERT_TRUE(IsValid()) << "Builder program is not valid\n"
<< formatter.format(Diagnostics());
}();
diff --git a/src/tint/utils/hashmap_base.h b/src/tint/utils/hashmap_base.h
index d2aaf1d..cb5f957 100644
--- a/src/tint/utils/hashmap_base.h
+++ b/src/tint/utils/hashmap_base.h
@@ -476,7 +476,7 @@
const auto hash = Hash(key);
- auto make_entry = [&]() {
+ auto make_entry = [&] {
if constexpr (ValueIsVoid) {
return std::forward<K>(key);
} else {
diff --git a/src/tint/writer/glsl/generator_impl.cc b/src/tint/writer/glsl/generator_impl.cc
index 630e24f..1bb2f85 100644
--- a/src/tint/writer/glsl/generator_impl.cc
+++ b/src/tint/writer/glsl/generator_impl.cc
@@ -2244,7 +2244,7 @@
}
void GeneratorImpl::EmitLoop(const ast::LoopStatement* stmt) {
- auto emit_continuing = [this, stmt]() {
+ auto emit_continuing = [this, stmt] {
if (stmt->continuing && !stmt->continuing->Empty()) {
EmitBlock(stmt->continuing);
}
@@ -2303,7 +2303,7 @@
}
if (emit_as_loop) {
- auto emit_continuing = [&]() { current_buffer_->Append(cont_buf); };
+ auto emit_continuing = [&] { current_buffer_->Append(cont_buf); };
TINT_SCOPED_ASSIGNMENT(emit_continuing_, emit_continuing);
line() << "while (true) {";
@@ -2360,7 +2360,7 @@
EmitExpression(cond_buf, cond);
}
- auto emit_continuing = [&]() {};
+ auto emit_continuing = [&] {};
TINT_SCOPED_ASSIGNMENT(emit_continuing_, emit_continuing);
// If the whilehas a multi-statement conditional, then we cannot emit this
diff --git a/src/tint/writer/glsl/test_helper.h b/src/tint/writer/glsl/test_helper.h
index 98c7d8d..c25c98b 100644
--- a/src/tint/writer/glsl/test_helper.h
+++ b/src/tint/writer/glsl/test_helper.h
@@ -49,12 +49,12 @@
if (gen_) {
return *gen_;
}
- [&]() {
+ [&] {
ASSERT_TRUE(IsValid()) << "Builder program is not valid\n"
<< diag::Formatter().format(Diagnostics());
}();
program = std::make_unique<Program>(std::move(*this));
- [&]() {
+ [&] {
ASSERT_TRUE(program->IsValid()) << diag::Formatter().format(program->Diagnostics());
}();
gen_ = std::make_unique<GeneratorImpl>(program.get(), version);
@@ -74,15 +74,15 @@
return *gen_;
}
diag::Formatter formatter;
- [&]() {
+ [&] {
ASSERT_TRUE(IsValid()) << "Builder program is not valid\n"
<< formatter.format(Diagnostics());
}();
program = std::make_unique<Program>(std::move(*this));
- [&]() { ASSERT_TRUE(program->IsValid()) << formatter.format(program->Diagnostics()); }();
+ [&] { ASSERT_TRUE(program->IsValid()) << formatter.format(program->Diagnostics()); }();
auto sanitized_result = Sanitize(program.get(), options, /* entry_point */ "");
- [&]() {
+ [&] {
ASSERT_TRUE(sanitized_result.program.IsValid())
<< formatter.format(sanitized_result.program.Diagnostics());
}();
diff --git a/src/tint/writer/hlsl/generator_impl.cc b/src/tint/writer/hlsl/generator_impl.cc
index 1267bea..06a4d7c 100644
--- a/src/tint/writer/hlsl/generator_impl.cc
+++ b/src/tint/writer/hlsl/generator_impl.cc
@@ -3621,7 +3621,7 @@
}
bool GeneratorImpl::EmitLoop(const ast::LoopStatement* stmt) {
- auto emit_continuing = [this, stmt]() {
+ auto emit_continuing = [this, stmt] {
if (stmt->continuing && !stmt->continuing->Empty()) {
if (!EmitBlock(stmt->continuing)) {
return false;
@@ -3695,7 +3695,7 @@
}
if (emit_as_loop) {
- auto emit_continuing = [&]() {
+ auto emit_continuing = [&] {
current_buffer_->Append(cont_buf);
return true;
};
@@ -3766,7 +3766,7 @@
}
}
- auto emit_continuing = [&]() { return true; };
+ auto emit_continuing = [&] { return true; };
TINT_SCOPED_ASSIGNMENT(emit_continuing_, emit_continuing);
// If the while has a multi-statement conditional, then we cannot emit this
diff --git a/src/tint/writer/hlsl/test_helper.h b/src/tint/writer/hlsl/test_helper.h
index 2f8e886..35608a0 100644
--- a/src/tint/writer/hlsl/test_helper.h
+++ b/src/tint/writer/hlsl/test_helper.h
@@ -50,12 +50,12 @@
if (gen_) {
return *gen_;
}
- [&]() {
+ [&] {
ASSERT_TRUE(IsValid()) << "Builder program is not valid\n"
<< diag::Formatter().format(Diagnostics());
}();
program = std::make_unique<Program>(std::move(*this));
- [&]() {
+ [&] {
ASSERT_TRUE(program->IsValid()) << diag::Formatter().format(program->Diagnostics());
}();
gen_ = std::make_unique<GeneratorImpl>(program.get());
@@ -73,15 +73,15 @@
return *gen_;
}
diag::Formatter formatter;
- [&]() {
+ [&] {
ASSERT_TRUE(IsValid()) << "Builder program is not valid\n"
<< formatter.format(Diagnostics());
}();
program = std::make_unique<Program>(std::move(*this));
- [&]() { ASSERT_TRUE(program->IsValid()) << formatter.format(program->Diagnostics()); }();
+ [&] { ASSERT_TRUE(program->IsValid()) << formatter.format(program->Diagnostics()); }();
auto sanitized_result = Sanitize(program.get(), options);
- [&]() {
+ [&] {
ASSERT_TRUE(sanitized_result.program.IsValid())
<< formatter.format(sanitized_result.program.Diagnostics());
}();
@@ -94,7 +94,7 @@
/* preserve_unicode */ true);
transform_manager.Add<tint::ast::transform::Renamer>();
auto result = transform_manager.Run(&sanitized_result.program, transform_data, outputs);
- [&]() { ASSERT_TRUE(result.IsValid()) << formatter.format(result.Diagnostics()); }();
+ [&] { ASSERT_TRUE(result.IsValid()) << formatter.format(result.Diagnostics()); }();
*program = std::move(result);
gen_ = std::make_unique<GeneratorImpl>(program.get());
return *gen_;
diff --git a/src/tint/writer/msl/generator_impl.cc b/src/tint/writer/msl/generator_impl.cc
index 28101df..b0799d4 100644
--- a/src/tint/writer/msl/generator_impl.cc
+++ b/src/tint/writer/msl/generator_impl.cc
@@ -1014,7 +1014,7 @@
// Helper to emit the texture expression, wrapped in parentheses if the
// expression includes an operator with lower precedence than the member
// accessor used for the function calls.
- auto texture_expr = [&]() {
+ auto texture_expr = [&] {
bool paren_lhs = !texture->IsAnyOf<ast::AccessorExpression, ast::CallExpression,
ast::IdentifierExpression>();
if (paren_lhs) {
@@ -2137,7 +2137,7 @@
}
bool GeneratorImpl::EmitLoop(const ast::LoopStatement* stmt) {
- auto emit_continuing = [this, stmt]() {
+ auto emit_continuing = [this, stmt] {
if (stmt->continuing && !stmt->continuing->Empty()) {
if (!EmitBlock(stmt->continuing)) {
return false;
@@ -2211,7 +2211,7 @@
});
if (emit_as_loop) {
- auto emit_continuing = [&]() {
+ auto emit_continuing = [&] {
current_buffer_->Append(cont_buf);
return true;
};
@@ -2283,7 +2283,7 @@
}
}
- auto emit_continuing = [&]() { return true; };
+ auto emit_continuing = [&] { return true; };
TINT_SCOPED_ASSIGNMENT(emit_continuing_, emit_continuing);
// If the while has a multi-statement conditional, then we cannot emit this
diff --git a/src/tint/writer/msl/test_helper.h b/src/tint/writer/msl/test_helper.h
index 17802d7..78be5af 100644
--- a/src/tint/writer/msl/test_helper.h
+++ b/src/tint/writer/msl/test_helper.h
@@ -49,12 +49,12 @@
if (gen_) {
return *gen_;
}
- [&]() {
+ [&] {
ASSERT_TRUE(IsValid()) << "Builder program is not valid\n"
<< diag::Formatter().format(Diagnostics());
}();
program = std::make_unique<Program>(std::move(*this));
- [&]() {
+ [&] {
ASSERT_TRUE(program->IsValid()) << diag::Formatter().format(program->Diagnostics());
}();
gen_ = std::make_unique<GeneratorImpl>(program.get());
@@ -71,17 +71,17 @@
if (gen_) {
return *gen_;
}
- [&]() {
+ [&] {
ASSERT_TRUE(IsValid()) << "Builder program is not valid\n"
<< diag::Formatter().format(Diagnostics());
}();
program = std::make_unique<Program>(std::move(*this));
- [&]() {
+ [&] {
ASSERT_TRUE(program->IsValid()) << diag::Formatter().format(program->Diagnostics());
}();
auto result = Sanitize(program.get(), options);
- [&]() {
+ [&] {
ASSERT_TRUE(result.program.IsValid())
<< diag::Formatter().format(result.program.Diagnostics());
}();
diff --git a/src/tint/writer/spirv/builder.cc b/src/tint/writer/spirv/builder.cc
index a0ce6f0..ccc51dc 100644
--- a/src/tint/writer/spirv/builder.cc
+++ b/src/tint/writer/spirv/builder.cc
@@ -2626,7 +2626,7 @@
image_operands.reserve(4); // Enough to fit most parameter lists
// Appends `result_type` and `result_id` to `spirv_params`
- auto append_result_type_and_id_to_spirv_params = [&]() {
+ auto append_result_type_and_id_to_spirv_params = [&] {
spirv_params.emplace_back(std::move(result_type));
spirv_params.emplace_back(std::move(result_id));
};
@@ -2641,7 +2641,7 @@
//
// If the texture is not a depth texture, then this function simply delegates
// to calling append_result_type_and_id_to_spirv_params().
- auto append_result_type_and_id_to_spirv_params_for_read = [&]() {
+ auto append_result_type_and_id_to_spirv_params_for_read = [&] {
if (texture_type->IsAnyOf<type::DepthTexture, type::DepthMultisampledTexture>()) {
auto* f32 = builder_.create<type::F32>();
auto* spirv_result_type = builder_.create<type::Vector>(f32, 4u);
diff --git a/src/tint/writer/spirv/ir/generator_impl_ir.cc b/src/tint/writer/spirv/ir/generator_impl_ir.cc
index 66bcfa9..0166177 100644
--- a/src/tint/writer/spirv/ir/generator_impl_ir.cc
+++ b/src/tint/writer/spirv/ir/generator_impl_ir.cc
@@ -149,7 +149,7 @@
}
uint32_t GeneratorImplIr::Constant(const constant::Value* constant) {
- return constants_.GetOrCreate(constant, [&]() {
+ return constants_.GetOrCreate(constant, [&] {
auto id = module_.NextId();
auto* ty = constant->Type();
Switch(
@@ -204,7 +204,7 @@
}
uint32_t GeneratorImplIr::ConstantNull(const type::Type* type) {
- return constant_nulls_.GetOrCreate(type, [&]() {
+ return constant_nulls_.GetOrCreate(type, [&] {
auto id = module_.NextId();
module_.PushType(spv::Op::OpConstantNull, {Type(type), id});
return id;
@@ -212,7 +212,7 @@
}
uint32_t GeneratorImplIr::Type(const type::Type* ty) {
- return types_.GetOrCreate(ty, [&]() {
+ return types_.GetOrCreate(ty, [&] {
auto id = module_.NextId();
Switch(
ty, //
@@ -278,7 +278,7 @@
}
uint32_t GeneratorImplIr::Label(ir::Block* block) {
- return block_labels_.GetOrCreate(block, [&]() { return module_.NextId(); });
+ return block_labels_.GetOrCreate(block, [&] { return module_.NextId(); });
}
void GeneratorImplIr::EmitStructType(uint32_t id, const type::Struct* str) {
@@ -356,7 +356,7 @@
}
// Get the ID for the function type (creating it if needed).
- auto function_type_id = function_types_.GetOrCreate(function_type, [&]() {
+ auto function_type_id = function_types_.GetOrCreate(function_type, [&] {
auto func_ty_id = module_.NextId();
OperandList operands = {func_ty_id, return_type_id};
operands.insert(operands.end(), function_type.param_type_ids.begin(),
@@ -744,7 +744,7 @@
auto glsl_ext_inst = [&](enum GLSLstd450 inst) {
constexpr const char* kGLSLstd450 = "GLSL.std.450";
op = spv::Op::OpExtInst;
- operands.push_back(imports_.GetOrCreate(kGLSLstd450, [&]() {
+ operands.push_back(imports_.GetOrCreate(kGLSLstd450, [&] {
// Import the instruction set the first time it is requested.
auto import = module_.NextId();
module_.PushExtImport(spv::Op::OpExtInstImport, {import, Operand(kGLSLstd450)});
diff --git a/src/tint/writer/spirv/test_helper.h b/src/tint/writer/spirv/test_helper.h
index b9a90be..d030523 100644
--- a/src/tint/writer/spirv/test_helper.h
+++ b/src/tint/writer/spirv/test_helper.h
@@ -49,12 +49,12 @@
if (spirv_builder) {
return *spirv_builder;
}
- [&]() {
+ [&] {
ASSERT_TRUE(IsValid()) << "Builder program is not valid\n"
<< diag::Formatter().format(Diagnostics());
}();
program = std::make_unique<Program>(std::move(*this));
- [&]() {
+ [&] {
ASSERT_TRUE(program->IsValid()) << diag::Formatter().format(program->Diagnostics());
}();
spirv_builder = std::make_unique<spirv::Builder>(program.get());
@@ -71,16 +71,16 @@
if (spirv_builder) {
return *spirv_builder;
}
- [&]() {
+ [&] {
ASSERT_TRUE(IsValid()) << "Builder program is not valid\n"
<< diag::Formatter().format(Diagnostics());
}();
program = std::make_unique<Program>(std::move(*this));
- [&]() {
+ [&] {
ASSERT_TRUE(program->IsValid()) << diag::Formatter().format(program->Diagnostics());
}();
auto result = Sanitize(program.get(), options);
- [&]() {
+ [&] {
ASSERT_TRUE(result.program.IsValid())
<< diag::Formatter().format(result.program.Diagnostics());
}();
diff --git a/src/tint/writer/wgsl/generator_impl_binary_test.cc b/src/tint/writer/wgsl/generator_impl_binary_test.cc
index 1829cf8..c40db05 100644
--- a/src/tint/writer/wgsl/generator_impl_binary_test.cc
+++ b/src/tint/writer/wgsl/generator_impl_binary_test.cc
@@ -34,7 +34,7 @@
TEST_P(WgslBinaryTest, Emit) {
auto params = GetParam();
- auto op_ty = [&]() {
+ auto op_ty = [&] {
if (params.op == ast::BinaryOp::kLogicalAnd || params.op == ast::BinaryOp::kLogicalOr) {
return ty.bool_();
} else {
diff --git a/src/tint/writer/wgsl/test_helper.h b/src/tint/writer/wgsl/test_helper.h
index 4cf1e93..b2f652c 100644
--- a/src/tint/writer/wgsl/test_helper.h
+++ b/src/tint/writer/wgsl/test_helper.h
@@ -42,7 +42,7 @@
}
program = std::make_unique<Program>(std::move(*this));
diag::Formatter formatter;
- [&]() { ASSERT_TRUE(program->IsValid()) << formatter.format(program->Diagnostics()); }();
+ [&] { ASSERT_TRUE(program->IsValid()) << formatter.format(program->Diagnostics()); }();
gen_ = std::make_unique<GeneratorImpl>(program.get());
return *gen_;
}