Commit ecbfc5c6 by Olli Etuaho

Fix formatting in compiler tests

Remove extraneous semicolons and fix indentation in a couple of places. TEST=angle_unittests Change-Id: Iaa51eb50990c0435f41dfd346ec161216cd8d372 Reviewed-on: https://chromium-review.googlesource.com/261823Tested-by: 's avatarOlli Etuaho <oetuaho@nvidia.com> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
parent ff699005
...@@ -107,7 +107,7 @@ TEST_F(ConstantFoldingTest, FoldIntegerAdd) ...@@ -107,7 +107,7 @@ TEST_F(ConstantFoldingTest, FoldIntegerAdd)
ASSERT_FALSE(constantFoundInAST(1124)); ASSERT_FALSE(constantFoundInAST(1124));
ASSERT_FALSE(constantFoundInAST(5)); ASSERT_FALSE(constantFoundInAST(5));
ASSERT_TRUE(constantFoundInAST(1129)); ASSERT_TRUE(constantFoundInAST(1129));
}; }
TEST_F(ConstantFoldingTest, FoldIntegerSub) TEST_F(ConstantFoldingTest, FoldIntegerSub)
{ {
...@@ -123,7 +123,7 @@ TEST_F(ConstantFoldingTest, FoldIntegerSub) ...@@ -123,7 +123,7 @@ TEST_F(ConstantFoldingTest, FoldIntegerSub)
ASSERT_FALSE(constantFoundInAST(1124)); ASSERT_FALSE(constantFoundInAST(1124));
ASSERT_FALSE(constantFoundInAST(5)); ASSERT_FALSE(constantFoundInAST(5));
ASSERT_TRUE(constantFoundInAST(1119)); ASSERT_TRUE(constantFoundInAST(1119));
}; }
TEST_F(ConstantFoldingTest, FoldIntegerMul) TEST_F(ConstantFoldingTest, FoldIntegerMul)
{ {
...@@ -139,7 +139,7 @@ TEST_F(ConstantFoldingTest, FoldIntegerMul) ...@@ -139,7 +139,7 @@ TEST_F(ConstantFoldingTest, FoldIntegerMul)
ASSERT_FALSE(constantFoundInAST(1124)); ASSERT_FALSE(constantFoundInAST(1124));
ASSERT_FALSE(constantFoundInAST(5)); ASSERT_FALSE(constantFoundInAST(5));
ASSERT_TRUE(constantFoundInAST(5620)); ASSERT_TRUE(constantFoundInAST(5620));
}; }
TEST_F(ConstantFoldingTest, FoldIntegerDiv) TEST_F(ConstantFoldingTest, FoldIntegerDiv)
{ {
...@@ -156,7 +156,7 @@ TEST_F(ConstantFoldingTest, FoldIntegerDiv) ...@@ -156,7 +156,7 @@ TEST_F(ConstantFoldingTest, FoldIntegerDiv)
ASSERT_FALSE(constantFoundInAST(5)); ASSERT_FALSE(constantFoundInAST(5));
// Rounding mode of division is undefined in the spec but ANGLE can be expected to round down. // Rounding mode of division is undefined in the spec but ANGLE can be expected to round down.
ASSERT_TRUE(constantFoundInAST(224)); ASSERT_TRUE(constantFoundInAST(224));
}; }
TEST_F(ConstantFoldingTest, FoldIntegerModulus) TEST_F(ConstantFoldingTest, FoldIntegerModulus)
{ {
...@@ -172,4 +172,4 @@ TEST_F(ConstantFoldingTest, FoldIntegerModulus) ...@@ -172,4 +172,4 @@ TEST_F(ConstantFoldingTest, FoldIntegerModulus)
ASSERT_FALSE(constantFoundInAST(1124)); ASSERT_FALSE(constantFoundInAST(1124));
ASSERT_FALSE(constantFoundInAST(5)); ASSERT_FALSE(constantFoundInAST(5));
ASSERT_TRUE(constantFoundInAST(4)); ASSERT_TRUE(constantFoundInAST(4));
}; }
...@@ -162,7 +162,7 @@ TEST_F(DebugShaderPrecisionTest, RoundingFunctionsDefined) ...@@ -162,7 +162,7 @@ TEST_F(DebugShaderPrecisionTest, RoundingFunctionsDefined)
ASSERT_TRUE(foundInGLSLCode("mat2 angle_frl(in mat2")); ASSERT_TRUE(foundInGLSLCode("mat2 angle_frl(in mat2"));
ASSERT_TRUE(foundInGLSLCode("mat3 angle_frl(in mat3")); ASSERT_TRUE(foundInGLSLCode("mat3 angle_frl(in mat3"));
ASSERT_TRUE(foundInGLSLCode("mat4 angle_frl(in mat4")); ASSERT_TRUE(foundInGLSLCode("mat4 angle_frl(in mat4"));
}; }
TEST_F(DebugShaderPrecisionTest, PragmaDisablesEmulation) TEST_F(DebugShaderPrecisionTest, PragmaDisablesEmulation)
{ {
...@@ -184,7 +184,7 @@ TEST_F(DebugShaderPrecisionTest, PragmaDisablesEmulation) ...@@ -184,7 +184,7 @@ TEST_F(DebugShaderPrecisionTest, PragmaDisablesEmulation)
"}\n"; "}\n";
compile(shaderStringPragmaOn); compile(shaderStringPragmaOn);
ASSERT_TRUE(foundInCode("angle_frm")); ASSERT_TRUE(foundInCode("angle_frm"));
}; }
// Emulation can't be toggled on for only a part of a shader. // Emulation can't be toggled on for only a part of a shader.
// Only the last pragma in the shader has an effect. // Only the last pragma in the shader has an effect.
...@@ -200,7 +200,7 @@ TEST_F(DebugShaderPrecisionTest, MultiplePragmas) ...@@ -200,7 +200,7 @@ TEST_F(DebugShaderPrecisionTest, MultiplePragmas)
"#pragma webgl_debug_shader_precision(on)\n"; "#pragma webgl_debug_shader_precision(on)\n";
compile(shaderString); compile(shaderString);
ASSERT_TRUE(foundInCode("angle_frm")); ASSERT_TRUE(foundInCode("angle_frm"));
}; }
TEST_F(NoDebugShaderPrecisionTest, HelpersWrittenOnlyWithExtension) TEST_F(NoDebugShaderPrecisionTest, HelpersWrittenOnlyWithExtension)
{ {
...@@ -212,7 +212,7 @@ TEST_F(NoDebugShaderPrecisionTest, HelpersWrittenOnlyWithExtension) ...@@ -212,7 +212,7 @@ TEST_F(NoDebugShaderPrecisionTest, HelpersWrittenOnlyWithExtension)
"}\n"; "}\n";
ASSERT_TRUE(compile(shaderString)); ASSERT_TRUE(compile(shaderString));
ASSERT_FALSE(foundInCode("angle_frm")); ASSERT_FALSE(foundInCode("angle_frm"));
}; }
TEST_F(NoDebugShaderPrecisionTest, PragmaHasEffectsOnlyWithExtension) TEST_F(NoDebugShaderPrecisionTest, PragmaHasEffectsOnlyWithExtension)
{ {
...@@ -225,7 +225,7 @@ TEST_F(NoDebugShaderPrecisionTest, PragmaHasEffectsOnlyWithExtension) ...@@ -225,7 +225,7 @@ TEST_F(NoDebugShaderPrecisionTest, PragmaHasEffectsOnlyWithExtension)
"}\n"; "}\n";
ASSERT_TRUE(compile(shaderString)); ASSERT_TRUE(compile(shaderString));
ASSERT_FALSE(foundInCode("angle_frm")); ASSERT_FALSE(foundInCode("angle_frm"));
}; }
TEST_F(DebugShaderPrecisionTest, DeclarationsAndConstants) TEST_F(DebugShaderPrecisionTest, DeclarationsAndConstants)
{ {
...@@ -246,7 +246,7 @@ TEST_F(DebugShaderPrecisionTest, DeclarationsAndConstants) ...@@ -246,7 +246,7 @@ TEST_F(DebugShaderPrecisionTest, DeclarationsAndConstants)
ASSERT_TRUE(notFoundInCode("angle_frm(vv")); ASSERT_TRUE(notFoundInCode("angle_frm(vv"));
ASSERT_TRUE(notFoundInCode("angle_frm(gg")); ASSERT_TRUE(notFoundInCode("angle_frm(gg"));
ASSERT_TRUE(notFoundInCode("angle_frm(aa")); ASSERT_TRUE(notFoundInCode("angle_frm(aa"));
}; }
TEST_F(DebugShaderPrecisionTest, InitializerRounding) TEST_F(DebugShaderPrecisionTest, InitializerRounding)
{ {
...@@ -260,7 +260,7 @@ TEST_F(DebugShaderPrecisionTest, InitializerRounding) ...@@ -260,7 +260,7 @@ TEST_F(DebugShaderPrecisionTest, InitializerRounding)
compile(shaderString); compile(shaderString);
// An expression that's part of initialization should have rounding // An expression that's part of initialization should have rounding
ASSERT_TRUE(foundInCode("angle_frm(u)")); ASSERT_TRUE(foundInCode("angle_frm(u)"));
}; }
TEST_F(DebugShaderPrecisionTest, CompoundAddFunction) TEST_F(DebugShaderPrecisionTest, CompoundAddFunction)
{ {
...@@ -284,7 +284,7 @@ TEST_F(DebugShaderPrecisionTest, CompoundAddFunction) ...@@ -284,7 +284,7 @@ TEST_F(DebugShaderPrecisionTest, CompoundAddFunction)
)); ));
ASSERT_TRUE(foundInCode("angle_compound_add_frm(v, angle_frm(u2));")); ASSERT_TRUE(foundInCode("angle_compound_add_frm(v, angle_frm(u2));"));
ASSERT_TRUE(notFoundInCode("+=")); ASSERT_TRUE(notFoundInCode("+="));
}; }
TEST_F(DebugShaderPrecisionTest, CompoundSubFunction) TEST_F(DebugShaderPrecisionTest, CompoundSubFunction)
{ {
...@@ -308,7 +308,7 @@ TEST_F(DebugShaderPrecisionTest, CompoundSubFunction) ...@@ -308,7 +308,7 @@ TEST_F(DebugShaderPrecisionTest, CompoundSubFunction)
)); ));
ASSERT_TRUE(foundInCode("angle_compound_sub_frm(v, angle_frm(u2));")); ASSERT_TRUE(foundInCode("angle_compound_sub_frm(v, angle_frm(u2));"));
ASSERT_TRUE(notFoundInCode("-=")); ASSERT_TRUE(notFoundInCode("-="));
}; }
TEST_F(DebugShaderPrecisionTest, CompoundDivFunction) TEST_F(DebugShaderPrecisionTest, CompoundDivFunction)
{ {
...@@ -332,7 +332,7 @@ TEST_F(DebugShaderPrecisionTest, CompoundDivFunction) ...@@ -332,7 +332,7 @@ TEST_F(DebugShaderPrecisionTest, CompoundDivFunction)
)); ));
ASSERT_TRUE(foundInCode("angle_compound_div_frm(v, angle_frm(u2));")); ASSERT_TRUE(foundInCode("angle_compound_div_frm(v, angle_frm(u2));"));
ASSERT_TRUE(notFoundInCode("/=")); ASSERT_TRUE(notFoundInCode("/="));
}; }
TEST_F(DebugShaderPrecisionTest, CompoundMulFunction) TEST_F(DebugShaderPrecisionTest, CompoundMulFunction)
{ {
...@@ -356,7 +356,7 @@ TEST_F(DebugShaderPrecisionTest, CompoundMulFunction) ...@@ -356,7 +356,7 @@ TEST_F(DebugShaderPrecisionTest, CompoundMulFunction)
)); ));
ASSERT_TRUE(foundInCode("angle_compound_mul_frm(v, angle_frm(u2));")); ASSERT_TRUE(foundInCode("angle_compound_mul_frm(v, angle_frm(u2));"));
ASSERT_TRUE(notFoundInCode("*=")); ASSERT_TRUE(notFoundInCode("*="));
}; }
TEST_F(DebugShaderPrecisionTest, CompoundAddVectorPlusScalarFunction) TEST_F(DebugShaderPrecisionTest, CompoundAddVectorPlusScalarFunction)
{ {
...@@ -380,7 +380,7 @@ TEST_F(DebugShaderPrecisionTest, CompoundAddVectorPlusScalarFunction) ...@@ -380,7 +380,7 @@ TEST_F(DebugShaderPrecisionTest, CompoundAddVectorPlusScalarFunction)
)); ));
ASSERT_TRUE(foundInCode("angle_compound_add_frm(v, angle_frm(u2));")); ASSERT_TRUE(foundInCode("angle_compound_add_frm(v, angle_frm(u2));"));
ASSERT_TRUE(notFoundInCode("+=")); ASSERT_TRUE(notFoundInCode("+="));
}; }
TEST_F(DebugShaderPrecisionTest, CompoundMatrixTimesMatrixFunction) TEST_F(DebugShaderPrecisionTest, CompoundMatrixTimesMatrixFunction)
{ {
...@@ -404,7 +404,7 @@ TEST_F(DebugShaderPrecisionTest, CompoundMatrixTimesMatrixFunction) ...@@ -404,7 +404,7 @@ TEST_F(DebugShaderPrecisionTest, CompoundMatrixTimesMatrixFunction)
)); ));
ASSERT_TRUE(foundInCode("angle_compound_mul_frm(m, angle_frm(u2));")); ASSERT_TRUE(foundInCode("angle_compound_mul_frm(m, angle_frm(u2));"));
ASSERT_TRUE(notFoundInCode("*=")); ASSERT_TRUE(notFoundInCode("*="));
}; }
TEST_F(DebugShaderPrecisionTest, CompoundMatrixTimesScalarFunction) TEST_F(DebugShaderPrecisionTest, CompoundMatrixTimesScalarFunction)
{ {
...@@ -428,7 +428,7 @@ TEST_F(DebugShaderPrecisionTest, CompoundMatrixTimesScalarFunction) ...@@ -428,7 +428,7 @@ TEST_F(DebugShaderPrecisionTest, CompoundMatrixTimesScalarFunction)
)); ));
ASSERT_TRUE(foundInCode("angle_compound_mul_frm(m, angle_frm(u2));")); ASSERT_TRUE(foundInCode("angle_compound_mul_frm(m, angle_frm(u2));"));
ASSERT_TRUE(notFoundInCode("*=")); ASSERT_TRUE(notFoundInCode("*="));
}; }
TEST_F(DebugShaderPrecisionTest, CompoundVectorTimesMatrixFunction) TEST_F(DebugShaderPrecisionTest, CompoundVectorTimesMatrixFunction)
{ {
...@@ -451,7 +451,7 @@ TEST_F(DebugShaderPrecisionTest, CompoundVectorTimesMatrixFunction) ...@@ -451,7 +451,7 @@ TEST_F(DebugShaderPrecisionTest, CompoundVectorTimesMatrixFunction)
)); ));
ASSERT_TRUE(foundInCode("angle_compound_mul_frm(v, angle_frm(u2));")); ASSERT_TRUE(foundInCode("angle_compound_mul_frm(v, angle_frm(u2));"));
ASSERT_TRUE(notFoundInCode("*=")); ASSERT_TRUE(notFoundInCode("*="));
}; }
TEST_F(DebugShaderPrecisionTest, CompoundVectorTimesScalarFunction) TEST_F(DebugShaderPrecisionTest, CompoundVectorTimesScalarFunction)
{ {
...@@ -475,7 +475,7 @@ TEST_F(DebugShaderPrecisionTest, CompoundVectorTimesScalarFunction) ...@@ -475,7 +475,7 @@ TEST_F(DebugShaderPrecisionTest, CompoundVectorTimesScalarFunction)
)); ));
ASSERT_TRUE(foundInCode("angle_compound_mul_frm(v, angle_frm(u2));")); ASSERT_TRUE(foundInCode("angle_compound_mul_frm(v, angle_frm(u2));"));
ASSERT_TRUE(notFoundInCode("*=")); ASSERT_TRUE(notFoundInCode("*="));
}; }
TEST_F(DebugShaderPrecisionTest, BinaryMathRounding) TEST_F(DebugShaderPrecisionTest, BinaryMathRounding)
{ {
...@@ -501,7 +501,7 @@ TEST_F(DebugShaderPrecisionTest, BinaryMathRounding) ...@@ -501,7 +501,7 @@ TEST_F(DebugShaderPrecisionTest, BinaryMathRounding)
ASSERT_TRUE(foundInCode("v3 = angle_frm((angle_frm(u3) * angle_frm(u4)))")); ASSERT_TRUE(foundInCode("v3 = angle_frm((angle_frm(u3) * angle_frm(u4)))"));
ASSERT_TRUE(foundInCode("v4 = angle_frm((angle_frm(u4) / angle_frm(u5)))")); ASSERT_TRUE(foundInCode("v4 = angle_frm((angle_frm(u4) / angle_frm(u5)))"));
ASSERT_TRUE(foundInCode("v6 = angle_frm((v5 = angle_frm(u5)))")); ASSERT_TRUE(foundInCode("v6 = angle_frm((v5 = angle_frm(u5)))"));
}; }
TEST_F(DebugShaderPrecisionTest, BuiltInMathFunctionRounding) TEST_F(DebugShaderPrecisionTest, BuiltInMathFunctionRounding)
{ {
...@@ -615,7 +615,7 @@ TEST_F(DebugShaderPrecisionTest, BuiltInMathFunctionRounding) ...@@ -615,7 +615,7 @@ TEST_F(DebugShaderPrecisionTest, BuiltInMathFunctionRounding)
ASSERT_TRUE(foundInCode("f3 = angle_frm(dot(angle_frm(u1), angle_frm(u2)))")); ASSERT_TRUE(foundInCode("f3 = angle_frm(dot(angle_frm(u1), angle_frm(u2)))"));
ASSERT_TRUE(foundInCode("vf31 = angle_frm(cross(angle_frm(uf31), angle_frm(uf32)))")); ASSERT_TRUE(foundInCode("vf31 = angle_frm(cross(angle_frm(uf31), angle_frm(uf32)))"));
ASSERT_TRUE(foundInCode("m1 = angle_frm(matrixCompMult(angle_frm(um1), angle_frm(um2)))")); ASSERT_TRUE(foundInCode("m1 = angle_frm(matrixCompMult(angle_frm(um1), angle_frm(um2)))"));
}; }
TEST_F(DebugShaderPrecisionTest, BuiltInRelationalFunctionRounding) TEST_F(DebugShaderPrecisionTest, BuiltInRelationalFunctionRounding)
{ {
...@@ -639,7 +639,7 @@ TEST_F(DebugShaderPrecisionTest, BuiltInRelationalFunctionRounding) ...@@ -639,7 +639,7 @@ TEST_F(DebugShaderPrecisionTest, BuiltInRelationalFunctionRounding)
ASSERT_TRUE(foundInCode("bv4 = greaterThanEqual(angle_frm(u1), angle_frm(u2))")); ASSERT_TRUE(foundInCode("bv4 = greaterThanEqual(angle_frm(u1), angle_frm(u2))"));
ASSERT_TRUE(foundInCode("bv5 = equal(angle_frm(u1), angle_frm(u2))")); ASSERT_TRUE(foundInCode("bv5 = equal(angle_frm(u1), angle_frm(u2))"));
ASSERT_TRUE(foundInCode("bv6 = notEqual(angle_frm(u1), angle_frm(u2))")); ASSERT_TRUE(foundInCode("bv6 = notEqual(angle_frm(u1), angle_frm(u2))"));
}; }
TEST_F(DebugShaderPrecisionTest, ConstructorRounding) TEST_F(DebugShaderPrecisionTest, ConstructorRounding)
{ {
...@@ -660,7 +660,7 @@ TEST_F(DebugShaderPrecisionTest, ConstructorRounding) ...@@ -660,7 +660,7 @@ TEST_F(DebugShaderPrecisionTest, ConstructorRounding)
// Note: this is suboptimal for the case taking four floats, but optimizing would be tricky. // Note: this is suboptimal for the case taking four floats, but optimizing would be tricky.
ASSERT_TRUE(foundInCode("v1 = angle_frm(vec4(angle_frm(u1), angle_frm(u2), angle_frm(u3), angle_frm(u4)))")); ASSERT_TRUE(foundInCode("v1 = angle_frm(vec4(angle_frm(u1), angle_frm(u2), angle_frm(u3), angle_frm(u4)))"));
ASSERT_TRUE(foundInCode("v2 = angle_frm(vec4(uiv))")); ASSERT_TRUE(foundInCode("v2 = angle_frm(vec4(uiv))"));
}; }
TEST_F(DebugShaderPrecisionTest, StructConstructorNoRounding) TEST_F(DebugShaderPrecisionTest, StructConstructorNoRounding)
{ {
...@@ -675,7 +675,7 @@ TEST_F(DebugShaderPrecisionTest, StructConstructorNoRounding) ...@@ -675,7 +675,7 @@ TEST_F(DebugShaderPrecisionTest, StructConstructorNoRounding)
compile(shaderString); compile(shaderString);
ASSERT_TRUE(foundInCode("s = S(angle_frm(u))")); ASSERT_TRUE(foundInCode("s = S(angle_frm(u))"));
ASSERT_TRUE(notFoundInCode("angle_frm(S")); ASSERT_TRUE(notFoundInCode("angle_frm(S"));
}; }
TEST_F(DebugShaderPrecisionTest, SwizzleRounding) TEST_F(DebugShaderPrecisionTest, SwizzleRounding)
{ {
...@@ -688,7 +688,7 @@ TEST_F(DebugShaderPrecisionTest, SwizzleRounding) ...@@ -688,7 +688,7 @@ TEST_F(DebugShaderPrecisionTest, SwizzleRounding)
"}\n"; "}\n";
compile(shaderString); compile(shaderString);
ASSERT_TRUE(foundInCode("v = angle_frm(u).xyxy")); ASSERT_TRUE(foundInCode("v = angle_frm(u).xyxy"));
}; }
TEST_F(DebugShaderPrecisionTest, BuiltInTexFunctionRounding) TEST_F(DebugShaderPrecisionTest, BuiltInTexFunctionRounding)
{ {
...@@ -703,7 +703,7 @@ TEST_F(DebugShaderPrecisionTest, BuiltInTexFunctionRounding) ...@@ -703,7 +703,7 @@ TEST_F(DebugShaderPrecisionTest, BuiltInTexFunctionRounding)
"}\n"; "}\n";
compile(shaderString); compile(shaderString);
ASSERT_TRUE(foundInCode("v = angle_frl(texture2D(s, angle_frm(u)))")); ASSERT_TRUE(foundInCode("v = angle_frl(texture2D(s, angle_frm(u)))"));
}; }
TEST_F(DebugShaderPrecisionTest, FunctionCallParameterQualifiersFromDefinition) TEST_F(DebugShaderPrecisionTest, FunctionCallParameterQualifiersFromDefinition)
{ {
...@@ -741,7 +741,7 @@ TEST_F(DebugShaderPrecisionTest, FunctionCallParameterQualifiersFromDefinition) ...@@ -741,7 +741,7 @@ TEST_F(DebugShaderPrecisionTest, FunctionCallParameterQualifiersFromDefinition)
ASSERT_TRUE(foundInCode("compound_add(v, angle_frm(u3))")); ASSERT_TRUE(foundInCode("compound_add(v, angle_frm(u3))"));
// Test out parameter // Test out parameter
ASSERT_TRUE(foundInCode("add_to_last(angle_frm(u4), angle_frm(u5), v2)")); ASSERT_TRUE(foundInCode("add_to_last(angle_frm(u4), angle_frm(u5), v2)"));
}; }
TEST_F(DebugShaderPrecisionTest, FunctionCallParameterQualifiersFromPrototype) TEST_F(DebugShaderPrecisionTest, FunctionCallParameterQualifiersFromPrototype)
{ {
...@@ -778,7 +778,7 @@ TEST_F(DebugShaderPrecisionTest, FunctionCallParameterQualifiersFromPrototype) ...@@ -778,7 +778,7 @@ TEST_F(DebugShaderPrecisionTest, FunctionCallParameterQualifiersFromPrototype)
ASSERT_TRUE(foundInCode("compound_add(v, angle_frm(u3))")); ASSERT_TRUE(foundInCode("compound_add(v, angle_frm(u3))"));
// Test out parameter // Test out parameter
ASSERT_TRUE(foundInCode("add_to_last(angle_frm(u4), angle_frm(u5), v2)")); ASSERT_TRUE(foundInCode("add_to_last(angle_frm(u4), angle_frm(u5), v2)"));
}; }
TEST_F(DebugShaderPrecisionTest, NestedFunctionCalls) TEST_F(DebugShaderPrecisionTest, NestedFunctionCalls)
{ {
...@@ -802,4 +802,4 @@ TEST_F(DebugShaderPrecisionTest, NestedFunctionCalls) ...@@ -802,4 +802,4 @@ TEST_F(DebugShaderPrecisionTest, NestedFunctionCalls)
compile(shaderString); compile(shaderString);
// Test nested calls // Test nested calls
ASSERT_TRUE(foundInCode("v2 = add(compound_add(v, angle_frm(u2)), angle_frm(fract(angle_frm(u3))))")); ASSERT_TRUE(foundInCode("v2 = add(compound_add(v, angle_frm(u2)), angle_frm(fract(angle_frm(u3))))"));
}; }
...@@ -64,9 +64,9 @@ TEST_F(MalformedShaderTest, FunctionParameterMismatch) ...@@ -64,9 +64,9 @@ TEST_F(MalformedShaderTest, FunctionParameterMismatch)
"}\n"; "}\n";
if (compile(shaderString)) if (compile(shaderString))
{ {
FAIL() << "Shader compilation succeeded, expecting failure " << mInfoLog; FAIL() << "Shader compilation succeeded, expecting failure " << mInfoLog;
} }
}; }
// Functions can't be redeclared as variables in the same scope (ESSL 1.00 section 4.2.7) // Functions can't be redeclared as variables in the same scope (ESSL 1.00 section 4.2.7)
TEST_F(MalformedShaderTest, RedeclaringFunctionAsVariable) TEST_F(MalformedShaderTest, RedeclaringFunctionAsVariable)
...@@ -82,9 +82,9 @@ TEST_F(MalformedShaderTest, RedeclaringFunctionAsVariable) ...@@ -82,9 +82,9 @@ TEST_F(MalformedShaderTest, RedeclaringFunctionAsVariable)
"}\n"; "}\n";
if (compile(shaderString)) if (compile(shaderString))
{ {
FAIL() << "Shader compilation succeeded, expecting failure " << mInfoLog; FAIL() << "Shader compilation succeeded, expecting failure " << mInfoLog;
} }
}; }
// Functions can't be redeclared as structs in the same scope (ESSL 1.00 section 4.2.7) // Functions can't be redeclared as structs in the same scope (ESSL 1.00 section 4.2.7)
TEST_F(MalformedShaderTest, RedeclaringFunctionAsStruct) TEST_F(MalformedShaderTest, RedeclaringFunctionAsStruct)
...@@ -100,9 +100,9 @@ TEST_F(MalformedShaderTest, RedeclaringFunctionAsStruct) ...@@ -100,9 +100,9 @@ TEST_F(MalformedShaderTest, RedeclaringFunctionAsStruct)
"}\n"; "}\n";
if (compile(shaderString)) if (compile(shaderString))
{ {
FAIL() << "Shader compilation succeeded, expecting failure " << mInfoLog; FAIL() << "Shader compilation succeeded, expecting failure " << mInfoLog;
} }
}; }
// Functions can't be redeclared with different qualifiers (ESSL 1.00 section 6.1.0) // Functions can't be redeclared with different qualifiers (ESSL 1.00 section 6.1.0)
TEST_F(MalformedShaderTest, RedeclaringFunctionWithDifferentQualifiers) TEST_F(MalformedShaderTest, RedeclaringFunctionWithDifferentQualifiers)
...@@ -118,9 +118,9 @@ TEST_F(MalformedShaderTest, RedeclaringFunctionWithDifferentQualifiers) ...@@ -118,9 +118,9 @@ TEST_F(MalformedShaderTest, RedeclaringFunctionWithDifferentQualifiers)
"}\n"; "}\n";
if (compile(shaderString)) if (compile(shaderString))
{ {
FAIL() << "Shader compilation succeeded, expecting failure " << mInfoLog; FAIL() << "Shader compilation succeeded, expecting failure " << mInfoLog;
} }
}; }
// Assignment and equality are undefined for structures containing arrays (ESSL 1.00 section 5.7) // Assignment and equality are undefined for structures containing arrays (ESSL 1.00 section 5.7)
TEST_F(MalformedShaderTest, CompareStructsContainingArrays) TEST_F(MalformedShaderTest, CompareStructsContainingArrays)
......
...@@ -57,4 +57,4 @@ TEST_F(NVDrawBuffersTest, NVDrawBuffers) ...@@ -57,4 +57,4 @@ TEST_F(NVDrawBuffersTest, NVDrawBuffers)
EXPECT_NE(std::string::npos, nv_draw_buffers_ind); EXPECT_NE(std::string::npos, nv_draw_buffers_ind);
size_t ext_draw_buffers_ind = objCode.find("GL_EXT_draw_buffers"); size_t ext_draw_buffers_ind = objCode.find("GL_EXT_draw_buffers");
EXPECT_EQ(std::string::npos, ext_draw_buffers_ind); EXPECT_EQ(std::string::npos, ext_draw_buffers_ind);
}; }
...@@ -122,7 +122,7 @@ TEST_F(ShaderExtensionTest, FragDepthExtResetsInternalStates) ...@@ -122,7 +122,7 @@ TEST_F(ShaderExtensionTest, FragDepthExtResetsInternalStates)
TestShaderExtension(FragDepthExtShdr, 2, true); TestShaderExtension(FragDepthExtShdr, 2, true);
TestShaderExtension(&FragDepthExtShdr[1], 1, false); TestShaderExtension(&FragDepthExtShdr[1], 1, false);
TestShaderExtension(FragDepthExtShdr, 2, true); TestShaderExtension(FragDepthExtShdr, 2, true);
}; }
TEST_F(ShaderExtensionTest, StandDerivExtRequiresExt) TEST_F(ShaderExtensionTest, StandDerivExtRequiresExt)
{ {
...@@ -158,7 +158,7 @@ TEST_F(ShaderExtensionTest, StandDerivExtResetsInternalStates) ...@@ -158,7 +158,7 @@ TEST_F(ShaderExtensionTest, StandDerivExtResetsInternalStates)
TestShaderExtension(&StandDerivExtShdr[1], 1, false); TestShaderExtension(&StandDerivExtShdr[1], 1, false);
TestShaderExtension(StandDerivExtShdr, 2, true); TestShaderExtension(StandDerivExtShdr, 2, true);
TestShaderExtension(&StandDerivExtShdr[1], 1, false); TestShaderExtension(&StandDerivExtShdr[1], 1, false);
}; }
TEST_F(ShaderExtensionTest, TextureLODExtRequiresExt) TEST_F(ShaderExtensionTest, TextureLODExtRequiresExt)
{ {
...@@ -194,4 +194,4 @@ TEST_F(ShaderExtensionTest, TextureLODExtResetsInternalStates) ...@@ -194,4 +194,4 @@ TEST_F(ShaderExtensionTest, TextureLODExtResetsInternalStates)
TestShaderExtension(TextureLODShdr, 2, true); TestShaderExtension(TextureLODShdr, 2, true);
TestShaderExtension(&TextureLODShdr[1], 1, false); TestShaderExtension(&TextureLODShdr[1], 1, false);
TestShaderExtension(TextureLODShdr, 2, true); TestShaderExtension(TextureLODShdr, 2, true);
}; }
...@@ -76,7 +76,7 @@ TEST_F(TypeTrackingTest, FunctionPrototypeMangling) ...@@ -76,7 +76,7 @@ TEST_F(TypeTrackingTest, FunctionPrototypeMangling)
ASSERT_FALSE(foundErrorInIntermediateTree()); ASSERT_FALSE(foundErrorInIntermediateTree());
ASSERT_TRUE(foundInIntermediateTree("Function Prototype: fun(f1;")); ASSERT_TRUE(foundInIntermediateTree("Function Prototype: fun(f1;"));
ASSERT_TRUE(foundInIntermediateTree("Function Definition: fun(f1;")); ASSERT_TRUE(foundInIntermediateTree("Function Definition: fun(f1;"));
}; }
TEST_F(TypeTrackingTest, BuiltInFunctionResultPrecision) TEST_F(TypeTrackingTest, BuiltInFunctionResultPrecision)
{ {
...@@ -90,7 +90,7 @@ TEST_F(TypeTrackingTest, BuiltInFunctionResultPrecision) ...@@ -90,7 +90,7 @@ TEST_F(TypeTrackingTest, BuiltInFunctionResultPrecision)
compile(shaderString); compile(shaderString);
ASSERT_FALSE(foundErrorInIntermediateTree()); ASSERT_FALSE(foundErrorInIntermediateTree());
ASSERT_TRUE(foundInIntermediateTree("sine (mediump float)")); ASSERT_TRUE(foundInIntermediateTree("sine (mediump float)"));
}; }
TEST_F(TypeTrackingTest, BinaryMathResultPrecision) TEST_F(TypeTrackingTest, BinaryMathResultPrecision)
{ {
...@@ -104,7 +104,7 @@ TEST_F(TypeTrackingTest, BinaryMathResultPrecision) ...@@ -104,7 +104,7 @@ TEST_F(TypeTrackingTest, BinaryMathResultPrecision)
compile(shaderString); compile(shaderString);
ASSERT_FALSE(foundErrorInIntermediateTree()); ASSERT_FALSE(foundErrorInIntermediateTree());
ASSERT_TRUE(foundInIntermediateTree("multiply (mediump float)")); ASSERT_TRUE(foundInIntermediateTree("multiply (mediump float)"));
}; }
TEST_F(TypeTrackingTest, BuiltInVecFunctionResultTypeAndPrecision) TEST_F(TypeTrackingTest, BuiltInVecFunctionResultTypeAndPrecision)
{ {
...@@ -122,7 +122,7 @@ TEST_F(TypeTrackingTest, BuiltInVecFunctionResultTypeAndPrecision) ...@@ -122,7 +122,7 @@ TEST_F(TypeTrackingTest, BuiltInVecFunctionResultTypeAndPrecision)
ASSERT_TRUE(foundInIntermediateTree("length (mediump float)")); ASSERT_TRUE(foundInIntermediateTree("length (mediump float)"));
ASSERT_TRUE(foundInIntermediateTree("dot-product (mediump float)")); ASSERT_TRUE(foundInIntermediateTree("dot-product (mediump float)"));
ASSERT_TRUE(foundInIntermediateTree("distance (mediump float)")); ASSERT_TRUE(foundInIntermediateTree("distance (mediump float)"));
}; }
TEST_F(TypeTrackingTest, BuiltInFunctionChoosesHigherPrecision) TEST_F(TypeTrackingTest, BuiltInFunctionChoosesHigherPrecision)
{ {
...@@ -139,7 +139,7 @@ TEST_F(TypeTrackingTest, BuiltInFunctionChoosesHigherPrecision) ...@@ -139,7 +139,7 @@ TEST_F(TypeTrackingTest, BuiltInFunctionChoosesHigherPrecision)
ASSERT_FALSE(foundErrorInIntermediateTree()); ASSERT_FALSE(foundErrorInIntermediateTree());
ASSERT_TRUE(foundInIntermediateTree("dot-product (mediump float)")); ASSERT_TRUE(foundInIntermediateTree("dot-product (mediump float)"));
ASSERT_TRUE(foundInIntermediateTree("distance (mediump float)")); ASSERT_TRUE(foundInIntermediateTree("distance (mediump float)"));
}; }
TEST_F(TypeTrackingTest, BuiltInBoolFunctionResultType) TEST_F(TypeTrackingTest, BuiltInBoolFunctionResultType)
{ {
...@@ -156,7 +156,7 @@ TEST_F(TypeTrackingTest, BuiltInBoolFunctionResultType) ...@@ -156,7 +156,7 @@ TEST_F(TypeTrackingTest, BuiltInBoolFunctionResultType)
ASSERT_TRUE(foundInIntermediateTree("any (bool)")); ASSERT_TRUE(foundInIntermediateTree("any (bool)"));
ASSERT_TRUE(foundInIntermediateTree("all (bool)")); ASSERT_TRUE(foundInIntermediateTree("all (bool)"));
ASSERT_TRUE(foundInIntermediateTree("Negate conditional (4-component vector of bool)")); ASSERT_TRUE(foundInIntermediateTree("Negate conditional (4-component vector of bool)"));
}; }
TEST_F(TypeTrackingTest, BuiltInVecToBoolFunctionResultType) TEST_F(TypeTrackingTest, BuiltInVecToBoolFunctionResultType)
{ {
...@@ -175,7 +175,7 @@ TEST_F(TypeTrackingTest, BuiltInVecToBoolFunctionResultType) ...@@ -175,7 +175,7 @@ TEST_F(TypeTrackingTest, BuiltInVecToBoolFunctionResultType)
ASSERT_FALSE(foundErrorInIntermediateTree()); ASSERT_FALSE(foundErrorInIntermediateTree());
ASSERT_TRUE(foundInIntermediateTree("Less Than (2-component vector of bool)")); ASSERT_TRUE(foundInIntermediateTree("Less Than (2-component vector of bool)"));
ASSERT_TRUE(foundInIntermediateTree("Greater Than (2-component vector of bool)")); ASSERT_TRUE(foundInIntermediateTree("Greater Than (2-component vector of bool)"));
}; }
TEST_F(TypeTrackingTest, Texture2DResultTypeAndPrecision) TEST_F(TypeTrackingTest, Texture2DResultTypeAndPrecision)
{ {
...@@ -192,7 +192,7 @@ TEST_F(TypeTrackingTest, Texture2DResultTypeAndPrecision) ...@@ -192,7 +192,7 @@ TEST_F(TypeTrackingTest, Texture2DResultTypeAndPrecision)
compile(shaderString); compile(shaderString);
ASSERT_FALSE(foundErrorInIntermediateTree()); ASSERT_FALSE(foundErrorInIntermediateTree());
ASSERT_TRUE(foundInIntermediateTree("texture2D(s21;vf2; (lowp 4-component vector of float)")); ASSERT_TRUE(foundInIntermediateTree("texture2D(s21;vf2; (lowp 4-component vector of float)"));
}; }
TEST_F(TypeTrackingTest, TextureCubeResultTypeAndPrecision) TEST_F(TypeTrackingTest, TextureCubeResultTypeAndPrecision)
{ {
...@@ -209,7 +209,7 @@ TEST_F(TypeTrackingTest, TextureCubeResultTypeAndPrecision) ...@@ -209,7 +209,7 @@ TEST_F(TypeTrackingTest, TextureCubeResultTypeAndPrecision)
compile(shaderString); compile(shaderString);
ASSERT_FALSE(foundErrorInIntermediateTree()); ASSERT_FALSE(foundErrorInIntermediateTree());
ASSERT_TRUE(foundInIntermediateTree("textureCube(sC1;vf3; (lowp 4-component vector of float)")); ASSERT_TRUE(foundInIntermediateTree("textureCube(sC1;vf3; (lowp 4-component vector of float)"));
}; }
TEST_F(TypeTrackingTest, TextureSizeResultTypeAndPrecision) TEST_F(TypeTrackingTest, TextureSizeResultTypeAndPrecision)
{ {
...@@ -230,7 +230,7 @@ TEST_F(TypeTrackingTest, TextureSizeResultTypeAndPrecision) ...@@ -230,7 +230,7 @@ TEST_F(TypeTrackingTest, TextureSizeResultTypeAndPrecision)
compile(shaderString); compile(shaderString);
ASSERT_FALSE(foundErrorInIntermediateTree()); ASSERT_FALSE(foundErrorInIntermediateTree());
ASSERT_TRUE(foundInIntermediateTree("textureSize(s21;i1; (highp 2-component vector of int)")); ASSERT_TRUE(foundInIntermediateTree("textureSize(s21;i1; (highp 2-component vector of int)"));
}; }
TEST_F(TypeTrackingTest, BuiltInConstructorResultTypeAndPrecision) TEST_F(TypeTrackingTest, BuiltInConstructorResultTypeAndPrecision)
{ {
...@@ -247,7 +247,7 @@ TEST_F(TypeTrackingTest, BuiltInConstructorResultTypeAndPrecision) ...@@ -247,7 +247,7 @@ TEST_F(TypeTrackingTest, BuiltInConstructorResultTypeAndPrecision)
compile(shaderString); compile(shaderString);
ASSERT_FALSE(foundErrorInIntermediateTree()); ASSERT_FALSE(foundErrorInIntermediateTree());
ASSERT_TRUE(foundInIntermediateTree("Construct vec4 (mediump 4-component vector of float)")); ASSERT_TRUE(foundInIntermediateTree("Construct vec4 (mediump 4-component vector of float)"));
}; }
TEST_F(TypeTrackingTest, StructConstructorResultNoPrecision) TEST_F(TypeTrackingTest, StructConstructorResultNoPrecision)
{ {
...@@ -263,7 +263,7 @@ TEST_F(TypeTrackingTest, StructConstructorResultNoPrecision) ...@@ -263,7 +263,7 @@ TEST_F(TypeTrackingTest, StructConstructorResultNoPrecision)
compile(shaderString); compile(shaderString);
ASSERT_FALSE(foundErrorInIntermediateTree()); ASSERT_FALSE(foundErrorInIntermediateTree());
ASSERT_TRUE(foundInIntermediateTree("Construct structure (structure)")); ASSERT_TRUE(foundInIntermediateTree("Construct structure (structure)"));
}; }
TEST_F(TypeTrackingTest, PackResultTypeAndPrecision) TEST_F(TypeTrackingTest, PackResultTypeAndPrecision)
{ {
...@@ -289,7 +289,7 @@ TEST_F(TypeTrackingTest, PackResultTypeAndPrecision) ...@@ -289,7 +289,7 @@ TEST_F(TypeTrackingTest, PackResultTypeAndPrecision)
ASSERT_TRUE(foundInIntermediateTree("pack Snorm 2x16 (highp uint)")); ASSERT_TRUE(foundInIntermediateTree("pack Snorm 2x16 (highp uint)"));
ASSERT_TRUE(foundInIntermediateTree("pack Unorm 2x16 (highp uint)")); ASSERT_TRUE(foundInIntermediateTree("pack Unorm 2x16 (highp uint)"));
ASSERT_TRUE(foundInIntermediateTree("pack half 2x16 (highp uint)")); ASSERT_TRUE(foundInIntermediateTree("pack half 2x16 (highp uint)"));
}; }
TEST_F(TypeTrackingTest, UnpackNormResultTypeAndPrecision) TEST_F(TypeTrackingTest, UnpackNormResultTypeAndPrecision)
{ {
...@@ -313,7 +313,7 @@ TEST_F(TypeTrackingTest, UnpackNormResultTypeAndPrecision) ...@@ -313,7 +313,7 @@ TEST_F(TypeTrackingTest, UnpackNormResultTypeAndPrecision)
ASSERT_FALSE(foundErrorInIntermediateTree()); ASSERT_FALSE(foundErrorInIntermediateTree());
ASSERT_TRUE(foundInIntermediateTree("unpack Snorm 2x16 (highp 2-component vector of float)")); ASSERT_TRUE(foundInIntermediateTree("unpack Snorm 2x16 (highp 2-component vector of float)"));
ASSERT_TRUE(foundInIntermediateTree("unpack Unorm 2x16 (highp 2-component vector of float)")); ASSERT_TRUE(foundInIntermediateTree("unpack Unorm 2x16 (highp 2-component vector of float)"));
}; }
TEST_F(TypeTrackingTest, UnpackHalfResultTypeAndPrecision) TEST_F(TypeTrackingTest, UnpackHalfResultTypeAndPrecision)
{ {
...@@ -335,7 +335,7 @@ TEST_F(TypeTrackingTest, UnpackHalfResultTypeAndPrecision) ...@@ -335,7 +335,7 @@ TEST_F(TypeTrackingTest, UnpackHalfResultTypeAndPrecision)
compile(shaderString); compile(shaderString);
ASSERT_FALSE(foundErrorInIntermediateTree()); ASSERT_FALSE(foundErrorInIntermediateTree());
ASSERT_TRUE(foundInIntermediateTree("unpack half 2x16 (mediump 2-component vector of float)")); ASSERT_TRUE(foundInIntermediateTree("unpack half 2x16 (mediump 2-component vector of float)"));
}; }
TEST_F(TypeTrackingTest, BuiltInAbsSignFunctionFloatResultTypeAndPrecision) TEST_F(TypeTrackingTest, BuiltInAbsSignFunctionFloatResultTypeAndPrecision)
{ {
...@@ -351,7 +351,7 @@ TEST_F(TypeTrackingTest, BuiltInAbsSignFunctionFloatResultTypeAndPrecision) ...@@ -351,7 +351,7 @@ TEST_F(TypeTrackingTest, BuiltInAbsSignFunctionFloatResultTypeAndPrecision)
ASSERT_FALSE(foundErrorInIntermediateTree()); ASSERT_FALSE(foundErrorInIntermediateTree());
ASSERT_TRUE(foundInIntermediateTree("Absolute value (mediump float)")); ASSERT_TRUE(foundInIntermediateTree("Absolute value (mediump float)"));
ASSERT_TRUE(foundInIntermediateTree("Sign (mediump float)")); ASSERT_TRUE(foundInIntermediateTree("Sign (mediump float)"));
}; }
TEST_F(TypeTrackingTest, BuiltInAbsSignFunctionIntResultTypeAndPrecision) TEST_F(TypeTrackingTest, BuiltInAbsSignFunctionIntResultTypeAndPrecision)
{ {
...@@ -370,4 +370,4 @@ TEST_F(TypeTrackingTest, BuiltInAbsSignFunctionIntResultTypeAndPrecision) ...@@ -370,4 +370,4 @@ TEST_F(TypeTrackingTest, BuiltInAbsSignFunctionIntResultTypeAndPrecision)
ASSERT_FALSE(foundErrorInIntermediateTree()); ASSERT_FALSE(foundErrorInIntermediateTree());
ASSERT_TRUE(foundInIntermediateTree("Absolute value (mediump int)")); ASSERT_TRUE(foundInIntermediateTree("Absolute value (mediump int)"));
ASSERT_TRUE(foundInIntermediateTree("Sign (mediump int)")); ASSERT_TRUE(foundInIntermediateTree("Sign (mediump int)"));
}; }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment