source: rtems/testsuites/psxtmtests/psxtmcond01/init.c @ e58e29fd

5
Last change on this file since e58e29fd was e58e29fd, checked in by Sebastian Huber <sebastian.huber@…>, on 11/24/17 at 06:58:55

Remove coverhd.h

This header file contained timing overhead values which are hard to
maintain.

Update #3254.

  • Property mode set to 100644
File size: 1.8 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 <tmacros.h>
15#include <timesys.h>
16#include "test_support.h"
17#include <pthread.h>
18#include <sched.h>
19#include <rtems/btimer.h>
20
21const char rtems_test_name[] = "PSXTMCOND 01";
22
23/* forward declarations to avoid warnings */
24void *POSIX_Init(void *argument);
25void benchmark_create_cond_var(void);
26void benchmark_destroy_cond_var(void);
27
28pthread_cond_t mycondvar;
29
30void benchmark_create_cond_var(void)
31{
32  uint32_t end_time;
33  int      status;
34
35  benchmark_timer_initialize();
36  status = pthread_cond_init(&mycondvar, NULL);
37  end_time = benchmark_timer_read();
38  rtems_test_assert( status == 0 );
39
40  put_time(
41    "pthread_cond_init: only case",
42    end_time,
43    1,
44    0,
45    0
46  );
47}
48
49void benchmark_destroy_cond_var(void)
50{
51  uint32_t end_time;
52  int      status;
53
54  benchmark_timer_initialize();
55  status = pthread_cond_destroy(&mycondvar);
56  end_time = benchmark_timer_read();
57  rtems_test_assert( status == 0 );
58
59  put_time(
60    "pthread_cond_destroy: only case",
61    end_time,
62    1,
63    0,
64    0
65  );
66}
67
68void *POSIX_Init(
69  void *argument
70)
71{
72  TEST_BEGIN();
73
74  benchmark_create_cond_var();
75  benchmark_destroy_cond_var();
76
77  TEST_END();
78  rtems_test_exit(0);
79}
80
81/* configuration information */
82
83#define CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER
84#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
85
86/* configure an instance of the condition variable created and destroyed */
87
88#define CONFIGURE_MAXIMUM_POSIX_THREADS     1
89#define CONFIGURE_POSIX_INIT_THREAD_TABLE
90
91#define CONFIGURE_INIT
92
93#include <rtems/confdefs.h>
94/* end of file */
Note: See TracBrowser for help on using the repository browser.