Merge "Touch process watchdog in built-in precision tests" into marshmallow-cts-dev...
[platform/upstream/VK-GL-CTS.git] / modules / glshared / glsBuiltinPrecisionTests.cpp
index 81a3bc6..fdb5295 100644 (file)
@@ -177,7 +177,7 @@ const char* dataTypeNameOf (void)
 template <>
 const char* dataTypeNameOf<Void> (void)
 {
-       DE_ASSERT(!"Impossible");
+       DE_FATAL("Impossible");
        return DE_NULL;
 }
 
@@ -191,7 +191,7 @@ VarType getVarTypeOf (Precision prec = glu::PRECISION_LAST)
 template <>
 VarType getVarTypeOf<Void> (Precision)
 {
-       DE_ASSERT(!"Impossible");
+       DE_FATAL("Impossible");
        return VarType();
 }
 
@@ -349,7 +349,7 @@ struct Traits<bool> : ScalarTraits<bool>
                                                                                 const float&           value,
                                                                                 ostream&                       os)
        {
-               os << (value ? "true" : "false");
+               os << (value != 0.0f ? "true" : "false");
        }
 
        static void                     doPrintIVal             (const FloatFormat&,
@@ -2099,7 +2099,7 @@ protected:
                        case glu::PRECISION_LOWP:
                                return ctx.format.ulp(ret, 2.0);
                        default:
-                               DE_ASSERT(!"Impossible");
+                               DE_FATAL("Impossible");
                }
                return 0;
        }
@@ -2137,7 +2137,7 @@ protected:
                        case glu::PRECISION_LOWP:
                                return ctx.format.ulp(ret, 2.0);
                        default:
-                               DE_ASSERT(!"Impossible");
+                               DE_FATAL("Impossible");
                }
 
                return 0;
@@ -2482,8 +2482,8 @@ DEFINE_DERIVED_FLOAT1(Tanh, tanh, x, sinh(x) / cosh(x));
 // These are not defined as derived forms in the GLSL ES spec, but
 // that gives us a reasonable precision.
 DEFINE_DERIVED_FLOAT1(ASinh, asinh, x, log(x + sqrt(x * x + constant(1.0f))));
-DEFINE_DERIVED_FLOAT1(ACosh, acosh, x, log(x + sqrt((x + constant(1.0f)) *
-                                                                                                       (x - constant(1.0f)))));
+DEFINE_DERIVED_FLOAT1(ACosh, acosh, x, log(x + sqrt(alternatives((x + constant(1.0f)) * (x - constant(1.0f)),
+                                                                                                                                (x*x - constant(1.0f))))));
 DEFINE_DERIVED_FLOAT1(ATanh, atanh, x, constant(0.5f) * log((constant(1.0f) + x) /
                                                                                                                        (constant(1.0f) - x)));
 
@@ -4041,7 +4041,7 @@ public:
                const int       exp             = rnd.getInt(0, getNumBits(prec)-2);
                const int       sign    = rnd.getBool() ? -1 : 1;
 
-               return sign * rnd.getInt(0, 1L << exp);
+               return sign * rnd.getInt(0, (deInt32)1 << exp);
        }
 
        void    genFixeds       (const FloatFormat&, vector<int>& dst) const
@@ -4161,26 +4161,26 @@ void DefaultSampling<float>::genFixeds (const FloatFormat& format, vector<float>
        for (int sign = -1; sign <= 1; sign += 2)
        {
                // Smallest subnormal
-               dst.push_back(sign * minQuantum);
+               dst.push_back((float)sign * minQuantum);
 
                // Largest subnormal
-               dst.push_back(sign * (minNormalized - minQuantum));
+               dst.push_back((float)sign * (minNormalized - minQuantum));
 
                // Smallest normalized
-               dst.push_back(sign * minNormalized);
+               dst.push_back((float)sign * minNormalized);
 
                // Next smallest normalized
-               dst.push_back(sign * (minNormalized + minQuantum));
+               dst.push_back((float)sign * (minNormalized + minQuantum));
 
-               dst.push_back(sign * 0.5f);
-               dst.push_back(sign * 1.0f);
-               dst.push_back(sign * 2.0f);
+               dst.push_back((float)sign * 0.5f);
+               dst.push_back((float)sign * 1.0f);
+               dst.push_back((float)sign * 2.0f);
 
                // Largest number
-               dst.push_back(sign * (deFloatLdExp(1.0f, maxExp) +
-                                                         (deFloatLdExp(1.0f, maxExp) - maxQuantum)));
+               dst.push_back((float)sign * (deFloatLdExp(1.0f, maxExp) +
+                                                                       (deFloatLdExp(1.0f, maxExp) - maxQuantum)));
 
-               dst.push_back(sign * TCU_INFINITY);
+               dst.push_back((float)sign * TCU_INFINITY);
        }
 }
 
@@ -4974,7 +4974,7 @@ PrecisionCase* createFuncCase (const Context&     context,
                case 1:
                        return new InOutFuncCase<Sig>(context, name, func);
                default:
-                       DE_ASSERT(!"Impossible");
+                       DE_FATAL("Impossible");
        }
        return DE_NULL;
 }