1 | /* |
---|
2 | * Exercise Printk |
---|
3 | * |
---|
4 | * COPYRIGHT (c) 1989-2009. |
---|
5 | * On-Line Applications Research Corporation (OAR). |
---|
6 | * |
---|
7 | * The license and distribution terms for this file may be |
---|
8 | * found in the file LICENSE in this distribution or at |
---|
9 | * http://www.rtems.com/license/LICENSE. |
---|
10 | * |
---|
11 | * $Id$ |
---|
12 | */ |
---|
13 | |
---|
14 | #include <tmacros.h> |
---|
15 | |
---|
16 | rtems_task Init( |
---|
17 | rtems_task_argument argument |
---|
18 | ) |
---|
19 | { |
---|
20 | printk( "\n\n*** TEST PRINTK ***\n" ); |
---|
21 | |
---|
22 | putk( "This is a test of putk\n" ); |
---|
23 | |
---|
24 | printk( "bad format -- %%q in parentheses (%q)\n" ); |
---|
25 | |
---|
26 | printk( "bad format -- %%lq in parentheses (%lq)\n", 0x1234 ); |
---|
27 | |
---|
28 | printk( "%%O octal upper case 16 -- %O\n", 16 ); |
---|
29 | printk( "%%o octal lower case of 16 -- %O\n", 16 ); |
---|
30 | printk( "%%I of 16 -- %I\n", 16 ); |
---|
31 | printk( "%%i of 16 -- %i\n", 16 ); |
---|
32 | printk( "%%D of 16 -- %D\n", 16 ); |
---|
33 | printk( "%%d of 16 -- %d\n", 16 ); |
---|
34 | printk( "%%-3d of 16 -- %-3d\n", 16 ); |
---|
35 | printk( "%%U of 16 -- %U\n", 16 ); |
---|
36 | printk( "%%u of 16 -- %u\n", 16 ); |
---|
37 | printk( "%%X of 16 -- %X\n", 16 ); |
---|
38 | printk( "%%x of 16 -- %x\n", 16 ); |
---|
39 | printk( "%%p of 0x1234 -- %p\n", (void *)0x1234 ); |
---|
40 | |
---|
41 | /* negative numbers */ |
---|
42 | printk( "%%d of -16 -- %d\n", -16 ); |
---|
43 | printk( "%%d of -16 -- %-3d\n", -16 ); |
---|
44 | printk( "%%u of -16 -- %u\n", -16 ); |
---|
45 | |
---|
46 | /* string formats */ |
---|
47 | printk( "%%s of Mary Had a Little Lamb -- (%s)\n", |
---|
48 | "Mary Had a Little Lamb" ); |
---|
49 | printk( "%%s of NULL -- (%s)\n", NULL ); |
---|
50 | printk( "%%12s of joel -- (%20s)\n", "joel" ); |
---|
51 | printk( "%%4s of joel -- (%4s)\n", "joel" ); |
---|
52 | printk( "%%-12s of joel -- (%-20s)\n", "joel" ); |
---|
53 | printk( "%%-4s of joel -- (%-4s)\n", "joel" ); |
---|
54 | printk( "%%c of X -- (%c)\n", 'X' ); |
---|
55 | |
---|
56 | |
---|
57 | printk( "*** END OF TEST PRINTK ***\n" ); |
---|
58 | rtems_test_exit( 0 ); |
---|
59 | } |
---|
60 | |
---|
61 | /* configuration information */ |
---|
62 | |
---|
63 | #define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER |
---|
64 | |
---|
65 | #define CONFIGURE_MAXIMUM_TASKS 1 |
---|
66 | |
---|
67 | #define CONFIGURE_RTEMS_INIT_TASKS_TABLE |
---|
68 | |
---|
69 | #define CONFIGURE_INIT |
---|
70 | |
---|
71 | #include <rtems/confdefs.h> |
---|
72 | |
---|