source: rtems/testsuites/support/src/test_support.c @ 6cc1c29

4.104.115
Last change on this file since 6cc1c29 was 6cc1c29, checked in by Glenn Humphrey <glenn.humphrey@…>, on 12/08/09 at 21:39:21

2009-12-08 Glenn Humphrey <glenn.humphrey@…>

  • support/include/test_support.h, support/include/tmacros.h, support/src/test_support.c: Added support functions to spin for a number of ticks and to spin until the next tick.
  • support/src/spin.c: New file.
  • Property mode set to 100644
File size: 1.3 KB
Line 
1/*
2 *  COPYRIGHT (c) 1989-2009.
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.com/license/LICENSE.
8 *
9 *  $Id$
10 */
11
12#include <fcntl.h>
13#include <tmacros.h>
14#include "test_support.h"
15
16static char  Too_Long_Name[PATH_MAX + 2];
17static char  Longest_Name[PATH_MAX + 1];
18
19const char *Get_Too_Long_Name(void)
20{
21  int i;
22
23  for ( i=0; i <= PATH_MAX; i++ )
24    Too_Long_Name[i] = 'E';
25  Too_Long_Name[i] = '\0';
26  return Too_Long_Name;
27}
28
29const char *Get_Longest_Name(void)
30{
31  int i;
32
33  for ( i=0; i < PATH_MAX-1; i++ )
34    Longest_Name[i] = 'L';
35  Longest_Name[i] = '\0';
36  return Longest_Name;
37}
38
39void Allocate_majority_of_workspace( int smallest )
40{
41  bool                   result;
42  Heap_Information_block info;
43  void                   *temp;
44
45  puts("Allocate_majority_of_workspace: ");
46  result = rtems_workspace_get_information( &info );
47  if ( result != TRUE )
48    perror("==> Error Getting workspace information");
49
50  do {
51    result = rtems_workspace_allocate(
52      info.Free.largest-16,
53      &temp
54    );
55    if ((!result) || (!temp))
56      perror("Unable to allocate from workspace");
57    result = rtems_workspace_get_information( &info );
58  } while ( info.Free.largest >= smallest );
59
60}
Note: See TracBrowser for help on using the repository browser.