1
0
mirror of https://github.com/pevans/erc-c.git synced 2024-12-27 01:32:17 +00:00

Add test for vm_segment_fwrite

This commit is contained in:
Peter Evans 2018-02-03 22:00:04 -06:00
parent 2bdc921b76
commit 3329753ef7

View File

@ -180,3 +180,17 @@ Test(vm_segment, set16)
vm_segment_set16(segment, 0, 0x2345);
cr_assert_eq(vm_segment_get16(segment, 0), 0x2345);
}
Test(vm_segment, fwrite)
{
FILE *stream;
stream = fopen("../data/zero.img", "r");
vm_segment_fread(segment, stream, 0, 123);
fclose(stream);
stream = fopen("/tmp/zero.img", "w");
cr_assert_eq(vm_segment_fwrite(segment, stream, 0, 123), OK);
fclose(stream);
}