From 2ef097640758653a0e9d63e90a4aac329cd86368 Mon Sep 17 00:00:00 2001 From: rpj Date: Mon, 22 Feb 1999 02:54:12 +0000 Subject: 1999-02-23 Ross Johnson * Makefile: Some refinement. * *.c: More exhaustive checking through assertions; clean up; add some more tests. --- tests/self1.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'tests/self1.c') diff --git a/tests/self1.c b/tests/self1.c index 0addfc8..d460818 100644 --- a/tests/self1.c +++ b/tests/self1.c @@ -1,21 +1,26 @@ /* + * self1.c + * * Test for pthread_self(). * - * Depends on API functions: None. + * Depends on API functions: + * pthread_self() + * + * Implicitly depends on: + * pthread_getspecific() + * pthread_setspecific() */ -#include +#include "test.h" int main(int argc, char * argv[]) { - pthread_t id; - - /* We can't do anything with this, though, because it is not - safe to assume anything about the internal structure of - a `pthread_t'. */ - - id = pthread_self(); + /* + * This should always succeed unless the system has no + * resources (memory) left. + */ + assert(pthread_self() != NULL); return 0; } -- cgit v1.2.3