<div dir="ltr">Hi,<br><br><div>When we expect a failure in test, we're using FAIL_TEST at the moment.<br></div><div>The FAIL_TEST will pass on any failure in the test -- but we want the test<br>pass only when it fails on a particular line. Consider this code:<br>
<br></div><div>1   FAIL_TEST<br>2   {<br></div><div>3        struct wl_display *d = wl_display_connect();<br></div><div>4        assert(d);<br>5<br></div><div>6        expect_fail_in_this_function(d);<br>7    }<br><br></div>
<div>We want the test pass if and only if the failure is raised in expect_fail_in_this_function() on line 6. But if the wl_display_connect() on line 3 fails, then the test passes as well, which is wrong.<br></div><div>The conclusion is: the FAIL_TESTs should be used only when the test can fail only in one location. Basically, only for sanity testing. The rest of the tests can be rewritten to regular TESTs. The next few patches are doing this work.<br>
<br></div><div>Regards,<br></div><div>Marek Chalupa<br></div></div>