source: rtems/testsuites/support/src/test_support.c @ b9073c37

4.104.114.95
Last change on this file since b9073c37 was ccc4203, checked in by Jennifer Averett <Jennifer.Averett@…>, on 02/04/08 at 19:40:33

2008-02-04 Jennifer Averett <jennifer.averett@…>

  • support/include/test_support.h, support/src/test_support.c: New files.
  • Property mode set to 100644
File size: 1.5 KB
Line 
1/*  long_name
2 *
3 *  This set of routines is create names that are the maximum length or one over
4 *  the maximum length.
5 *
6 *  Output parameters:  constant character string of max length or max length + 1
7 *
8 *  COPYRIGHT (c) 1989-2008.
9 *  On-Line Applications Research Corporation (OAR).
10 *
11 *  The license and distribution terms for this file may be
12 *  found in the file LICENSE in this distribution or at
13 *  http://www.rtems.com/license/LICENSE.
14 *
15 *  $Id$
16 */
17
18#include <fcntl.h>
19#include <tmacros.h>
20#include "test_support.h"
21
22static char  Too_Long_Name[PATH_MAX + 2];
23static char  Longest_Name[PATH_MAX + 1];
24
25const char *Get_Too_Long_Name()
26{
27  int i;
28
29  for ( i=0; i <= PATH_MAX; i++ )
30    Too_Long_Name[i] = 'E';
31  Too_Long_Name[i] = '\0';
32  return Too_Long_Name;
33}
34
35const char *Get_Longest_Name()
36{
37  int i;
38
39  for ( i=0; i < PATH_MAX; i++ )
40    Longest_Name[i] = 'L';
41  Longest_Name[i] = '\0';
42  return Longest_Name;
43}
44
45void Allocate_majority_of_workspace( int smallest )
46{
47  boolean                result;
48  Heap_Information_block info;
49  void                   *temp;
50
51  puts("Allocate_majority_of_workspace: ");
52  result = rtems_workspace_get_information( &info );
53  if ( result != TRUE )
54    perror("==> Error Getting workspace information");
55
56  do {
57    result = rtems_workspace_allocate(
58      info.Free.largest-16,
59      &temp
60    );
61    if ((!result) || (!temp))
62      perror("Unable to allocate from workspace");
63    result = rtems_workspace_get_information( &info );
64  } while ( info.Free.largest >= smallest );
65
66}
Note: See TracBrowser for help on using the repository browser.