This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] Add tests for atexit/on_exit firing order


On Mon, Jul 10, 2017 at 8:18 AM, Joseph Myers <joseph@codesourcery.com> wrote:

>> This patch adds such test. I am using on_exit here because it
>> conveniently allows passing an argument.
>
> I'd think that it would make sense to test all of atexit, on_exit,
> at_quick_exit this way.

I could be missing something, but I don't see an easy way to test
atexit and at_quick_exit the same way due to them not taking an
argument.

To test atexit, I would have to implement separate fn1 .. fn8 and
hard-code expected call sequence into each of them, wouldn't I?

That would make for a more verbose and more difficult to modify test,
and given that all 3 functions currently share implementation, that
seems like an overkill. Of course if later the implementation is
un-shared, it would be nice to have a test case for each. But it seems
unlikely to ever happen.

Thanks,
-- 
Paul Pluzhnikov


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]