Negative test for SourceLanguage.
Also, use "class" instead of "type" in the coverage CSV.
This commit is contained in:
Родитель
f6b865110c
Коммит
d2c81cf34a
|
@ -1520,7 +1520,7 @@ const char* spvOperandTypeStr(spv_operand_type_t type) {
|
|||
case SPV_OPERAND_TYPE_LITERAL_STRING:
|
||||
return "literal string";
|
||||
case SPV_OPERAND_TYPE_SOURCE_LANGUAGE:
|
||||
return "source langauge";
|
||||
return "source language";
|
||||
case SPV_OPERAND_TYPE_EXECUTION_MODEL:
|
||||
return "execution model";
|
||||
case SPV_OPERAND_TYPE_ADDRESSING_MODEL:
|
||||
|
|
|
@ -73,14 +73,20 @@ using OpSourceTest =
|
|||
TEST_P(OpSourceTest, AnyLanguage) {
|
||||
std::string input = std::string("OpSource ") + GetParam().language_name +
|
||||
" " + std::to_string(GetParam().version);
|
||||
EXPECT_THAT(CompiledInstructions(input),
|
||||
Eq(MakeInstruction(spv::OpSource, {GetParam().get_language_value(),
|
||||
GetParam().version})));
|
||||
EXPECT_THAT(
|
||||
CompiledInstructions(input),
|
||||
Eq(MakeInstruction(spv::OpSource, {GetParam().get_language_value(),
|
||||
GetParam().version})));
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(TextToBinaryTestDebug, OpSourceTest,
|
||||
::testing::ValuesIn(kLanguageCases));
|
||||
|
||||
TEST_F(OpSourceTest, WrongLanguage) {
|
||||
EXPECT_THAT(CompileFailure("OpSource xxyyzz 12345"),
|
||||
Eq("Invalid source language 'xxyyzz'."));
|
||||
}
|
||||
|
||||
TEST_F(TextToBinaryTest, OpSourceAcceptsOptionalFileId) {
|
||||
// In the grammar, the file id is an OperandOptionalId.
|
||||
std::string input = "OpSource GLSL 450 %file_id";
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
Operand type,Example instruction,Notes,example unit test
|
||||
Operand class,Example instruction,Notes,example unit test
|
||||
,,,
|
||||
,,,
|
||||
" OperandNone,",UNUSED,not in grammar,
|
||||
|
@ -42,4 +42,4 @@ Operand type,Example instruction,Notes,example unit test
|
|||
" OperandGroupOperation,",GroupIAdd,,GroupOperationTest
|
||||
" OperandKernelEnqueueFlags,",OpEnqueueKernel,"it's an ID, not in grammar",should not have one
|
||||
" OperandKernelProfilingInfo,",OpCaptureEventProfilingInfo,"it's an ID, not in grammar",should not have one
|
||||
" OperandCapability,",Capability,,OpCapabilityTest
|
||||
" OperandCapability,",Capability,,OpCapabilityTest
|
||||
|
|
|
Загрузка…
Ссылка в новой задаче