summaryrefslogtreecommitdiff
path: root/tests/create1.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/create1.c')
-rw-r--r--tests/create1.c26
1 files changed, 18 insertions, 8 deletions
diff --git a/tests/create1.c b/tests/create1.c
index 2741401..192e52d 100644
--- a/tests/create1.c
+++ b/tests/create1.c
@@ -1,9 +1,19 @@
-#include <pthread.h>
-#include <stdio.h>
-#include <windows.h>
+/*
+ * create1.c
+ *
+ * Description:
+ * Create a thread and check that it ran.
+ *
+ * Depends on API functions: None.
+ */
+
+#include "test.h"
+
+static int washere = 0;
void * func(void * arg)
{
+ washere = 1;
return 0;
}
@@ -11,14 +21,14 @@ int
main()
{
pthread_t t;
- if (pthread_create(&t, NULL, func, NULL) != 0)
- {
- return 1;
- }
+
+ assert(pthread_create(&t, NULL, func, NULL) == 0);
/* A dirty hack, but we cannot rely on pthread_join in this
primitive test. */
- Sleep(5000);
+ Sleep(2000);
+
+ assert(washere == 1);
return 0;
}