mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-09 13:38:00 +00:00
cleanup: Refactor tests to use ast::Builder helpers
Change-Id: I5bf1dac217c9c6192c0637d98c4a38196d41cbe8 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/36382 Commit-Queue: Ben Clayton <bclayton@google.com> Auto-Submit: Ben Clayton <bclayton@google.com> Reviewed-by: dan sinclair <dsinclair@chromium.org>
This commit is contained in:
committed by
Commit Bot service account
parent
dbfe2de982
commit
1637cbb868
@@ -169,9 +169,7 @@ TEST_F(ValidateControlBlockTest,
|
||||
// case -1: {}
|
||||
// default: {}
|
||||
// }
|
||||
auto* var = Var("a", ast::StorageClass::kNone, ty.u32,
|
||||
create<ast::ScalarConstructorExpression>(
|
||||
create<ast::UintLiteral>(ty.u32, 2)),
|
||||
auto* var = Var("a", ast::StorageClass::kNone, ty.u32, Expr(2u),
|
||||
ast::VariableDecorationList{});
|
||||
|
||||
ast::CaseStatementList switch_body;
|
||||
@@ -203,9 +201,7 @@ TEST_F(ValidateControlBlockTest, NonUniqueCaseSelectorValueUint_Fail) {
|
||||
// case 2, 2: {}
|
||||
// default: {}
|
||||
// }
|
||||
auto* var = Var("a", ast::StorageClass::kNone, ty.u32,
|
||||
create<ast::ScalarConstructorExpression>(
|
||||
create<ast::UintLiteral>(ty.u32, 3)),
|
||||
auto* var = Var("a", ast::StorageClass::kNone, ty.u32, Expr(3u),
|
||||
ast::VariableDecorationList{});
|
||||
|
||||
ast::CaseStatementList switch_body;
|
||||
|
||||
@@ -301,7 +301,6 @@ TEST_F(ValidatorTest, UsingUndefinedVariableInnerScope_Fail) {
|
||||
auto* var = Var("a", ast::StorageClass::kNone, ty.f32, Expr(2.0f),
|
||||
ast::VariableDecorationList{});
|
||||
|
||||
ast::type::Bool bool_type;
|
||||
auto* cond = Expr(true);
|
||||
auto* body = create<ast::BlockStatement>(ast::StatementList{
|
||||
create<ast::VariableDeclStatement>(var),
|
||||
@@ -336,7 +335,6 @@ TEST_F(ValidatorTest, UsingUndefinedVariableOuterScope_Pass) {
|
||||
auto* lhs = Expr("a");
|
||||
auto* rhs = Expr(3.14f);
|
||||
|
||||
ast::type::Bool bool_type;
|
||||
auto* cond = Expr(true);
|
||||
auto* body = create<ast::BlockStatement>(ast::StatementList{
|
||||
create<ast::AssignmentStatement>(Source{Source::Location{12, 34}}, lhs,
|
||||
@@ -476,7 +474,6 @@ TEST_F(ValidatorTest, RedeclaredIdentifierInnerScope_Pass) {
|
||||
auto* var = Var("a", ast::StorageClass::kNone, ty.f32, Expr(2.0f),
|
||||
ast::VariableDecorationList{});
|
||||
|
||||
ast::type::Bool bool_type;
|
||||
auto* cond = Expr(true);
|
||||
auto* body = create<ast::BlockStatement>(ast::StatementList{
|
||||
create<ast::VariableDeclStatement>(var),
|
||||
@@ -508,7 +505,6 @@ TEST_F(ValidatorTest, DISABLED_RedeclaredIdentifierInnerScope_False) {
|
||||
auto* var = Var("a", ast::StorageClass::kNone, ty.f32, Expr(2.0f),
|
||||
ast::VariableDecorationList{});
|
||||
|
||||
ast::type::Bool bool_type;
|
||||
auto* cond = Expr(true);
|
||||
auto* body = create<ast::BlockStatement>(ast::StatementList{
|
||||
create<ast::VariableDeclStatement>(Source{Source::Location{12, 34}}, var),
|
||||
|
||||
Reference in New Issue
Block a user