astyle run [ci skip]
This commit is contained in:
parent
6f31ce334d
commit
af369b4925
|
@ -552,8 +552,8 @@ std::string MathLib::divide(const std::string &first, const std::string &second)
|
|||
} else if (isNullValue(second)) {
|
||||
if (isNullValue(first))
|
||||
return "nan.0";
|
||||
const int sign_first = (isPositive(first)) ? 1 : -1;
|
||||
const int sign_second = (isPositive(second)) ? 1 : -1;
|
||||
const int sign_first = (isPositive(first)) ? 1 : -1;
|
||||
const int sign_second = (isPositive(second)) ? 1 : -1;
|
||||
return (sign_first*sign_second == 1) ? "inf.0" : "-inf.0";
|
||||
}
|
||||
return toString(toDoubleNumber(first) / toDoubleNumber(second));
|
||||
|
|
|
@ -38,7 +38,7 @@ private:
|
|||
TEST_CASE(compare); // mismatching LHS/RHS in comparison
|
||||
TEST_CASE(multicompare); // mismatching comparisons
|
||||
TEST_CASE(duplicateIf); // duplicate conditions in if and else-if
|
||||
TEST_CASE(invalidMissingSemicolon); // crash as of #5867
|
||||
TEST_CASE(invalidMissingSemicolon); // crash as of #5867
|
||||
}
|
||||
|
||||
void check(const char code[]) {
|
||||
|
@ -379,9 +379,8 @@ private:
|
|||
"}");
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
}
|
||||
|
||||
void invalidMissingSemicolon()
|
||||
{
|
||||
|
||||
void invalidMissingSemicolon() {
|
||||
// simply survive - a syntax error would be even better
|
||||
check("void f(int x) {\n"
|
||||
" x = 42\n"
|
||||
|
|
|
@ -599,18 +599,18 @@ private:
|
|||
|
||||
void naninf() const {
|
||||
ASSERT_EQUALS("nan.0", MathLib::divide("0.0", "0.0")); // nan
|
||||
ASSERT_EQUALS("nan.0", MathLib::divide("0.0", "0.f")); // nan (#5875)
|
||||
ASSERT_EQUALS("nan.0", MathLib::divide("-0.0", "0.f")); // nan (#5875)
|
||||
ASSERT_EQUALS("nan.0", MathLib::divide("-0.f", "0.f")); // nan (#5875)
|
||||
ASSERT_EQUALS("nan.0", MathLib::divide("-0.0", "-0.f")); // nan (#5875)
|
||||
ASSERT_EQUALS("nan.0", MathLib::divide("-.0", "-0.f")); // nan (#5875)
|
||||
ASSERT_EQUALS("nan.0", MathLib::divide("0.0", "-0.f")); // nan (#5875)
|
||||
ASSERT_EQUALS("nan.0", MathLib::divide("0.f", "-0.f")); // nan (#5875)
|
||||
ASSERT_EQUALS("nan.0", MathLib::divide("0.0", "0.f")); // nan (#5875)
|
||||
ASSERT_EQUALS("nan.0", MathLib::divide("-0.0", "0.f")); // nan (#5875)
|
||||
ASSERT_EQUALS("nan.0", MathLib::divide("-0.f", "0.f")); // nan (#5875)
|
||||
ASSERT_EQUALS("nan.0", MathLib::divide("-0.0", "-0.f")); // nan (#5875)
|
||||
ASSERT_EQUALS("nan.0", MathLib::divide("-.0", "-0.f")); // nan (#5875)
|
||||
ASSERT_EQUALS("nan.0", MathLib::divide("0.0", "-0.f")); // nan (#5875)
|
||||
ASSERT_EQUALS("nan.0", MathLib::divide("0.f", "-0.f")); // nan (#5875)
|
||||
ASSERT_EQUALS("inf.0", MathLib::divide("3.0", "0.0")); // inf
|
||||
ASSERT_EQUALS("inf.0", MathLib::divide("3.0", "0.f")); // inf (#5875)
|
||||
ASSERT_EQUALS("inf.0", MathLib::divide("3.0", "0.f")); // inf (#5875)
|
||||
ASSERT_EQUALS("-inf.0", MathLib::divide("-3.0", "0.0")); // -inf (#5142)
|
||||
ASSERT_EQUALS("-inf.0", MathLib::divide("-3.0", "0.0f")); // -inf (#5142)
|
||||
ASSERT_EQUALS("inf.0", MathLib::divide("-3.0", "-0.0f")); // inf (#5142)
|
||||
ASSERT_EQUALS("-inf.0", MathLib::divide("-3.0", "0.0f")); // -inf (#5142)
|
||||
ASSERT_EQUALS("inf.0", MathLib::divide("-3.0", "-0.0f")); // inf (#5142)
|
||||
}
|
||||
|
||||
void isNullValue() const {
|
||||
|
|
Loading…
Reference in New Issue