Changeset 2d11a7d8 in mainline for uspace/app/tester/print/print2.c
- Timestamp:
- 2009-06-30T15:54:14Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 9c40f883
- Parents:
- db24058
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/tester/print/print2.c
rdb24058 r2d11a7d8 1 1 /* 2 * Copyright (c) 200 6 Ondrej Palkovsky2 * Copyright (c) 2005 Josef Cejka 3 3 * All rights reserved. 4 4 * … … 29 29 #include <stdio.h> 30 30 #include <unistd.h> 31 #include <errno.h>32 31 #include "../tester.h" 33 32 34 char * test_hangup(bool quiet)33 char *test_print2(void) 35 34 { 36 char c; 37 int res; 38 int phoneid; 39 40 printf("Select phoneid to hangup: 2-9 (q to skip)\n"); 41 do { 42 c = getchar(); 43 if ((c == 'Q') || (c == 'q')) 44 return TEST_SKIPPED; 45 } while (c < '2' || c > '9'); 46 phoneid = c - '0'; 35 TPRINTF("Testing printf(\"%%c %%3.2c %%-3.2c %%2.3c %%-2.3c\", 'a', 'b', 'c', 'd', 'e'):\n"); 36 TPRINTF("Expected output: [a] [ b] [c ] [ d] [e ]\n"); 37 TPRINTF("Real output: [%c] [%3.2c] [%-3.2c] [%2.3c] [%-2.3c]\n\n", 'a', 'b', 'c', 'd', 'e'); 47 38 48 printf("Hanging up..."); 49 res = ipc_hangup(phoneid); 50 printf("done: %d\n", phoneid); 39 TPRINTF("Testing printf(\"%%d %%3.2d %%-3.2d %%2.3d %%-2.3d\", 1, 2, 3, 4, 5):\n"); 40 TPRINTF("Expected output: [1] [ 02] [03 ] [004] [005]\n"); 41 TPRINTF("Real output: [%d] [%3.2d] [%-3.2d] [%2.3d] [%-2.3d]\n\n", 1, 2, 3, 4, 5); 42 43 TPRINTF("Testing printf(\"%%d %%3.2d %%-3.2d %%2.3d %%-2.3d\", -1, -2, -3, -4, -5):\n"); 44 TPRINTF("Expected output: [-1] [-02] [-03] [-004] [-005]\n"); 45 TPRINTF("Real output: [%d] [%3.2d] [%-3.2d] [%2.3d] [%-2.3d]\n\n", -1, -2, -3, -4, -5); 46 47 TPRINTF("Testing printf(\"%%#x %%5.3#x %%-5.3#x %%3.5#x %%-3.5#x\", 17, 18, 19, 20, 21):\n"); 48 TPRINTF("Expected output: [0x11] [0x012] [0x013] [0x00014] [0x00015]\n"); 49 TPRINTF("Real output: [%#x] [%#5.3x] [%#-5.3x] [%#3.5x] [%#-3.5x]\n\n", 17, 18, 19, 20, 21); 51 50 52 51 return NULL;
Note:
See TracChangeset
for help on using the changeset viewer.