skymizer/SkyPat

Message printed when equality test failed is confusing in some case.

telgniw opened this issue · 0 comments

Description

When the compared variable is changed within the equality test expression, such as EXPECT_EQ, the variable is changed for the second time when SkyPat is showing error message.

Code

In this case, the left-hand side is 11.

PAT_F(IntegerTest, eq_test)
{
  int a = 10;
  EXPECT_EQ(++a, 12);
}

Result

But the error shows 12 instead of 11.

[----------] 1 test from IntegerTest.
[ RUN      ] IntegerTest.eq_test
[  FAILED  ] 
IntegerTest.cpp:5: error: failed to expect
Value of: (++a == 12)
  Actual:   12
  Expected: 12

Expectation

  Actual:   11
  Expected: 12