diff mbox series

[07/12] posix/pthread_key_create/2-1: Remove invalid part of test

Message ID 20211119074602.857595-8-lkml@jv-coder.de
State Accepted
Headers show
Series Fix or suppress compiler warnings in posix/conformance/interfaces | expand

Commit Message

Joerg Vehlow Nov. 19, 2021, 7:45 a.m. UTC
From: Joerg Vehlow <joerg.vehlow@aox-tech.de>

The first step accroding to the test description is: "Create a key", but the
code was "get the value for an unitialized key". This was undefined behavior.

Signed-off-by: Joerg Vehlow <joerg.vehlow@aox-tech.de>
---
 .../conformance/interfaces/pthread_key_create/2-1.c        | 7 -------
 1 file changed, 7 deletions(-)

Comments

Cyril Hrubis Nov. 19, 2021, 3:32 p.m. UTC | #1
Hi!
Applied, thanks.
diff mbox series

Patch

diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_key_create/2-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_key_create/2-1.c
index f150f3443..51c89f376 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_key_create/2-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_key_create/2-1.c
@@ -28,13 +28,6 @@  int main(void)
 	pthread_key_t key;
 	void *rc;
 
-	/* Verify that the value associated with "key" in a new thread is NULL */
-	rc = pthread_getspecific(key);
-	if (rc != NULL) {
-		printf("Test FAILED\n");
-		return PTS_FAIL;
-	}
-
 	if (pthread_key_create(&key, NULL) != 0) {
 		printf("Error: pthread_key_create() failed\n");
 		return PTS_UNRESOLVED;