[SERVER-43764] Add more testing for special values in DoubleDoubleSummation Created: 02/Oct/19  Updated: 29/Oct/23  Resolved: 17/Oct/19

Status: Closed
Project: Core Server
Component/s: Aggregation Framework
Affects Version/s: None
Fix Version/s: 3.6.17, 4.3.1, 4.2.3, 4.0.14

Type: Improvement Priority: Major - P3
Reporter: Geert Bosch Assignee: Anton Korshunov
Resolution: Fixed Votes: 0
Labels: greenerbuild
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Tested
is testing SERVER-43034 Special values handling is inconsiste... Closed
Backwards Compatibility: Fully Compatible
Backport Requested:
v4.2, v4.0, v3.6
Participants:

 Description   

TEST(Summation, ConvertSpecialToDecimal) {
    constexpr double infinity = std::numeric_limits<double>::infinity();
    DoubleDoubleSummation sum;
    
    sum.addDouble(infinity);    
    ASSERT_EQUALS(infinity, sum.getDouble()); // ok
    ASSERT_TRUE(sum.getDecimal().isInfinite()); // <-- fail here, it's nan
    ASSERT_FALSE(sum.getDecimal().isNaN()); // <!-- fail here, it is actually nan
    
    sum.addDouble(1); // now once we add something to sum, everything is ok
    ASSERT_EQUALS(infinity, sum.getDouble()); // ok, still infinity
    ASSERT_TRUE(sum.getDecimal().isInfinite()); // ok, now it's infinity
    ASSERT_FALSE(sum.getDecimal().isNaN()); // ok, not nan
}



 Comments   
Comment by Githook User [ 11/Dec/19 ]

Author:

{'name': 'Anton Korshunov', 'email': 'anton.korshunov@mongodb.com', 'username': 'antkorsh'}

Message: SERVER-43764 Add more testing for special values in DoubleDoubleSummation

(cherry picked from commit abe90fb2090ead3fdbf9f62d5db50c88eb31d527)
Branch: v3.6
https://github.com/mongodb/mongo/commit/919b7c1ce02104a22a06b14016d152440f66161d

Comment by Githook User [ 10/Dec/19 ]

Author:

{'email': 'anton.korshunov@mongodb.com', 'name': 'Anton Korshunov', 'username': 'antkorsh'}

Message: SERVER-43764 Add more testing for special values in DoubleDoubleSummation

(cherry picked from commit abe90fb2090ead3fdbf9f62d5db50c88eb31d527)
Branch: v4.2
https://github.com/mongodb/mongo/commit/2a455afd9775631c1ddb041cfdababc27b833810

Comment by Githook User [ 10/Dec/19 ]

Author:

{'name': 'Anton Korshunov', 'username': 'antkorsh', 'email': 'anton.korshunov@mongodb.com'}

Message: SERVER-43764 Add more testing for special values in DoubleDoubleSummation

(cherry picked from commit abe90fb2090ead3fdbf9f62d5db50c88eb31d527)
Branch: v4.0
https://github.com/mongodb/mongo/commit/d1450aa60419dd7c3fda9d96bad2d27c70067311

Comment by Anton Korshunov [ 15/Nov/19 ]

Confirmed with Geert, we should back port this ticket.

Comment by Githook User [ 17/Oct/19 ]

Author:

{'name': 'Anton Korshunov', 'username': 'antkorsh', 'email': 'anton.korshunov@mongodb.com'}

Message: SERVER-43764 Add more testing for special values in DoubleDoubleSummation
Branch: master
https://github.com/mongodb/mongo/commit/abe90fb2090ead3fdbf9f62d5db50c88eb31d527

Comment by Geert Bosch [ 02/Oct/19 ]

Seemed cleaner to do the additional testing in this separate ticket, as anton.korshunov mentioned we should also add JS tests.

Generated at Thu Feb 08 05:04:02 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.