Changeset cb01e1e in mainline for kernel/test/print/print1.c
- Timestamp:
- 2009-04-04T00:26:27Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a85aebd
- Parents:
- 171f9a1
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/test/print/print1.c
r171f9a1 rcb01e1e 30 30 #include <test.h> 31 31 32 char *test_print1( bool quiet)32 char *test_print1(void) 33 33 { 34 if (!quiet) { 35 printf("Testing printf(\"%%*.*s\", 5, 3, \"text\"):\n"); 36 printf("Expected output: \" tex\"\n"); 37 printf("Real output: \"%*.*s\"\n\n", 5, 3, "text"); 38 39 printf("Testing printf(\"%%10.8s\", \"very long text\"):\n"); 40 printf("Expected output: \" very lon\"\n"); 41 printf("Real output: \"%10.8s\"\n\n", "very long text"); 42 43 printf("Testing printf(\"%%8.10s\", \"text\"):\n"); 44 printf("Expected output: \"text\"\n"); 45 printf("Real output: \"%8.10s\"\n\n", "text"); 46 47 printf("Testing printf(\"%%8.10s\", \"very long text\"):\n"); 48 printf("Expected output: \"very long \"\n"); 49 printf("Real output: \"%8.10s\"\n\n", "very long text"); 50 51 printf("Testing printf(\"%%s\", NULL):\n"); 52 printf("Expected output: \"(NULL)\"\n"); 53 printf("Real output: \"%s\"\n\n", NULL); 54 } 34 TPRINTF("Testing printf(\"%%*.*s\", 5, 3, \"text\"):\n"); 35 TPRINTF("Expected output: \" tex\"\n"); 36 TPRINTF("Real output: \"%*.*s\"\n\n", 5, 3, "text"); 37 38 TPRINTF("Testing printf(\"%%10.8s\", \"very long text\"):\n"); 39 TPRINTF("Expected output: \" very lon\"\n"); 40 TPRINTF("Real output: \"%10.8s\"\n\n", "very long text"); 41 42 TPRINTF("Testing printf(\"%%8.10s\", \"text\"):\n"); 43 TPRINTF("Expected output: \"text\"\n"); 44 TPRINTF("Real output: \"%8.10s\"\n\n", "text"); 45 46 TPRINTF("Testing printf(\"%%8.10s\", \"very long text\"):\n"); 47 TPRINTF("Expected output: \"very long \"\n"); 48 TPRINTF("Real output: \"%8.10s\"\n\n", "very long text"); 49 50 TPRINTF("Testing printf(\"%%s\", NULL):\n"); 51 TPRINTF("Expected output: \"(NULL)\"\n"); 52 TPRINTF("Real output: \"%s\"\n\n", NULL); 55 53 56 54 return NULL;
Note:
See TracChangeset
for help on using the changeset viewer.