Autoformat all tests and examples

Bug: none
Change-Id: I69904944db1d4c2fbcca74bb8b66b5a7524e76bb
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/24642
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
This commit is contained in:
Kai Ninomiya
2020-07-10 20:33:08 +00:00
committed by Commit Bot service account
parent 3d80b5c378
commit 2afea0c671
83 changed files with 3604 additions and 3481 deletions

View File

@@ -185,7 +185,6 @@ TEST_F(WireArgumentTests, CStringArgument) {
FlushClient();
}
// Test that the wire is able to send objects as value arguments
TEST_F(WireArgumentTests, ObjectAsValueArgument) {
WGPUCommandEncoder cmdBufEncoder = wgpuDeviceCreateCommandEncoder(device, nullptr);

View File

@@ -613,4 +613,3 @@ TEST_F(WireBufferMappingTests, CreateBufferMappedThenMapFailure) {
FlushClient();
}

View File

@@ -64,7 +64,8 @@ class WireErrorCallbackTests : public WireTest {
WireTest::SetUp();
mockDeviceErrorCallback = std::make_unique<StrictMock<MockDeviceErrorCallback>>();
mockDevicePopErrorScopeCallback = std::make_unique<StrictMock<MockDevicePopErrorScopeCallback>>();
mockDevicePopErrorScopeCallback =
std::make_unique<StrictMock<MockDevicePopErrorScopeCallback>>();
mockDeviceLostCallback = std::make_unique<StrictMock<MockDeviceLostCallback>>();
}
@@ -206,8 +207,7 @@ TEST_F(WireErrorCallbackTests, PopErrorScopeDeviceDestroyed) {
EXPECT_TRUE(wgpuDevicePopErrorScope(device, ToMockDevicePopErrorScopeCallback, this));
EXPECT_CALL(api, OnDevicePopErrorScopeCallback(apiDevice, _, _))
.WillOnce(Return(true));
EXPECT_CALL(api, OnDevicePopErrorScopeCallback(apiDevice, _, _)).WillOnce(Return(true));
FlushClient();
// Incomplete callback called in Device destructor.

View File

@@ -40,8 +40,9 @@ TEST_F(WireExtensionTests, ChainedStruct) {
.WillOnce(Invoke([&](Unused, const WGPUSamplerDescriptor* serverDesc) -> WGPUSampler {
EXPECT_STREQ(serverDesc->label, clientDesc.label);
const auto* ext = reinterpret_cast<const WGPUSamplerDescriptorDummyAnisotropicFiltering*>(
serverDesc->nextInChain);
const auto* ext =
reinterpret_cast<const WGPUSamplerDescriptorDummyAnisotropicFiltering*>(
serverDesc->nextInChain);
EXPECT_EQ(ext->chain.sType, clientExt.chain.sType);
EXPECT_EQ(ext->maxAnisotropy, clientExt.maxAnisotropy);
@@ -73,13 +74,15 @@ TEST_F(WireExtensionTests, MutlipleChainedStructs) {
.WillOnce(Invoke([&](Unused, const WGPUSamplerDescriptor* serverDesc) -> WGPUSampler {
EXPECT_STREQ(serverDesc->label, clientDesc.label);
const auto* ext1 = reinterpret_cast<const WGPUSamplerDescriptorDummyAnisotropicFiltering*>(
serverDesc->nextInChain);
const auto* ext1 =
reinterpret_cast<const WGPUSamplerDescriptorDummyAnisotropicFiltering*>(
serverDesc->nextInChain);
EXPECT_EQ(ext1->chain.sType, clientExt1.chain.sType);
EXPECT_EQ(ext1->maxAnisotropy, clientExt1.maxAnisotropy);
const auto* ext2 = reinterpret_cast<const WGPUSamplerDescriptorDummyAnisotropicFiltering*>(
ext1->chain.next);
const auto* ext2 =
reinterpret_cast<const WGPUSamplerDescriptorDummyAnisotropicFiltering*>(
ext1->chain.next);
EXPECT_EQ(ext2->chain.sType, clientExt2.chain.sType);
EXPECT_EQ(ext2->maxAnisotropy, clientExt2.maxAnisotropy);
@@ -99,13 +102,15 @@ TEST_F(WireExtensionTests, MutlipleChainedStructs) {
.WillOnce(Invoke([&](Unused, const WGPUSamplerDescriptor* serverDesc) -> WGPUSampler {
EXPECT_STREQ(serverDesc->label, clientDesc.label);
const auto* ext2 = reinterpret_cast<const WGPUSamplerDescriptorDummyAnisotropicFiltering*>(
serverDesc->nextInChain);
const auto* ext2 =
reinterpret_cast<const WGPUSamplerDescriptorDummyAnisotropicFiltering*>(
serverDesc->nextInChain);
EXPECT_EQ(ext2->chain.sType, clientExt2.chain.sType);
EXPECT_EQ(ext2->maxAnisotropy, clientExt2.maxAnisotropy);
const auto* ext1 = reinterpret_cast<const WGPUSamplerDescriptorDummyAnisotropicFiltering*>(
ext2->chain.next);
const auto* ext1 =
reinterpret_cast<const WGPUSamplerDescriptorDummyAnisotropicFiltering*>(
ext2->chain.next);
EXPECT_EQ(ext1->chain.sType, clientExt1.chain.sType);
EXPECT_EQ(ext1->maxAnisotropy, clientExt1.maxAnisotropy);

View File

@@ -180,9 +180,7 @@ class WireMemoryTransferServiceTests : public WireTest {
ClientReadHandle* handle = clientMemoryTransferService.NewReadHandle();
EXPECT_CALL(clientMemoryTransferService, OnCreateReadHandle(sizeof(mBufferContent)))
.WillOnce(InvokeWithoutArgs([=]() {
return handle;
}));
.WillOnce(InvokeWithoutArgs([=]() { return handle; }));
return handle;
}
@@ -259,9 +257,7 @@ class WireMemoryTransferServiceTests : public WireTest {
ClientWriteHandle* handle = clientMemoryTransferService.NewWriteHandle();
EXPECT_CALL(clientMemoryTransferService, OnCreateWriteHandle(sizeof(mBufferContent)))
.WillOnce(InvokeWithoutArgs([=]() {
return handle;
}));
.WillOnce(InvokeWithoutArgs([=]() { return handle; }));
return handle;
}
@@ -300,22 +296,18 @@ class WireMemoryTransferServiceTests : public WireTest {
EXPECT_CALL(serverMemoryTransferService,
OnDeserializeWriteHandle(Pointee(Eq(mSerializeCreateInfo)),
sizeof(mSerializeCreateInfo), _))
.WillOnce(InvokeWithoutArgs([&]() {
return false;
}));
.WillOnce(InvokeWithoutArgs([&]() { return false; }));
}
void ExpectClientWriteHandleOpen(ClientWriteHandle* handle, uint32_t* mappedData) {
EXPECT_CALL(clientMemoryTransferService, OnWriteHandleOpen(handle))
.WillOnce(InvokeWithoutArgs([=]() {
return std::make_pair(mappedData, sizeof(*mappedData));
}));
.WillOnce(InvokeWithoutArgs(
[=]() { return std::make_pair(mappedData, sizeof(*mappedData)); }));
}
void MockClientWriteHandleOpenFailure(ClientWriteHandle* handle) {
EXPECT_CALL(clientMemoryTransferService, OnWriteHandleOpen(handle))
.WillOnce(InvokeWithoutArgs(
[&]() { return std::make_pair(nullptr, 0); }));
.WillOnce(InvokeWithoutArgs([&]() { return std::make_pair(nullptr, 0); }));
}
void ExpectClientWriteHandleSerializeFlush(ClientWriteHandle* handle) {
@@ -348,8 +340,8 @@ class WireMemoryTransferServiceTests : public WireTest {
// Arbitrary values used within tests to check if serialized data is correctly passed
// between the client and server. The static data changes between runs of the tests and
// test expectations will check that serialized values are passed to the respective deserialization
// function.
// test expectations will check that serialized values are passed to the respective
// deserialization function.
static uint32_t mSerializeCreateInfo;
static uint32_t mSerializeInitialDataInfo;
static uint32_t mSerializeFlushInfo;
@@ -360,8 +352,9 @@ class WireMemoryTransferServiceTests : public WireTest {
// The client's zero-initialized buffer for writing.
uint32_t mMappedBufferContent = 0;
// |mMappedBufferContent| should be set equal to |mUpdatedBufferContent| when the client performs a write.
// Test expectations should check that |mBufferContent == mUpdatedBufferContent| after all writes are flushed.
// |mMappedBufferContent| should be set equal to |mUpdatedBufferContent| when the client
// performs a write. Test expectations should check that |mBufferContent ==
// mUpdatedBufferContent| after all writes are flushed.
static uint32_t mUpdatedBufferContent;
testing::StrictMock<dawn_wire::server::MockMemoryTransferService> serverMemoryTransferService;

View File

@@ -68,9 +68,11 @@ inline testing::Matcher<MatcherLambdaArgument<Lambda>> MatchesLambda(Lambda lamb
class StringMessageMatcher : public testing::MatcherInterface<const char*> {
public:
explicit StringMessageMatcher() {}
explicit StringMessageMatcher() {
}
bool MatchAndExplain(const char* message, testing::MatchResultListener* listener) const override {
bool MatchAndExplain(const char* message,
testing::MatchResultListener* listener) const override {
if (message == nullptr) {
*listener << "missing error message";
return false;
@@ -83,11 +85,11 @@ class StringMessageMatcher : public testing::MatcherInterface<const char*> {
}
void DescribeTo(std::ostream* os) const override {
*os << "valid error message";
*os << "valid error message";
}
void DescribeNegationTo(std::ostream* os) const override {
*os << "invalid error message";
*os << "invalid error message";
}
};