[Impeller] Fix string search in CompilerTest.SkSLTextureLookUpOrderOfOperations (flutter/engine#51109)

This commit is contained in:
Jason Simmons
2024-02-29 19:34:48 -08:00
committed by GitHub
parent 9a9a760710
commit 089d1979c5

View File

@@ -135,11 +135,13 @@ TEST_P(CompilerTest, SkSLTextureLookUpOrderOfOperations) {
CanCompileAndReflect("texture_lookup.frag", SourceType::kFragmentShader));
auto shader = GetShaderFile("texture_lookup.frag", GetParam());
auto string_mapping = reinterpret_cast<const char*>(shader->GetMapping());
std::string_view shader_mapping(
reinterpret_cast<const char*>(shader->GetMapping()), shader->GetSize());
EXPECT_TRUE(strcmp(string_mapping,
"textureA.eval(textureA_size * ( vec2(1.0) + "
"flutter_FragCoord.xy));") != -1);
constexpr std::string_view expected =
"textureA.eval(textureA_size * ( vec2(1.0) + flutter_FragCoord.xy));";
EXPECT_NE(shader_mapping.find(expected), std::string::npos);
}
TEST_P(CompilerTest, CanCompileStructs) {