dawn-cmake/src/tests/white_box/InternalResourceUsageTests.cpp
Jiawei Shao 44fc6e3ab5 Remove DAWN_SKIP_TEST_IF -- Part II
This is the last patch to replace DAWN_SKIP_TEST_IF with
DAWN_SUPPRESS_TEST_IF or DAWN_TEST_UNSUPPORTED_IF. With this patch
DAWN_SKIP_TEST_IF will be completely removed from Dawn.

BUG=dawn:779

Change-Id: I5aec03697877ff9c6fa175f8d16eba951dd94cfa
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/51806
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Austin Eng <enga@chromium.org>
2021-05-26 01:04:32 +00:00

46 lines
1.6 KiB
C++

// Copyright 2020 The Dawn Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include "tests/DawnTest.h"
#include "dawn_native/dawn_platform.h"
class InternalResourceUsageTests : public DawnTest {};
// Verify it is an error to create a buffer with a buffer usage that should only be used
// internally.
TEST_P(InternalResourceUsageTests, InternalBufferUsage) {
DAWN_TEST_UNSUPPORTED_IF(HasToggleEnabled("skip_validation"));
wgpu::BufferDescriptor descriptor;
descriptor.size = 4;
descriptor.usage = dawn_native::kReadOnlyStorageBuffer;
ASSERT_DEVICE_ERROR(device.CreateBuffer(&descriptor));
}
// Verify it is an error to create a texture with a texture usage that should only be used
// internally.
TEST_P(InternalResourceUsageTests, InternalTextureUsage) {
DAWN_TEST_UNSUPPORTED_IF(HasToggleEnabled("skip_validation"));
wgpu::TextureDescriptor descriptor;
descriptor.format = wgpu::TextureFormat::RGBA8Unorm;
descriptor.size = {1, 1, 1};
descriptor.usage = dawn_native::kReadOnlyStorageTexture;
ASSERT_DEVICE_ERROR(device.CreateTexture(&descriptor));
}
DAWN_INSTANTIATE_TEST(InternalResourceUsageTests, NullBackend());