summaryrefslogtreecommitdiff
path: root/tests/valid2.c
diff options
context:
space:
mode:
authorrpj <rpj>2003-08-19 07:09:12 +0000
committerrpj <rpj>2003-08-19 07:09:12 +0000
commitbea8978fb8ab1a6d106fc6761b50fb55a98373d4 (patch)
tree9df48d3fe53a27ee86a3379fbc6603ac35b0091b /tests/valid2.c
parentde906ef6d2a5d88df4896d4adab6b1520ad1f4f6 (diff)
Fix accidental corruption of some test cases.snap-2003-08-19
Diffstat (limited to 'tests/valid2.c')
-rw-r--r--tests/valid2.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/tests/valid2.c b/tests/valid2.c
index 84b94a4..ad01b55 100644
--- a/tests/valid2.c
+++ b/tests/valid2.c
@@ -72,20 +72,19 @@
*/
#include "test.h"
-
int
main()
{
- pthread_t t;
-
- assert(sizeof(t) > (4 * sizeof(void *)));
+ pthread_t ptrToNull = NULL;
+ /* This should be bigger than a pthread handle. */
+ char corruptDummy[1000];
- t = (pthread_t) malloc(sizeof(t));
+ memset(corruptDummy, 0x5A, sizeof(corruptDummy));
- assert(t != NULL);
- memset(t, 0x5A, sizeof(t));
- assert(pthread_kill(t, 0) == ESRCH);
+ assert(pthread_kill(NULL, 0) == ESRCH);
+ assert(pthread_kill(ptrToNull, 0) == ESRCH);
+ assert(pthread_kill((pthread_t) corruptDummy, 0) == ESRCH);
return 0;
}