Added test for makeadf

This commit is contained in:
alpine9000
2016-03-03 17:32:08 +11:00
parent 3f0d6a2568
commit 499f6ee39e
5 changed files with 33 additions and 7 deletions
+17 -2
View File
@@ -20,9 +20,24 @@ clean:
subdirs: $(SUBDIRS)
test:
@echo ""
@echo ""
@echo ""
@echo "Testing tools/makeadf..."
@echo "------------------------"
make -C tools/makeadf test
@echo ""
@echo ""
@echo ""
@echo "Testing tools/imagecon..."
@echo "-------------------------"
make -C tools/imagecon test
@echo ""
@echo ""
@echo ""
$(SUBDIRS):
@echo ""
make -C $@
+11 -1
View File
@@ -13,4 +13,14 @@ bin:
mkdir bin
clean:
rm -r out bin
rm -r out bin *~
test: $(MAKEADF)
$(MAKEADF) reference/bootblock.bin > out/test.adf
diff reference/test.adf out/test.adf
@echo "______ ___ _____ _____ ___________ "
@echo "| ___ \/ _ \ / ___/ ___| ___| _ \ "
@echo "| |_/ / /_\ \\\\\ \`--.\ \`--.| |__ | | | | "
@echo "| __/| _ | \`--. \\\`--. \ __|| | | | "
@echo "| | | | | |/\__/ /\__/ / |___| |/ / "
@echo "\_| \_| |_/\____/\____/\____/|___/ "
+5 -4
View File
@@ -46,20 +46,21 @@ int main(int argc,char *argv[])
if ((f = fopen(argv[1],"rb"))) {
len = fread(image,1,DISKSIZE,f);
if (len > 0) {
if (len < DISKSIZE)
if (len < DISKSIZE) {
memset(image+len,0,DISKSIZE-len);
}
boot_chksum(image);
fwrite(image,1,DISKSIZE,stdout);
rc = 0;
}
else
fprintf(stderr,"Image read error!\n");
fprintf(stderr,"%s: image read error!\n", argv[0]);
}
else
fprintf(stderr,"Cannot open '%s'!\n",argv[0]);
fprintf(stderr,"%s: file to open open %s\n", argv[0], argv[1]);
}
else
fprintf(stderr,"Usage: %s <image data>\n",argv[0]);
fprintf(stderr,"usage: %s <image data>\n", argv[0]);
return rc;
}
Binary file not shown.
Binary file not shown.