init: init nachos hw01, should pass jenkins os_group_20_hw job but fail on os_group_20_ta job
This commit is contained in:
20
code/test/fileIO_test1.c
Normal file
20
code/test/fileIO_test1.c
Normal file
@@ -0,0 +1,20 @@
|
||||
#include "syscall.h"
|
||||
|
||||
int main(void)
|
||||
{
|
||||
char test[] = "abcdefghijklmnopqrstuvwxyz";
|
||||
int success = Create("file1.test");
|
||||
OpenFileId fid;
|
||||
int i;
|
||||
if (success != 1) MSG("Failed on creating file");
|
||||
fid = Open("file1.test");
|
||||
if (fid == -1) MSG("Failed on opening file");
|
||||
for (i = 0; i < 26; ++i) {
|
||||
int count = Write(test + i, 1, fid);
|
||||
if (count != 1) MSG("Failed on writing file");
|
||||
}
|
||||
success = Close(fid);
|
||||
if (success != 1) MSG("Failed on closing file");
|
||||
Halt();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user