]> rtime.felk.cvut.cz Git - frescor/frsh-forb.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)
commit08b4d459286baffd4b1e7be79cfd2a1881e06fd5
tree37812ed149cc1626507ffe2f1c1142d9930762f4
parent7e7b0cac4783f176181b361bbc5866092f23f44e
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.
src/wvtest/c/wvtest.h