source: rtems/testsuites/psxtmtests/psxtmcond02/init.c @ de549c3

4.115
Last change on this file since de549c3 was de549c3, checked in by Joel Sherrill <joel.sherrill@…>, on 09/03/14 at 15:16:43

Misc psxtmtests: Use uint32_t not long for end_time to match printf() format expectations

  • Property mode set to 100644
File size: 1.4 KB
Line 
1/*
2 *  COPYRIGHT (c) 1989-2013.
3 *  On-Line Applications Research Corporation (OAR).
4 *
5 *  The license and distribution terms for this file may be
6 *  found in the file LICENSE in this distribution or at
7 *  http://www.rtems.org/license/LICENSE.
8 */
9
10#ifdef HAVE_CONFIG_H
11#include "config.h"
12#endif
13
14#include <timesys.h>
15#include <pthread.h>
16#include <rtems/timerdrv.h>
17#include "test_support.h"
18
19const char rtems_test_name[] = "PSXTMCOND 02";
20
21/* forward declarations to avoid warnings */
22void *POSIX_Init(void *argument);
23void benchmark_signal(void);
24
25pthread_cond_t CondID;
26
27void benchmark_signal(void)
28{
29  uint32_t end_time;
30  int      status;
31
32  benchmark_timer_initialize();
33
34  status = pthread_cond_signal(&CondID);
35
36  end_time = benchmark_timer_read();
37  rtems_test_assert( status == 0 );
38
39  put_time(
40    "pthread_cond_signal: no threads waiting",
41    end_time,
42    1,        /* Only executed once */
43    0,
44    0
45  );
46
47}
48
49void *POSIX_Init(
50  void *argument
51)
52
53  TEST_BEGIN();
54
55  pthread_cond_init(&CondID, NULL);
56
57  benchmark_signal();
58
59  TEST_END();
60  rtems_test_exit(0);
61}
62
63/* configuration information */
64
65#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
66#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
67
68#define CONFIGURE_MAXIMUM_POSIX_THREADS     1
69#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 2
70#define CONFIGURE_POSIX_INIT_THREAD_TABLE
71
72#define CONFIGURE_INIT
73
74#include <rtems/confdefs.h>
75/* end of file */
Note: See TracBrowser for help on using the repository browser.