5 /* open and close disc */
6 #include "sofs_rawdisc.h"
8 #include "fsck_helper.h"
12 testfunction_t function
;
15 typedef struct test_s test_t
;
17 void main (int argc
, char *argv
[])
25 /* functions containing the tests to be made */
28 {test_sbmagic
, "sbmagic"},
29 {test_sbname
, "sbname"},
30 {test_sbzones
, "sbzones"},
31 {test_sbfctablesize
, "sbfctablesize"},
32 {test_sbciutablesize
, "sbciutablesize"},
33 {test_sbitotal
, "sbitotal"},
34 {test_infree
, "infree"},
35 {test_inused
, "inused"},
36 {test_inlost
, "inlost"},
37 {test_clusterfree
, "clusterfree"},
38 {test_clusterused
, "clusterused"},
39 {test_clusterlost
, "clusterlost"},
42 if (argc
!= 2) ABORT(-EINVAL
);
43 nfuncs
= sizeof(test
)/sizeof(test_t
);
46 printf("Opening file %s as disc.\n", disc_path
);
47 ret
= soOpenDevice(disc_path
);
48 if (ret
< 0) ABORT(ret
);
49 atexit((void *)soCloseDevice
);
51 for (r
= 0; r
< nfuncs
; ++r
) {
52 testres
= test
[r
].function();
55 printf("System file corrupted.\n");
59 printf("System file is weird.\n");
62 printf("Test %s passed with success.\n", test
[r
].name
);