[PATCH 1/3] login/tst-grantpt: Convert to support framework, more error checking
Florian Weimer
fw@deneb.enyo.de
Thu Aug 13 18:31:05 GMT 2020
* Adhemerval Zanella via Libc-alpha:
> > + xclose (fd);
> > ret = grantpt (fd);
> > err = errno;
> > if (ret != -1 || err != EBADF)
> > {
> > + support_record_failure ();
> > printf ("grantpt(): expected: return = %d, errno = %d\n", -1, EBADF);
> > printf (" got: return = %d, errno = %d\n", ret, err);
> > - return 1;
> > }
> > - return 0;
> > }
>
> Ok (although maybe use CHECK_VERIFY?).
Do you mean TEST_VERIFY? That can't produce a log message. We
probably should have something that logs a failure unconditionally.
>> - unlink (file);
>> + fd = create_temp_file ("tst-grantpt-", NULL);
>> + TEST_VERIFY_EXIT (fd >= 0);
>>
>
> Ok. As a side note, maybe we should add a xcreate_temp_file.
I think we should change the semantics of the existing function
instead.
More information about the Libc-alpha
mailing list