Open
Description
Does the feature exist in the most recent commit?
NOPE
Why do we need this feature?
Checking that two doubles are NOT equal is more difficult than it is to check they are equal per S.O.
One approach is to bring in gmock and link to it if you want to check a double value is not equal:
#include <gmock/gmock.h>
#include <gtest/gtest.h>
EXPECT_DOUBLE_EQ(another_value, 3.14);
EXPECT_THAT(another_value, testing::Not(testing::DoubleEq(3.14)));
Describe the proposal.
Here is what I would prefer for the API, which use "NE" like EXPECT_NE
EXPECT_DOUBLE_EQ(another_value, 3.14);
EXPECT_DOUBLE_NE(another_value, 3.14);
Same with
- EXPECT_FLOAT_NE
- ASSERT_DOUBLE_NE
- ASSERT_FLOAT_NE
Is the feature specific to an operating system, compiler, or build system version?
It could be implemented on any OS.
Activity
jordans6 commentedon Sep 24, 2024
Hi! If this feature hasn't been taken by anyone yet I'd like to work on it!
daniel10015 commentedon Nov 24, 2024
Hi! Looks like a PR hasn't been created yet. @jordans6 are you still working on this? If not, I would like to work on this feature.
oToToT commentedon Mar 17, 2025
Any updates on this?
daniel10015 commentedon Mar 17, 2025
@oToToT I made the changes to my fork and created a PR back in November 2024, however no one has looked at it. For convenience, here is the fork https://github.com/daniel10015/googletest/tree/main and the PR #4670
oToToT commentedon Mar 17, 2025
Hi @derekmauro
Sorry for directly pinging you here. I'm not the issue owner nor the PR submitter. Further, I'm not sure if you're the right person to ask.
Nonetheless, I think having a counterpart to
{EXPECT, ASSERT}_{FLOAT, DOUBLE}_EQ
, i.e.,{EXPECT, ASSERT}_{FLOAT, DOUBLE}_NE
, can be helpful and convenient for people using this library. I also find the need for them in my project, so I want to know if there is any more progress that can be done here.I would like to know if it is possible for you to help review this PR or find the right person to help with this. Please let me (us) know if there is anything wrong about this contribution or the way it was contributed.
Thanks in advance.