]> rtime.felk.cvut.cz Git - wvtest.git/commit
wvtest: WVFAIL(cond) returns cond
authorMichal Sojka <sojkam1@fel.cvut.cz>
Sun, 20 Feb 2011 08:31:58 +0000 (09:31 +0100)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Sun, 20 Feb 2011 08:31:58 +0000 (09:31 +0100)
commit24ac173296e95a376532b54e224bbb344772d2f5
treeb24127f26da0b2a67a725b880bd31d4815c8c6be
parent2a78ff461d7166d0f1eb49b4bb04a02a86d433df
wvtest: WVFAIL(cond) returns cond

Previously WVFAIL returned !cond. In my optinion it was confusing
because the statements
  if (cond) print_error();
and
  if (WVFAIL(cond)) print_error();
behaved differently. Now, they are functionally equivalent. In the
implementation we use C extensions typeof() and "statement expression"
to avoid duplication of side-effects caused by cond evaluation.
c/wvtest.h