NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: bin/58570: ATF_CHECK_ERRNO semantics and/or documentation is confusing
The following reply was made to PR bin/58570; it has been noted by GNATS.
From: Robert Elz <kre%munnari.OZ.AU@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc:
Subject: Re: bin/58570: ATF_CHECK_ERRNO semantics and/or documentation is confusing
Date: Sun, 11 Aug 2024 01:31:50 +0700
Date: Sat, 10 Aug 2024 16:45:02 +0000 (UTC)
From: Christoph Badura <bad%bsd.de@localhost>
Message-ID: <20240810164502.0E8C81A9244%mollari.NetBSD.org@localhost>
| No, it is trying to say that it checks that if foo() == -1, then (errno ==
| EWOTSIT).
Yes, it tests that, but it also expects that foo() will return -1, and
if it doesn't, the test has also failed.
| I believe the idea is being able that if something fails, errno has the
| expected value.
Yes, but to test that reliably, the something has to actually fail.
If something is coded (in a test) to fail, one might expect the test
writer to know why it should fail, and hence which errno value should
be produced. Testing something that you expect might work (and hence
must at least be plausibly correct) would make it difficult most of the
time to know what might cause the error when it fails, and hence which
errno value to expect.
kre
Home |
Main Index |
Thread Index |
Old Index