Changeset d16fc78 in mainline for kernel/test
- Timestamp:
- 2010-11-26T01:07:42Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 855e0d8
- Parents:
- 1e27d85
- Location:
- kernel/test/print
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/test/print/print1.c
r1e27d85 rd16fc78 48 48 TPRINTF("Real output: \"%8.10s\"\n\n", "very long text"); 49 49 50 TPRINTF("Testing printf(\"%%s\", NULL):\n");51 TPRINTF("Expected output: \"(NULL)\"\n");52 TPRINTF("Real output: \"%s\"\n\n", NULL);53 54 50 return NULL; 55 51 } -
kernel/test/print/print2.c
r1e27d85 rd16fc78 32 32 const char *test_print2(void) 33 33 { 34 TPRINTF("Testing printf(\"%%c %%3.2c %%-3.2c %%2.3c %%-2.3c\", 'a', 'b', 'c', 'd', 'e'):\n");35 TPRINTF("Expected output: [a] [ b] [c ] [ d] [e ]\n");36 TPRINTF("Real output: [%c] [%3.2c] [%-3.2c] [%2.3c] [%-2.3c]\n\n", 'a', 'b', 'c', 'd', 'e');34 TPRINTF("Testing printf(\"%%c\", 'a'):\n"); 35 TPRINTF("Expected output: [a]\n"); 36 TPRINTF("Real output: [%c]\n\n", 'a'); 37 37 38 38 TPRINTF("Testing printf(\"%%d %%3.2d %%-3.2d %%2.3d %%-2.3d\", 1, 2, 3, 4, 5):\n"); … … 48 48 TPRINTF("Real output: [%#x] [%#5.3x] [%#-5.3x] [%#3.5x] [%#-3.5x]\n\n", 17, 18, 19, 20, 21); 49 49 50 unative_t nat = 0x12345678u;50 unative_t nat = UINTN_C(0x12345678); 51 51 52 TPRINTF("Testing printf(\"%%#" PRIx64 " %%#" PRIx32 " %%#" PRIx16 " %%#" PRIx8 " %%#" PRIxn " %%#" PRIx64 " %%s\", 0x1234567887654321ll, 0x12345678, 0x1234, 0x12, nat, 0x1234567887654321ull, \"Lovely string\"):\n");52 TPRINTF("Testing printf(\"%%#" PRIx64 " %%#" PRIx32 " %%#" PRIx16 " %%#" PRIx8 " %%#" PRIxn " %%#" PRIx64 " %%s\", (uint64_t) UINT64_C(0x1234567887654321), (uint32_t) UINT32_C(0x12345678), (uint16_t) UINT16_C(0x1234), (uint8_t) UINT8_C(0x12), nat, (uint64_t) UINT64_C(0x1234567887654321), \"Lovely string\"):\n"); 53 53 TPRINTF("Expected output: [0x1234567887654321] [0x12345678] [0x1234] [0x12] [0x12345678] [0x1234567887654321] \"Lovely string\"\n"); 54 TPRINTF("Real output: [%#" PRIx64 "] [%#" PRIx32 "] [%#" PRIx16 "] [%#" PRIx8 "] [%#" PRIxn "] [%#" PRIx64 "] \"%s\"\n\n", 0x1234567887654321ll, 0x12345678, 0x1234, 0x12, nat, 0x1234567887654321ull, "Lovely string");54 TPRINTF("Real output: [%#" PRIx64 "] [%#" PRIx32 "] [%#" PRIx16 "] [%#" PRIx8 "] [%#" PRIxn "] [%#" PRIx64 "] \"%s\"\n\n", (uint64_t) UINT64_C(0x1234567887654321), (uint32_t) UINT32_C(0x12345678), (uint16_t) UINT16_C(0x1234), (uint8_t) UINT8_C(0x12), nat, (uint64_t) UINT64_C(0x1234567887654321), "Lovely string"); 55 55 56 56 return NULL; -
kernel/test/print/print4.c
r1e27d85 rd16fc78 44 44 TPRINTF(" "); 45 45 for (index = 0; index < 32; index++) 46 TPRINTF("%lc", (w char_t) ((group << 5) + index));46 TPRINTF("%lc", (wint_t) ((group << 5) + index)); 47 47 48 48 TPRINTF("\n"); … … 56 56 uint8_t index; 57 57 for (index = 0; index < 32; index++) 58 TPRINTF("%lc", (w char_t) ((group << 5) + index));58 TPRINTF("%lc", (wint_t) ((group << 5) + index)); 59 59 60 60 TPRINTF("\n");
Note:
See TracChangeset
for help on using the changeset viewer.