summaryrefslogtreecommitdiff
path: root/tests/self1.c
diff options
context:
space:
mode:
authorrpj <rpj>1999-02-22 02:54:12 +0000
committerrpj <rpj>1999-02-22 02:54:12 +0000
commit2ef097640758653a0e9d63e90a4aac329cd86368 (patch)
tree71751f699b0aedba3227446ac228d30f2a127173 /tests/self1.c
parent943bc9bb02212649a83ec32152299d50d34226e6 (diff)
1999-02-23 Ross Johnson <rpj@ise.canberra.edu.au>
* Makefile: Some refinement. * *.c: More exhaustive checking through assertions; clean up; add some more tests.
Diffstat (limited to 'tests/self1.c')
-rw-r--r--tests/self1.c23
1 files changed, 14 insertions, 9 deletions
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 <pthread.h>
+#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;
}