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 that pthread_condattr_destroy() 9 * shall destroy a condition variable attributes object. 10 * 11 * Steps: 12 * 1. Initialize a pthread_condattr_t object using pthread_condattr_init() 13 * 2. Destroy the attributes object using pthread_condattr_destroy() 14 * 15 */ 16 17#include <pthread.h> 18#include <stdio.h> 19#include <errno.h> 20#include "posixtest.h" 21 22 23int main() 24{ 25 pthread_condattr_t condattr; 26 int rc; 27 28 /* Initialize a condition variable attributes object */ 29 if((rc=pthread_condattr_init(&condattr)) != 0) 30 { 31 fprintf(stderr,"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 { 38 fprintf(stderr,"Error at pthread_condattr_destroy(), rc=%d\n", rc); 39 printf("Test FAILED\n"); 40 return PTS_FAIL; 41 } 42 43 printf("Test PASSED\n"); 44 return PTS_PASS; 45} 46 47 48