Test init reservation failure
This commit is contained in:
20
tests/err_init_reservation_fatal.c
Normal file
20
tests/err_init_reservation_fatal.c
Normal file
@@ -0,0 +1,20 @@
|
||||
#include "akerror.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
/*
|
||||
* This executable links to akerror_init_failure, a test-only library target
|
||||
* with no status-range slots. The first reservation in akerr_init() must be
|
||||
* terminal: continuing would leave every library status unowned and make all
|
||||
* subsequent name registrations invalid.
|
||||
*
|
||||
* CTest marks this WILL_FAIL. Reaching the message and returning zero means
|
||||
* initialization swallowed its own reservation failure.
|
||||
*/
|
||||
int main(void)
|
||||
{
|
||||
akerr_init();
|
||||
|
||||
fprintf(stderr, "err_init_reservation_fatal: akerr_init did not terminate\n");
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user