Lines Matching +full:- +full:ne
30 // Google Mock - a framework for writing C++ mock classes.
40 #include "test/gmock-matchers_test.h"
53 // Tests that Eq() matches a 2-tuple where the first field == the
67 // Tests that Ge() matches a 2-tuple where the first field >= the
82 // Tests that Gt() matches a 2-tuple where the first field > the
97 // Tests that Le() matches a 2-tuple where the first field <= the
112 // Tests that Lt() matches a 2-tuple where the first field < the
127 // Tests that Ne() matches a 2-tuple where the first field != the
130 Matcher<const Tuple2&> m = Ne(); in TEST()
136 // Tests that Ne() describes itself properly.
138 Matcher<const Tuple2&> m = Ne(); in TEST()
259 // Tests that FloatEq() matches a 2-tuple where
272 EXPECT_EQ("are an almost-equal pair", Describe(m)); in TEST()
275 // Tests that NanSensitiveFloatEq() matches a 2-tuple where
291 EXPECT_EQ("are an almost-equal pair", Describe(m)); in TEST()
294 // Tests that DoubleEq() matches a 2-tuple where
307 EXPECT_EQ("are an almost-equal pair", Describe(m)); in TEST()
310 // Tests that NanSensitiveDoubleEq() matches a 2-tuple where
326 EXPECT_EQ("are an almost-equal pair", Describe(m)); in TEST()
329 // Tests that FloatEq() matches a 2-tuple where
342 EXPECT_EQ("are an almost-equal pair", Describe(m)); in TEST()
345 // Tests that NanSensitiveFloatNear() matches a 2-tuple where
362 EXPECT_EQ("are an almost-equal pair", Describe(m)); in TEST()
365 // Tests that FloatEq() matches a 2-tuple where
378 EXPECT_EQ("are an almost-equal pair", Describe(m)); in TEST()
381 // Tests that NanSensitiveDoubleNear() matches a 2-tuple where
398 EXPECT_EQ("are an almost-equal pair", Describe(m)); in TEST()
447 m = AllOf(Gt(0), Ne(1), Ne(2)); in TEST()
453 m = AllOf(Gt(0), Ne(1), Ne(2), Ne(3)); in TEST()
460 m = AllOf(Ge(0), Lt(10), Ne(3), Ne(5), Ne(7)); in TEST()
465 // The following tests for varying number of sub-matchers. Due to the way in TEST()
466 // the sub-matchers are handled it is enough to test every sub-matcher once in TEST()
467 // with sub-matchers using the same matcher type. Varying matcher types are in TEST()
469 AllOfMatches(2, AllOf(Ne(1), Ne(2))); in TEST()
470 AllOfMatches(3, AllOf(Ne(1), Ne(2), Ne(3))); in TEST()
471 AllOfMatches(4, AllOf(Ne(1), Ne(2), Ne(3), Ne(4))); in TEST()
472 AllOfMatches(5, AllOf(Ne(1), Ne(2), Ne(3), Ne(4), Ne(5))); in TEST()
473 AllOfMatches(6, AllOf(Ne(1), Ne(2), Ne(3), Ne(4), Ne(5), Ne(6))); in TEST()
474 AllOfMatches(7, AllOf(Ne(1), Ne(2), Ne(3), Ne(4), Ne(5), Ne(6), Ne(7))); in TEST()
476 AllOf(Ne(1), Ne(2), Ne(3), Ne(4), Ne(5), Ne(6), Ne(7), Ne(8))); in TEST()
478 9, AllOf(Ne(1), Ne(2), Ne(3), Ne(4), Ne(5), Ne(6), Ne(7), Ne(8), Ne(9))); in TEST()
479 AllOfMatches(10, AllOf(Ne(1), Ne(2), Ne(3), Ne(4), Ne(5), Ne(6), Ne(7), Ne(8), in TEST()
480 Ne(9), Ne(10))); in TEST()
482 50, AllOf(Ne(1), Ne(2), Ne(3), Ne(4), Ne(5), Ne(6), Ne(7), Ne(8), Ne(9), in TEST()
483 Ne(10), Ne(11), Ne(12), Ne(13), Ne(14), Ne(15), Ne(16), Ne(17), in TEST()
484 Ne(18), Ne(19), Ne(20), Ne(21), Ne(22), Ne(23), Ne(24), Ne(25), in TEST()
485 Ne(26), Ne(27), Ne(28), Ne(29), Ne(30), Ne(31), Ne(32), Ne(33), in TEST()
486 Ne(34), Ne(35), Ne(36), Ne(37), Ne(38), Ne(39), Ne(40), Ne(41), in TEST()
487 Ne(42), Ne(43), Ne(44), Ne(45), Ne(46), Ne(47), Ne(48), Ne(49), in TEST()
488 Ne(50))); in TEST()
497 m = AllOf(Gt(0), Ne(1), Ne(2)); in TEST()
502 m = AllOf(Gt(0), Ne(1), Ne(2), Ne(3)); in TEST()
508 m = AllOf(Ge(0), Lt(10), Ne(3), Ne(5), Ne(7)); in TEST()
522 m = AllOf(Gt(0), Ne(1), Ne(2)); in TEST()
527 m = AllOf(Gt(0), Ne(1), Ne(2), Ne(3)); in TEST()
532 m = AllOf(Ge(0), Lt(10), Ne(3), Ne(5), Ne(7)); in TEST()
538 m = AllOf(Ne(1), Ne(2), Ne(3), Ne(4), Ne(5), Ne(6), Ne(7), Ne(8), Ne(9), in TEST()
539 Ne(10), Ne(11)); in TEST()
636 EXPECT_TRUE(m.Matches(-1)); in TEST()
642 EXPECT_TRUE(m.Matches(-1)); in TEST()
654 // The following tests for varying number of sub-matchers. Due to the way in TEST()
655 // the sub-matchers are handled it is enough to test every sub-matcher once in TEST()
656 // with sub-matchers using the same matcher type. Varying matcher types are in TEST()
691 Matcher<std::string> ne_red = Ne("red"); in TEST()
705 Matcher<std::string> ne_red = Ne("red"); in TEST()
823 // Returns non-zero if the input is positive. Note that the return
853 EXPECT_FALSE(m.Matches(-1.5)); in TEST()
902 EXPECT_FALSE(ExplainMatchResult(Truly(IsPositive), -1, &listener)); in TEST()
921 // Tests that a Matcher on non-reference type can be used in
1018 // Tests floating-point matchers.
1033 -Floating::ReinterpretBits(zero_bits_ + max_ulps_ - max_ulps_ / 2)), in FloatingPointTest()
1034 further_from_negative_zero_(-Floating::ReinterpretBits( in FloatingPointTest()
1035 zero_bits_ + max_ulps_ + 1 - max_ulps_ / 2)), in FloatingPointTest()
1040 Floating::ReinterpretBits(infinity_bits_ - max_ulps_)), in FloatingPointTest()
1042 Floating::ReinterpretBits(infinity_bits_ - max_ulps_ - 1)), in FloatingPointTest()
1054 EXPECT_TRUE(m1.Matches(-0.0)); in TestMatches()
1069 Matcher<RawType> m4 = matcher_maker(-infinity_); in TestMatches()
1070 EXPECT_TRUE(m4.Matches(-close_to_infinity_)); in TestMatches()
1082 EXPECT_TRUE(m6.Matches(-0.0)); in TestMatches()
1095 // Pre-calculated numbers to be used by the tests.
1125 // Tests floating-point matchers with fixed epsilons.
1137 EXPECT_TRUE(m1.Matches(-0.0)); in TestNearMatches()
1144 EXPECT_TRUE(m2.Matches(-0.0)); in TestNearMatches()
1146 EXPECT_TRUE(m2.Matches(-1.0)); in TestNearMatches()
1148 EXPECT_FALSE(m2.Matches(-ParentType::close_to_one_)); in TestNearMatches()
1155 EXPECT_FALSE(m3.Matches(-ParentType::infinity_)); in TestNearMatches()
1157 Matcher<RawType> m4 = matcher_maker(-ParentType::infinity_, 0.0); in TestNearMatches()
1158 EXPECT_TRUE(m4.Matches(-ParentType::infinity_)); in TestNearMatches()
1159 EXPECT_FALSE(m4.Matches(-ParentType::close_to_infinity_)); in TestNearMatches()
1165 EXPECT_FALSE(m5.Matches(-ParentType::max_)); in TestNearMatches()
1167 Matcher<RawType> m6 = matcher_maker(-ParentType::max_, ParentType::max_); in TestNearMatches()
1169 EXPECT_TRUE(m6.Matches(-ParentType::max_)); in TestNearMatches()
1173 EXPECT_FALSE(m7.Matches(-ParentType::max_)); in TestNearMatches()
1175 Matcher<RawType> m8 = matcher_maker(-ParentType::max_, 0); in TestNearMatches()
1177 EXPECT_TRUE(m8.Matches(-ParentType::max_)); in TestNearMatches()
1179 // The difference between max() and -max() normally overflows to infinity, in TestNearMatches()
1183 EXPECT_TRUE(m8.Matches(-ParentType::max_)); in TestNearMatches()
1188 EXPECT_TRUE(m10.Matches(-0.0)); in TestNearMatches()
1199 x = -1.0f; in TestNearMatches()
1203 x = -1.1f; in TestNearMatches()
1261 // Instantiate FloatingPointTest for testing floats with a user-specified
1374 // Instantiate FloatingPointTest for testing floats with a user-specified
1403 EXPECT_EQ("which is -0.3 from 2", Explain(DoubleNear(2.0, 0.1), 1.7)); in TEST_F()
1406 Explain(DoubleNear(2.1, 1e-10), 2.1 + 1.2e-10); in TEST_F()
1407 // Different C++ implementations may print floating-point numbers in TEST_F()
1409 EXPECT_TRUE(explanation == "which is 1.2e-10 from 2.1" || // GCC in TEST_F()
1410 explanation == "which is 1.2e-010 from 2.1") // MSVC in TEST_F()