jehanne/qa/kern/waserror.c
Giacomo Tesio 38aca7a581 first usable version of kernel and commands
After an year of hard work, this is a first "usable" version of Jehanne.
2016-11-26 03:49:29 +01:00

28 lines
488 B
C

// Ensure that many calls to waserror:
// -- return an error
// -- complete
// Since we're going to improve waserror
#include <u.h>
#include <libc.h>
void
main(void)
{
char buf[1];
int i;
// Just to be sure.
if (close(3) >= 0) {
print("waserror: close of 3 did not get an error\n");
exits("FAIL");
}
for(i = 0; i < 100000; i++) {
if (read(3, buf, 1) >= 0){
print("waserror: read of 3 did not get an error\n");
exits("FAIL");
}
}
print("PASS\n");
exits("PASS");
}