Changeset 0bff73a in mainline
- Timestamp:
- 2010-12-17T21:39:26Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 47a7174f
- Parents:
- 424558a
- Location:
- uspace/app/tester/hw/misc
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/tester/hw/misc/virtchar1.c
r424558a r0bff73a 45 45 #include <sys/stat.h> 46 46 #include <fcntl.h> 47 #include <device/char.h> 47 48 #include "../../tester.h" 48 49 49 50 #define DEVICE_PATH "/dev/devices/\\virt\\null" 51 #define BUFFER_SIZE 64 50 52 51 53 const char *test_virtchar1(void) … … 56 58 TPRINTF(" ...error: %s\n", str_error(fd)); 57 59 if (fd == ENOENT) { 58 TPRINTF(" 60 TPRINTF(" (error was ENOENT: " \ 59 61 "have you compiled test drivers?)\n"); 60 62 } … … 73 75 TPRINTF(" ...phone is %d\n", phone); 74 76 77 TPRINTF("Will try to read...\n"); 78 size_t i; 79 char buffer[BUFFER_SIZE]; 80 read_dev(phone, buffer, BUFFER_SIZE); 81 TPRINTF(" ...verifying that we read zeroes only...\n"); 82 for (i = 0; i < BUFFER_SIZE; i++) { 83 if (buffer[i] != 0) { 84 return "Not all bytes are zeroes"; 85 } 86 } 87 TPRINTF(" ...data read okay\n"); 75 88 76 89 /* Clean-up. */ 77 TPRINTF("Closing phones and file descriptors ...");90 TPRINTF("Closing phones and file descriptors"); 78 91 ipc_hangup(phone); 79 92 close(fd); -
uspace/app/tester/hw/misc/virtchar1.def
r424558a r0bff73a 1 1 { 2 "v c",2 "virtchar1", 3 3 "Virtual char device test", 4 4 &test_virtchar1,
Note:
See TracChangeset
for help on using the changeset viewer.