1 /* 2 * Copyright (c) 2002, Intel Corporation. All rights reserved. 3 * Created by: bing.wei.liu REMOVE-THIS AT intel DOT com 4 * This file is licensed under the GPL license. For the full content 5 * of this license, see the COPYING file at the top level of this 6 * source tree. 7 8 * Test pthread_condattr_destroy() 9 * Upon successful completion, pthread_condattr_destroy() shall 10 * return a value of 0. 11 * 12 * Steps: 13 * 1. Initialize a pthread_condattr_t object using pthread_condattr_init() 14 * 2. Destroy that initialized attribute using pthread_condattr_destroy(). 15 * This should return 0; 16 * 17 */ 18 19 #include <pthread.h> 20 #include <stdio.h> 21 #include <errno.h> 22 #include "posixtest.h" 23 24 int main(void) 25 { 26 pthread_condattr_t condattr; 27 28 /* Initialize a condition variable attributes object */ 29 if (pthread_condattr_init(&condattr) != 0) { 30 fprintf(stderr, 31 "Cannot initialize condition variable attributes object\n"); 32 return PTS_UNRESOLVED; 33 } 34 35 /* Destroy the condition variable attributes object */ 36 if (pthread_condattr_destroy(&condattr) != 0) { 37 printf("Test FAILED\n"); 38 return PTS_FAIL; 39 } else { 40 printf("Test PASSED\n"); 41 return PTS_PASS; 42 } 43 } 44