Skip to content

Commit

Permalink
Merge branch 'develop' into feature/travisci-libcxx-test
Browse files Browse the repository at this point in the history
  • Loading branch information
srz-zumix committed Oct 6, 2018
2 parents 97893bc + e57c655 commit 76e5df6
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions test/matcher_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,51 @@ IUTEST(MatcherFailure, NanSensitiveLongDoubleEq)

#endif

IUTEST(MatcherFailure, FloatNear)
{
CHECK_FAILURE( IUTEST_ASSERT_THAT(f0, FloatNear(1.0f, f0)), "Near: " );
CHECK_FAILURE( IUTEST_ASSERT_THAT(0/f0, FloatNear(0/f0, 1.0f)), "Near: " );
CHECK_FAILURE( IUTEST_ASSERT_THAT(0/f0, FloatingPointNear(f0, 1.0f)), "Near: " );
}

IUTEST(MatcherFailure, DoubleNear)
{
CHECK_FAILURE( IUTEST_ASSERT_THAT(d0, DoubleNear(1.0, d0)), "Near: " );
CHECK_FAILURE( IUTEST_ASSERT_THAT(0/d0, DoubleNear(0/d0, 1.0)), "Near: " );
CHECK_FAILURE( IUTEST_ASSERT_THAT(0/d0, FloatingPointNear(0/d0, 1.0)), "Near: " );
}

#if IUTEST_HAS_LONG_DOUBLE

IUTEST(MatcherFailure, LongDoubleNear)
{
CHECK_FAILURE( IUTEST_ASSERT_THAT(ld0, LongDoubleNear(1.0, ld0)), "Near: " );
CHECK_FAILURE( IUTEST_ASSERT_THAT(0/ld0, LongDoubleNear(0/ld0, 1.0)), "Near: " );
}

#endif

IUTEST(MatcherFailure, NanSensitiveFloatNear)
{
CHECK_FAILURE( IUTEST_ASSERT_THAT(f0, NanSensitiveFloatNear(1.0f, f0)), "Near: " );
CHECK_FAILURE( IUTEST_ASSERT_THAT(f0, NanSensitiveFloatingPointNear(1.0f, f0)), "Near: " );
}

IUTEST(MatcherFailure, NanSensitiveDoubleNear)
{
CHECK_FAILURE( IUTEST_ASSERT_THAT(d0, NanSensitiveDoubleNear(1.0, d0)), "Near: " );
CHECK_FAILURE( IUTEST_ASSERT_THAT(d0, NanSensitiveFloatingPointNear(1.0, d0)), "Near: " );
}

#if IUTEST_HAS_LONG_DOUBLE

IUTEST(MatcherFailure, NanSensitiveLongDoubleNear)
{
CHECK_FAILURE( IUTEST_ASSERT_THAT(ld0, NanSensitiveLongDoubleNear(1.0, ld0)), "Near: " );
}

#endif

IUTEST(MatcherFailure, StrEq)
{
CHECK_FAILURE( IUTEST_ASSERT_THAT("hoge", StrEq("Hoge")), "StrEq: Hoge");
Expand Down Expand Up @@ -530,6 +575,7 @@ IUTEST(MatcherFailure, EndsWith)
{
CHECK_FAILURE( IUTEST_ASSERT_THAT("hoge", EndsWith("Ge")) , "EndsWith: Ge" );
CHECK_FAILURE( IUTEST_ASSERT_THAT("hoge", EndsWith("gee")), "EndsWith: gee" );
CHECK_FAILURE( IUTEST_ASSERT_THAT("hoge", EndsWith("TooLongLongEnds")) , "EndsWith: TooLongLongEnds" );
}

IUTEST(MatcherFailure, Equals)
Expand Down

0 comments on commit 76e5df6

Please sign in to comment.