Test the original bug report case from issue #3931.
| 29 | |
| 30 | // Test the original bug report case from issue #3931. |
| 31 | TEST_F(StructNameTest, StructNameAsStructMember) |
| 32 | { |
| 33 | const std::string inputFname = GlobalTestSettings.testRoot + "/struct_name_as_struct_member.frag"; |
| 34 | std::string input; |
| 35 | tryLoadFile(inputFname, "input", &input); |
| 36 | |
| 37 | EShMessages controls = DeriveOptions(Source::GLSL, Semantics::OpenGL, Target::AST); |
| 38 | GlslangResult result = compileAndLink("struct_name_as_struct_member.frag", input, "", controls, |
| 39 | glslang::EShTargetVulkan_1_0, glslang::EShTargetSpv_1_0); |
| 40 | |
| 41 | // Should NOT have the original syntax error that was reported in the GitHub issue. |
| 42 | EXPECT_EQ(result.linkingError.find("syntax error, unexpected TYPE_NAME, expecting IDENTIFIER"), std::string::npos); |
| 43 | |
| 44 | // Should compile successfully. |
| 45 | EXPECT_EQ(result.shaderResults[0].output.find("compilation errors"), std::string::npos); |
| 46 | } |
| 47 | |
| 48 | // Test struct parameter after non-struct parameter (minimal regression test). |
| 49 | TEST_F(StructNameTest, StructParameterAfterNonStruct) |
nothing calls this directly
no test coverage detected