use consistent cpu naming & numbering
[AROS.git] / test / isfilesystem.c
blobd321ed6811d5a9017ffe384f9ba505db97f3c709
1 /*
2 * Copyright (C) 2013, Netronome Systems, Inc.
3 * All right reserved.
5 */
6 #include <aros/shcommands.h>
8 #include <proto/dos.h>
10 #ifndef ARRAY_SIZE
11 #define ARRAY_SIZE(x) (sizeof(x)/sizeof((x)[0]))
12 #endif
14 struct {
15 CONST_STRPTR value;
16 BOOL result;
17 } test[] = {
18 { "", TRUE },
19 { "isfilesystem", TRUE },
20 { "*", FALSE },
21 { "CONSOLE:", FALSE },
22 { "CON:", FALSE },
23 { "RAW:", FALSE },
24 { "PIPE:", FALSE },
25 { "SYS:", TRUE },
26 { "RAM:", TRUE },
27 { "NIL:", FALSE },
30 AROS_SH0(isfilesystem, 0.0)
32 AROS_SHCOMMAND_INIT
33 BOOL failed = FALSE;
34 int i;
36 for (i = 0; i < ARRAY_SIZE(test); i++) {
37 BOOL res;
38 res = IsFileSystem(test[i].value) ? TRUE : FALSE;
39 Printf("IsFileSystem(\"%s\") = %s", test[i].value, (test[i].result == res) ? "ok" : "FAIL");
40 if (res != test[i].result) {
41 Printf(" (expected %s, got %s)\n", test[i].result ? "TRUE" : "FALSE", res ? "TRUE" : "FALSE");
42 failed = TRUE;
43 } else
44 Printf("\n");
48 return failed ? RETURN_FAIL : RETURN_OK;
49 AROS_SHCOMMAND_EXIT