source: rtems/testsuites/libtests/tar03/init.c @ 741343ad

4.115
Last change on this file since 741343ad was 741343ad, checked in by Joel Sherrill <joel.sherrill@…>, on 07/19/10 at 13:12:40

2010-07-19 Joel Sherrill <joel.sherrill@…>

  • Makefile.am, configure.ac: Add tar test for error cases.
  • tar03/.cvsignore, tar03/Makefile.am, tar03/init.c, tar03/tar03.doc, tar03/tar03.scn: New files.
  • Property mode set to 100644
File size: 1.4 KB
Line 
1/*
2 *  COPYRIGHT (c) 1989-2010.
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 <tmacros.h>
13#include "test_support.h"
14
15#include <rtems/imfs.h>
16#include <rtems/untar.h>
17#include <rtems/error.h>
18
19void test_tarfs_error(void)
20{
21  int sc;
22
23  puts("Loading tarfs image at non-root - ERROR");
24  sc = rtems_tarfs_load("x",(void *)rtems_task_create, 72);
25  if (sc != -1) {
26    printf ("error: untar failed returned %d\n", sc);
27    rtems_test_exit(1);
28  }
29
30  puts("Loading tarfs image with miniIMFS as root filesystem - ERROR");
31  sc = rtems_tarfs_load("/",(void *)rtems_task_create, 72);
32  if (sc != -1) {
33    printf ("error: untar failed returned %d\n", sc);
34    rtems_test_exit(1);
35  }
36}
37
38rtems_task Init(
39  rtems_task_argument argument
40)
41{
42  puts( "\n\n*** TEST TAR03 ***" );
43
44  test_tarfs_error();
45 
46  puts( "*** END OF TEST TAR03 ***" );
47  rtems_test_exit(0);
48}
49
50/* configuration information */
51
52#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
53#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
54
55#define CONFIGURE_MAXIMUM_TASKS             1
56#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
57
58#define CONFIGURE_USE_MINIIMFS_AS_BASE_FILESYSTEM
59
60#define CONFIGURE_INIT
61#include <rtems/confdefs.h>
62/* end of file */
Note: See TracBrowser for help on using the repository browser.