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:
Ben Clayton
2021-01-05 15:44:39 +00:00
committed by Commit Bot service account
parent dbfe2de982
commit 1637cbb868
36 changed files with 170 additions and 468 deletions

View File

@@ -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;