Negative test for ExecutionModel.

This commit is contained in:
Dejan Mircevski 2015-10-09 13:44:22 -04:00 committed by David Neto
parent d2c81cf34a
commit 2d6796d45d

View File

@ -55,8 +55,8 @@ struct MemoryModelCase {
std::string memory_name;
};
using OpMemoryModelTest = spvtest::TextToBinaryTestBase<
::testing::TestWithParam<MemoryModelCase>>;
using OpMemoryModelTest =
spvtest::TextToBinaryTestBase<::testing::TestWithParam<MemoryModelCase>>;
TEST_P(OpMemoryModelTest, AnyMemoryModelCase) {
std::string input = "OpMemoryModel " + GetParam().addressing_name + " " +
@ -98,8 +98,8 @@ struct EntryPointCase {
std::string entry_point_name;
};
using OpEntryPointTest = spvtest::TextToBinaryTestBase<
::testing::TestWithParam<EntryPointCase>>;
using OpEntryPointTest =
spvtest::TextToBinaryTestBase<::testing::TestWithParam<EntryPointCase>>;
TEST_P(OpEntryPointTest, AnyEntryPointCase) {
// TODO(dneto): utf-8, escaping, quoting cases for entry point name.
@ -126,6 +126,11 @@ INSTANTIATE_TEST_CASE_P(TextToBinaryEntryPoint, OpEntryPointTest,
#undef CASE
// clang-format on
TEST_F(OpEntryPointTest, WrongModel) {
EXPECT_THAT(CompileFailure("OpEntryPoint xxyyzz %1 \"fun\""),
Eq("Invalid execution model 'xxyyzz'."));
}
// Test OpExecutionMode
using OpExecutionModeTest = spvtest::TextToBinaryTestBase<