Changeset bf61d3a in mainline for uspace/app/tester
- Timestamp:
- 2010-11-26T01:34:21Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 273b958
- Parents:
- 4b9a410 (diff), 7e752b2 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - Location:
- uspace/app/tester
- Files:
-
- 2 added
- 11 edited
-
Makefile (modified) (1 diff)
-
ipc/ping_pong.c (modified) (1 diff)
-
ipc/register.c (modified) (3 diffs)
-
print/print1.c (modified) (1 diff)
-
print/print2.c (modified) (1 diff)
-
print/print4.c (modified) (2 diffs)
-
print/print5.c (added)
-
print/print5.def (added)
-
stdio/stdio1.c (modified) (1 diff)
-
tester.c (modified) (2 diffs)
-
tester.h (modified) (1 diff)
-
thread/thread1.c (modified) (2 diffs)
-
vfs/vfs1.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/tester/Makefile
r4b9a410 rbf61d3a 38 38 print/print3.c \ 39 39 print/print4.c \ 40 print/print5.c \ 40 41 console/console1.c \ 41 42 stdio/stdio1.c \ -
uspace/app/tester/ipc/ping_pong.c
r4b9a410 rbf61d3a 72 72 } 73 73 74 TPRINTF("OK\nCompleted % llu round trips in %u seconds, %llurt/s.\n",74 TPRINTF("OK\nCompleted %" PRIu64 " round trips in %u seconds, %" PRIu64 " rt/s.\n", 75 75 count, DURATION_SECS, count / DURATION_SECS); 76 76 -
uspace/app/tester/ipc/register.c
r4b9a410 rbf61d3a 27 27 */ 28 28 29 #include <inttypes.h> 29 30 #include <stdio.h> 30 31 #include <unistd.h> … … 41 42 unsigned int i; 42 43 43 TPRINTF("Connected phone % #xaccepting\n", icall->in_phone_hash);44 TPRINTF("Connected phone %" PRIun " accepting\n", icall->in_phone_hash); 44 45 ipc_answer_0(iid, EOK); 45 46 for (i = 0; i < MAX_CONNECTIONS; i++) { … … 57 58 switch (IPC_GET_METHOD(call)) { 58 59 case IPC_M_PHONE_HUNGUP: 59 TPRINTF("Phone % #xhung up\n", icall->in_phone_hash);60 TPRINTF("Phone %" PRIun " hung up\n", icall->in_phone_hash); 60 61 retval = 0; 61 62 break; 62 63 case IPC_TEST_METHOD: 63 TPRINTF("Received well known message from % #x: %#x\n",64 TPRINTF("Received well known message from %" PRIun ": %" PRIun "\n", 64 65 icall->in_phone_hash, callid); 65 66 ipc_answer_0(callid, EOK); 66 67 break; 67 68 default: 68 TPRINTF("Received unknown message from % #x: %#x\n",69 TPRINTF("Received unknown message from %" PRIun ": %" PRIun "\n", 69 70 icall->in_phone_hash, callid); 70 71 ipc_answer_0(callid, ENOENT); -
uspace/app/tester/print/print1.c
r4b9a410 rbf61d3a 49 49 TPRINTF("Real output: \"%8.10s\"\n\n", "very long text"); 50 50 51 TPRINTF("Testing printf(\"%%s\", NULL):\n");52 TPRINTF("Expected output: \"(NULL)\"\n");53 TPRINTF("Real output: \"%s\"\n\n", NULL);54 55 51 return NULL; 56 52 } -
uspace/app/tester/print/print2.c
r4b9a410 rbf61d3a 33 33 const char *test_print2(void) 34 34 { 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');35 TPRINTF("Testing printf(\"%%c\", 'a'):\n"); 36 TPRINTF("Expected output: [a]\n"); 37 TPRINTF("Real output: [%c]\n\n", 'a'); 38 38 39 39 TPRINTF("Testing printf(\"%%d %%3.2d %%-3.2d %%2.3d %%-2.3d\", 1, 2, 3, 4, 5):\n"); -
uspace/app/tester/print/print4.c
r4b9a410 rbf61d3a 45 45 TPRINTF(" "); 46 46 for (index = 0; index < 32; index++) 47 TPRINTF("%lc", (w char_t) ((group << 5) + index));47 TPRINTF("%lc", (wint_t) ((group << 5) + index)); 48 48 49 49 TPRINTF("\n"); … … 57 57 uint8_t index; 58 58 for (index = 0; index < 32; index++) 59 TPRINTF("%lc", (w char_t) ((group << 5) + index));59 TPRINTF("%lc", (wint_t) ((group << 5) + index)); 60 60 61 61 TPRINTF("\n"); -
uspace/app/tester/stdio/stdio1.c
r4b9a410 rbf61d3a 60 60 61 61 buf[cnt] = '\0'; 62 TPRINTF("Read % u bytes, string \"%s\"\n", cnt, buf);62 TPRINTF("Read %zu bytes, string \"%s\"\n", cnt, buf); 63 63 64 64 TPRINTF("Seek to beginning..."); -
uspace/app/tester/tester.c
r4b9a410 rbf61d3a 51 51 #include "print/print3.def" 52 52 #include "print/print4.def" 53 #include "print/print5.def" 53 54 #include "console/console1.def" 54 55 #include "stdio/stdio1.def" … … 110 111 } 111 112 113 unsigned int _len = (unsigned int) len; 114 if ((_len != len) || (((int) _len) < 0)) { 115 printf("Command length overflow\n"); 116 return; 117 } 118 112 119 for (test = tests; test->name != NULL; test++) 113 printf("%-*s %s%s\n", len, test->name, test->desc, (test->safe ? "" : " (unsafe)")); 120 printf("%-*s %s%s\n", _len, test->name, test->desc, 121 (test->safe ? "" : " (unsafe)")); 114 122 115 printf("%-*s Run all safe tests\n", len, "*");123 printf("%-*s Run all safe tests\n", _len, "*"); 116 124 } 117 125 -
uspace/app/tester/tester.h
r4b9a410 rbf61d3a 68 68 extern const char *test_print3(void); 69 69 extern const char *test_print4(void); 70 extern const char *test_print5(void); 70 71 extern const char *test_console1(void); 71 72 extern const char *test_stdio1(void); -
uspace/app/tester/thread/thread1.c
r4b9a410 rbf61d3a 35 35 #include <stdio.h> 36 36 #include <unistd.h> 37 #include <inttypes.h> 37 38 #include "../tester.h" 38 39 … … 74 75 atomic_set(&finish, 0); 75 76 while (atomic_get(&threads_finished) < total) { 76 TPRINTF("Threads left: %u\n", total - atomic_get(&threads_finished)); 77 TPRINTF("Threads left: %" PRIua "\n", 78 total - atomic_get(&threads_finished)); 77 79 sleep(1); 78 80 } -
uspace/app/tester/vfs/vfs1.c
r4b9a410 rbf61d3a 105 105 if (cnt < 0) 106 106 return "write() failed"; 107 TPRINTF("Written % d bytes\n", cnt);107 TPRINTF("Written %zd bytes\n", cnt); 108 108 109 109 if (lseek(fd0, 0, SEEK_SET) != 0) … … 116 116 return "read() failed"; 117 117 118 TPRINTF("Read %d bytes: \".*s\"\n", cnt, cnt, buf); 118 int _cnt = (int) cnt; 119 if (_cnt != cnt) { 120 /* Count overflow, just to be sure. */ 121 TPRINTF("Read %zd bytes\n", cnt); 122 } else { 123 TPRINTF("Read %zd bytes: \"%.*s\"\n", cnt, _cnt, buf); 124 } 119 125 } 120 126
Note:
See TracChangeset
for help on using the changeset viewer.
