You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note the extreme similarities between the 2 tests, the only difference being the second test uses a pointer instead of the int used in the first test.
Both tests (umock_test_code_under_test1 and umock_test_code_under_test2) are poorly written and have a STRICT_EXPECTED_CALL after the code under test.
This is the expected behavior for umock_test_code_under_test1 : after code_under_test1 is called, there's going to be an actual call (sum(3, 5);) that is "extra" (actual). After STRICT_EXPECTED_CALL(sum(3, 5)); there is another "extra" (expected) call. They should not be matched because the expected call was not existing at the time when the actual call happened.
However, umock_c will happily match them and in the case of umock_test_code_under_test1 the test will happily pass.
umock_test_code_under_test2 produces the expected behavior (that is, the test will fail). However, even when the test fails (as expected) the message on the screen doesn't really help with understanding "why" it failed, because it looks very "should pass":
"well - if the second argument is ignored, how come the calls didn't match?".
Overall the expectation is that both tests should fail. And when they fail - the message on the screen should indicate better "why they failed".
The text was updated successfully, but these errors were encountered:
The following sort of self-contained code has admirable behavior at runtime:
Note the extreme similarities between the 2 tests, the only difference being the second test uses a pointer instead of the int used in the first test.
Both tests (
umock_test_code_under_test1
andumock_test_code_under_test2
) are poorly written and have aSTRICT_EXPECTED_CALL
after the code under test.This is the expected behavior for
umock_test_code_under_test1
: aftercode_under_test1
is called, there's going to be an actual call (sum(3, 5);
) that is "extra" (actual). AfterSTRICT_EXPECTED_CALL(sum(3, 5));
there is another "extra" (expected) call. They should not be matched because the expected call was not existing at the time when the actual call happened.However, umock_c will happily match them and in the case of
umock_test_code_under_test1
the test will happily pass.umock_test_code_under_test2
produces the expected behavior (that is, the test will fail). However, even when the test fails (as expected) the message on the screen doesn't really help with understanding "why" it failed, because it looks very "should pass":"well - if the second argument is ignored, how come the calls didn't match?".
Overall the expectation is that both tests should fail. And when they fail - the message on the screen should indicate better "why they failed".
The text was updated successfully, but these errors were encountered: