diff --git a/source/operand.cpp b/source/operand.cpp index e7b39a30..e57fa0c9 100644 --- a/source/operand.cpp +++ b/source/operand.cpp @@ -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: diff --git a/test/TextToBinary.Debug.cpp b/test/TextToBinary.Debug.cpp index 0985903f..145e04fd 100644 --- a/test/TextToBinary.Debug.cpp +++ b/test/TextToBinary.Debug.cpp @@ -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"; diff --git a/test/operand-class-test-coverage.csv b/test/operand-class-test-coverage.csv index 0a4ca4f2..2a22f8d0 100644 --- a/test/operand-class-test-coverage.csv +++ b/test/operand-class-test-coverage.csv @@ -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 \ No newline at end of file +" OperandCapability,",Capability,,OpCapabilityTest