/** * Testing the initialization code of the fs. Should work without any of the sfs API * being implemented. */ int initDiskTest() { int hr = SUCCESS; FAIL_BRK4(initDisk()); Fail: saveAndCloseDisk(); PRINT_RESULTS("Init Disk Test (This test should not fail. Not worth points.)"); return hr; }
int main (int argc, char *argv[]) { int c; int rc; setprogname(argv[0]); while ((c = getopt(argc, argv, "dvb:")) != -1) { switch (c) { case 'b': BlockSize = atoi(optarg); switch (BlockSize) { case 128: case 256: case 512: case 1024: case 2048: case 4096: break; default: usage("bad block size"); break; } break; case 'd': Debug = TRUE; break; case 'v': Zerofill = TRUE; break; case '?': case ':': default: usage("bad option"); break; } } rc = initDisk(argv[optind]); if (rc) { usage("couldn't open device"); } if (init(argc, argv) == -1) { finish(0); usage("initialization failed"); } input(); finish(0); return 0; }