source: rtems/testsuites/libtests/dl08/init.c @ be50969

5
Last change on this file since be50969 was a7c6176, checked in by Chris Johns <chrisj@…>, on 12/17/18 at 06:48:30

libtest/dl08: Add a test for archives.

  • Create 2 archives.
  • Load 1 object file which loads 6 object files from the libraries.

Updates #3686

  • Property mode set to 100644
File size: 1.8 KB
Line 
1/*
2 * Copyright (c) 2018 Chris Johns <chrisj@rtems.org>.  All rights reserved.
3 *
4 * The license and distribution terms for this file may be
5 * found in the file LICENSE in this distribution or at
6 * http://www.rtems.org/license/LICENSE.
7 */
8
9#ifdef HAVE_CONFIG_H
10  #include "config.h"
11#endif
12
13#include "tmacros.h"
14
15#include <errno.h>
16#include <string.h>
17#include <stdint.h>
18#include <unistd.h>
19
20#include <rtems/rtl/rtl.h>
21#include <rtems/untar.h>
22
23#include "dl-load.h"
24
25const char rtems_test_name[] = "libdl (RTL) 8";
26
27/* forward declarations to avoid warnings */
28static rtems_task Init(rtems_task_argument argument);
29
30#include "dl08-tar.h"
31
32#define TARFILE_START dl08_tar
33#define TARFILE_SIZE  dl08_tar_size
34
35static int test(void)
36{
37  int ret;
38  ret = dl_load_test();
39  if (ret)
40    rtems_test_exit(ret);
41  return 0;
42}
43
44static void Init(rtems_task_argument arg)
45{
46  int te;
47  int i;
48
49  TEST_BEGIN();
50
51  te = Untar_FromMemory((void *)TARFILE_START, (size_t)TARFILE_SIZE);
52  if (te != 0)
53  {
54    printf("untar failed: %d\n", te);
55    rtems_test_exit(1);
56    exit (1);
57  }
58
59  for (i = 0; i < 100; ++i)
60  {
61    printf ("--------------------------------------------------\n");
62    printf (" Run: %d\n", i);
63    test();
64  }
65
66  TEST_END();
67
68  rtems_test_exit(0);
69}
70
71#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
72#define CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER
73
74#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 4
75
76#define CONFIGURE_MAXIMUM_TASKS 1
77
78#define CONFIGURE_MAXIMUM_SEMAPHORES 1
79
80#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION
81
82#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
83
84#define CONFIGURE_INIT_TASK_STACK_SIZE (8U * 1024U)
85
86#define CONFIGURE_INIT_TASK_ATTRIBUTES   (RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT)
87
88#define CONFIGURE_INIT
89
90#include <rtems/confdefs.h>
Note: See TracBrowser for help on using the repository browser.