summaryrefslogtreecommitdiffstats
path: root/testsuites
diff options
context:
space:
mode:
authorJennifer Averett <Jennifer.Averett@OARcorp.com>2008-02-04 19:40:33 +0000
committerJennifer Averett <Jennifer.Averett@OARcorp.com>2008-02-04 19:40:33 +0000
commitccc420356383e6cc5114ee24ddae769bb05dcfd9 (patch)
tree741ed557fe5a7ed0a2b81e691681a0b31b8b0351 /testsuites
parent2008-02-04 Jennifer Averett <jennifer.averett@OARcorp.com> (diff)
downloadrtems-ccc420356383e6cc5114ee24ddae769bb05dcfd9.tar.bz2
2008-02-04 Jennifer Averett <jennifer.averett@OARcorp.com>
* support/include/test_support.h, support/src/test_support.c: New files.
Diffstat (limited to 'testsuites')
-rw-r--r--testsuites/ChangeLog4
-rw-r--r--testsuites/support/include/test_support.h22
-rw-r--r--testsuites/support/src/test_support.c66
3 files changed, 92 insertions, 0 deletions
diff --git a/testsuites/ChangeLog b/testsuites/ChangeLog
index 7c181d3b36..209df48e40 100644
--- a/testsuites/ChangeLog
+++ b/testsuites/ChangeLog
@@ -1,3 +1,7 @@
+2008-02-04 Jennifer Averett <jennifer.averett@OARcorp.com>
+
+ * support/include/test_support.h, support/src/test_support.c: New files.
+
2008-01-31 Joel Sherrill <joel.sherrill@OARcorp.com>
* support/include/tmacros.h: Change TEST_INIT to CONFIGURE_INIT. Make
diff --git a/testsuites/support/include/test_support.h b/testsuites/support/include/test_support.h
new file mode 100644
index 0000000000..ba0acb0178
--- /dev/null
+++ b/testsuites/support/include/test_support.h
@@ -0,0 +1,22 @@
+/*
+ * Support routines for test code.
+ *
+ * $Id$
+ */
+
+#ifndef __TEST_SUPPORT_h
+#define __TEST_SUPPORT_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void Allocate_majority_of_workspace( int smallest );
+const char *Get_Too_Long_Name();
+const char *Get_Longest_Name();
+
+#ifdef __cplusplus
+};
+#endif
+
+#endif
diff --git a/testsuites/support/src/test_support.c b/testsuites/support/src/test_support.c
new file mode 100644
index 0000000000..6f5cbaec24
--- /dev/null
+++ b/testsuites/support/src/test_support.c
@@ -0,0 +1,66 @@
+/* long_name
+ *
+ * This set of routines is create names that are the maximum length or one over
+ * the maximum length.
+ *
+ * Output parameters: constant character string of max length or max length + 1
+ *
+ * COPYRIGHT (c) 1989-2008.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ *
+ * $Id$
+ */
+
+#include <fcntl.h>
+#include <tmacros.h>
+#include "test_support.h"
+
+static char Too_Long_Name[PATH_MAX + 2];
+static char Longest_Name[PATH_MAX + 1];
+
+const char *Get_Too_Long_Name()
+{
+ int i;
+
+ for ( i=0; i <= PATH_MAX; i++ )
+ Too_Long_Name[i] = 'E';
+ Too_Long_Name[i] = '\0';
+ return Too_Long_Name;
+}
+
+const char *Get_Longest_Name()
+{
+ int i;
+
+ for ( i=0; i < PATH_MAX; i++ )
+ Longest_Name[i] = 'L';
+ Longest_Name[i] = '\0';
+ return Longest_Name;
+}
+
+void Allocate_majority_of_workspace( int smallest )
+{
+ boolean result;
+ Heap_Information_block info;
+ void *temp;
+
+ puts("Allocate_majority_of_workspace: ");
+ result = rtems_workspace_get_information( &info );
+ if ( result != TRUE )
+ perror("==> Error Getting workspace information");
+
+ do {
+ result = rtems_workspace_allocate(
+ info.Free.largest-16,
+ &temp
+ );
+ if ((!result) || (!temp))
+ perror("Unable to allocate from workspace");
+ result = rtems_workspace_get_information( &info );
+ } while ( info.Free.largest >= smallest );
+
+}