MCPcopy Create free account
hub / github.com/KhronosGroup/glslang / TEST_F

Function TEST_F

gtests/StructName.cpp:31–46  ·  view source on GitHub ↗

Test the original bug report case from issue #3931.

Source from the content-addressed store, hash-verified

29
30// Test the original bug report case from issue #3931.
31TEST_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).
49TEST_F(StructNameTest, StructParameterAfterNonStruct)

Callers

nothing calls this directly

Calls 2

DeriveOptionsFunction · 0.85
findMethod · 0.45

Tested by

no test coverage detected