1 | /* |
---|
2 | * COPYRIGHT (c) 1989-2012. |
---|
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.org/license/LICENSE. |
---|
8 | */ |
---|
9 | |
---|
10 | #ifdef HAVE_CONFIG_H |
---|
11 | #include "config.h" |
---|
12 | #endif |
---|
13 | |
---|
14 | #include <tmacros.h> |
---|
15 | #include "test_support.h" |
---|
16 | |
---|
17 | #include <rtems/imfs.h> |
---|
18 | #include <rtems/untar.h> |
---|
19 | #include <rtems/error.h> |
---|
20 | |
---|
21 | const char rtems_test_name[] = "TAR 3"; |
---|
22 | |
---|
23 | /* forward declarations to avoid warnings */ |
---|
24 | rtems_task Init(rtems_task_argument argument); |
---|
25 | void test_tarfs_error(void); |
---|
26 | |
---|
27 | void test_tarfs_error(void) |
---|
28 | { |
---|
29 | int sc; |
---|
30 | |
---|
31 | puts("Loading tarfs image at non-root - ERROR"); |
---|
32 | sc = rtems_tarfs_load("x",(void *)rtems_task_create, 72); |
---|
33 | if (sc != -1) { |
---|
34 | printf ("error: untar failed returned %d\n", sc); |
---|
35 | rtems_test_exit(1); |
---|
36 | } |
---|
37 | |
---|
38 | puts("Loading tarfs image with miniIMFS as root filesystem - ERROR"); |
---|
39 | sc = rtems_tarfs_load("/",(void *)rtems_task_create, 72); |
---|
40 | if (sc != -1) { |
---|
41 | printf ("error: untar failed returned %d\n", sc); |
---|
42 | rtems_test_exit(1); |
---|
43 | } |
---|
44 | } |
---|
45 | |
---|
46 | rtems_task Init( |
---|
47 | rtems_task_argument argument |
---|
48 | ) |
---|
49 | { |
---|
50 | TEST_BEGIN(); |
---|
51 | |
---|
52 | test_tarfs_error(); |
---|
53 | |
---|
54 | TEST_END(); |
---|
55 | rtems_test_exit(0); |
---|
56 | } |
---|
57 | |
---|
58 | /* configuration information */ |
---|
59 | |
---|
60 | #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER |
---|
61 | #define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER |
---|
62 | |
---|
63 | #define CONFIGURE_MAXIMUM_TASKS 1 |
---|
64 | #define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION |
---|
65 | |
---|
66 | #define CONFIGURE_RTEMS_INIT_TASKS_TABLE |
---|
67 | |
---|
68 | #define CONFIGURE_USE_MINIIMFS_AS_BASE_FILESYSTEM |
---|
69 | |
---|
70 | #define CONFIGURE_INIT |
---|
71 | #include <rtems/confdefs.h> |
---|
72 | /* end of file */ |
---|