mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-16 08:27:05 +00:00
Rename TypeDeterminer to Resolver
Move out of the src root and into its own subdirectory Rename methods to remove the 'Determine' prefix. Fixed: tint:529 Change-Id: Idf89d647780f8a2e7495c1c9e6c402e00ad45b7c Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/44041 Commit-Queue: Ben Clayton <bclayton@google.com> Reviewed-by: David Neto <dneto@google.com>
This commit is contained in:
committed by
Commit Bot service account
parent
fd31bbd3f1
commit
5f0ea11365
@@ -30,7 +30,6 @@
|
||||
#include "src/type/test_helper.h"
|
||||
#include "src/type/u32_type.h"
|
||||
#include "src/type/vector_type.h"
|
||||
#include "src/type_determiner.h"
|
||||
|
||||
namespace tint {
|
||||
namespace type {
|
||||
@@ -108,9 +107,10 @@ TEST_F(StorageTextureTest, F32) {
|
||||
type::StorageTexture::SubtypeFor(ImageFormat::kRgba32Float, Types());
|
||||
Type* s = create<StorageTexture>(TextureDimension::k2dArray,
|
||||
ImageFormat::kRgba32Float, subtype);
|
||||
TypeDeterminer td(this);
|
||||
|
||||
ASSERT_TRUE(td.Determine()) << td.error();
|
||||
auto program = Build();
|
||||
|
||||
ASSERT_TRUE(program.IsValid()) << program.Diagnostics().str();
|
||||
ASSERT_TRUE(s->Is<Texture>());
|
||||
ASSERT_TRUE(s->Is<StorageTexture>());
|
||||
EXPECT_TRUE(s->As<StorageTexture>()->type()->Is<F32>());
|
||||
@@ -121,9 +121,10 @@ TEST_F(StorageTextureTest, U32) {
|
||||
type::StorageTexture::SubtypeFor(ImageFormat::kRg32Uint, Types());
|
||||
Type* s = create<StorageTexture>(TextureDimension::k2dArray,
|
||||
ImageFormat::kRg32Uint, subtype);
|
||||
TypeDeterminer td(this);
|
||||
|
||||
ASSERT_TRUE(td.Determine()) << td.error();
|
||||
auto program = Build();
|
||||
|
||||
ASSERT_TRUE(program.IsValid()) << program.Diagnostics().str();
|
||||
ASSERT_TRUE(s->Is<Texture>());
|
||||
ASSERT_TRUE(s->Is<StorageTexture>());
|
||||
EXPECT_TRUE(s->As<StorageTexture>()->type()->Is<U32>());
|
||||
@@ -134,9 +135,10 @@ TEST_F(StorageTextureTest, I32) {
|
||||
type::StorageTexture::SubtypeFor(ImageFormat::kRgba32Sint, Types());
|
||||
Type* s = create<StorageTexture>(TextureDimension::k2dArray,
|
||||
ImageFormat::kRgba32Sint, subtype);
|
||||
TypeDeterminer td(this);
|
||||
|
||||
ASSERT_TRUE(td.Determine()) << td.error();
|
||||
auto program = Build();
|
||||
|
||||
ASSERT_TRUE(program.IsValid()) << program.Diagnostics().str();
|
||||
ASSERT_TRUE(s->Is<Texture>());
|
||||
ASSERT_TRUE(s->Is<StorageTexture>());
|
||||
EXPECT_TRUE(s->As<StorageTexture>()->type()->Is<I32>());
|
||||
|
||||
@@ -27,7 +27,19 @@ namespace type {
|
||||
|
||||
/// Helper class for testing
|
||||
template <typename BASE>
|
||||
class TestHelperBase : public BASE, public ProgramBuilder {};
|
||||
class TestHelperBase : public BASE, public ProgramBuilder {
|
||||
public:
|
||||
/// Builds and returns the program. Must only be called once per test
|
||||
/// @return the built program
|
||||
Program Build() {
|
||||
diag::Formatter formatter;
|
||||
[&]() {
|
||||
ASSERT_TRUE(IsValid()) << "Builder program is not valid\n"
|
||||
<< formatter.format(Diagnostics());
|
||||
}();
|
||||
return Program(std::move(*this));
|
||||
}
|
||||
};
|
||||
using TestHelper = TestHelperBase<testing::Test>;
|
||||
|
||||
template <typename T>
|
||||
|
||||
Reference in New Issue
Block a user