That test is indeed incorrect. It relies on getting EINVAL when passing an invalid (deleted) timer_t to timer_settime. POSIX does not require diagnosing this error (it's a "may fail"). The test invokes undefined behavior.