From 971b344150fa9e70eb8b6561dc6cd2a4106af099 Mon Sep 17 00:00:00 2001 From: Dejan Mircevski Date: Tue, 13 Oct 2015 12:54:47 -0400 Subject: [PATCH] Negative test for ImageFormat. --- source/operand.cpp | 2 +- test/TextToBinary.TypeDeclaration.cpp | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/source/operand.cpp b/source/operand.cpp index 26abffb..c76d8c3 100644 --- a/source/operand.cpp +++ b/source/operand.cpp @@ -1339,7 +1339,7 @@ const char* spvOperandTypeStr(spv_operand_type_t type) { case SPV_OPERAND_TYPE_SAMPLER_FILTER_MODE: return "sampler filter mode"; case SPV_OPERAND_TYPE_SAMPLER_IMAGE_FORMAT: - return "sampler image format"; + return "image format"; case SPV_OPERAND_TYPE_FP_FAST_MATH_MODE: return "floating pointer fast math mode"; case SPV_OPERAND_TYPE_FP_ROUNDING_MODE: diff --git a/test/TextToBinary.TypeDeclaration.cpp b/test/TextToBinary.TypeDeclaration.cpp index ecc7f76..1fbfb15 100644 --- a/test/TextToBinary.TypeDeclaration.cpp +++ b/test/TextToBinary.TypeDeclaration.cpp @@ -135,6 +135,11 @@ INSTANTIATE_TEST_CASE_P( #undef CASE // clang-format on +TEST_F(ImageFormatTest, WrongFormat) { + EXPECT_THAT(CompileFailure("%r = OpTypeImage %t 1D 2 3 0 4 xxyyzz"), + Eq("Invalid image format 'xxyyzz'.")); +} + // Test AccessQualifier enums via OpTypePipe. using OpTypePipeTest = spvtest::TextToBinaryTestBase< @@ -200,9 +205,6 @@ TEST_F(OpTypeForwardPointerTest, WrongClass) { Eq("Invalid storage class 'xxyyzz'.")); } -// TODO(dneto): error message test for sampler addressing mode -// TODO(dneto): error message test for sampler image format - // TODO(dneto): OpTypeVoid // TODO(dneto): OpTypeBool // TODO(dneto): OpTypeInt -- 2.7.4