[Impeller] Fix string search in CompilerTest.SkSLTextureLookUpOrderOfOperations (#51109)
diff --git a/impeller/compiler/compiler_unittests.cc b/impeller/compiler/compiler_unittests.cc index 3e916ff..87e1344 100644 --- a/impeller/compiler/compiler_unittests.cc +++ b/impeller/compiler/compiler_unittests.cc
@@ -135,11 +135,13 @@ 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) {