> On Oct. 6, 2015, 9:47 p.m., Jie Yu wrote: > > src/common/resources.cpp, line 880 > > <https://reviews.apache.org/r/39056/diff/2/?file=1092068#file1092068line880> > > > > Can you introduce a `CHECK_DOUBLE_EQ` in `stout/check.hpp`, similar to > > > > https://code.google.com/p/googletest/wiki/AdvancedGuide#Floating-Point_Macros > > > > To choose a default epsilon, you probably want to check the above link. > > Gtest uses "Units in the Last Place (ULPs)" as the default.
CHECK_DOUBLE_EQ will also fail. F0930 18:15:38.169140 26984 resources.cpp:874] Check failed: (result.cpus().get()) >= (cpus().get())-0.000000000000001L (24 vs. 24) *** Check failure stack trace: *** F0930 18:15:38.169322 26991 resources.cpp:874] Check failed: (result.cpus().get()) >= (cpus().get())-0.000000000000001L (24 vs. 24) *** Check failure stack trace: *** CHECK_NEAR() is the right Macro to use. But we also need to check (isNone() and isNone()) equality and hence the present implementation. I think the long term fix is to wrap double into Double and have the opeartor== to the right thing. > On Oct. 6, 2015, 9:47 p.m., Jie Yu wrote: > > src/v1/resources.cpp, lines 880-886 > > <https://reviews.apache.org/r/39056/diff/2/?file=1092070#file1092070line880> > > > > Not yours, but too bad we need to duplicate the logic here. I am now > > sure what will be the long term plan here. If we have 10 versions, do we > > need to copy the code 10 times... That's not good :( I agree !! I already missed src/v1/resources.cpp in my first review request :) Thanks Neil. - Mandeep ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/39056/#review101691 ----------------------------------------------------------- On Oct. 6, 2015, 9:33 p.m., Mandeep Chadha wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/39056/ > ----------------------------------------------------------- > > (Updated Oct. 6, 2015, 9:33 p.m.) > > > Review request for mesos and Neil Conway. > > > Bugs: MESOS-3552 > https://issues.apache.org/jira/browse/MESOS-3552 > > > Repository: mesos > > > Description > ------- > > Check failed due to double comparison : MESOS-3552. > > > Diffs > ----- > > src/common/resources.cpp 601388c35a1bff37c58e753d1870d53b8d0af2d1 > src/tests/reservation_tests.cpp 6b7c43c8b5c64618249dbee926383242320c111e > src/v1/resources.cpp dc868903472f8f3a1ddc56092e3f8f81d953ce39 > > Diff: https://reviews.apache.org/r/39056/diff/ > > > Testing > ------- > > Added unit test. > make check successful. > > > Thanks, > > Mandeep Chadha > >
