provide overrides for scheduling flags, tdnestcnt and idnestcnt
[AROS.git] / test / dosvartest.c
blob49aacf28a196b2e44548f4523cf115ae69329b35
1 /*
2 Copyright © 1995-2014, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #include <string.h>
7 #include <stdio.h>
9 #include <proto/dos.h>
10 #include <proto/exec.h>
11 #include <proto/utility.h>
12 #include <dos/var.h>
15 #define DefCheckVar(VarName, Flags, Expected) \
16 CopyMem("!!!", Buffer, 4); \
17 printf("Checking Variable %s with Flags %x \n",VarName,(int)Flags); \
18 Bytes = GetVar(VarName, Buffer, (LONG)0x17, Flags); \
19 printf(" GetVar: res=0x%x %s (IOErr=%i, len=%i)\n", Bytes, Buffer,(int)IoErr(),(int)strlen(Buffer)); \
20 printf("expected: %s\n",Expected); \
21 printf("---\n");
23 #define DefSetVar(VarName,Value,Flags) \
24 printf("Setting Variable %s:=`%s` with Flags %x \n",VarName,Value,(int)Flags); \
25 SetVar(VarName,Value,(LONG)-1,Flags);
27 #define DefDeleteVar(VarName, Flags) \
28 printf("Deleting Variable %s Flags %x\n",VarName,(int)Flags); \
29 DeleteVar(VarName, Flags); \
30 printf("---\n");
32 int main(void)
34 int Bytes;
35 char * Buffer = AllocMem(0x1000,0x0);
37 DefCheckVar("S:Startup-Sequence", GVF_GLOBAL_ONLY, "first line of startup-sequence");
38 DefCheckVar("S:Startup-Sequence", (LONG)(GVF_GLOBAL_ONLY|GVF_BINARY_VAR), "whole startup-sequence");
40 DefSetVar("AROS","Amiga R. OS\n1995-1997\n",GVF_LOCAL_ONLY);
41 DefCheckVar("AROS", GVF_LOCAL_ONLY, "Amiga R. OS");
42 DefCheckVar("AROS", (LONG)(GVF_LOCAL_ONLY|GVF_BINARY_VAR), "Amiga R. OS\n1995-1997\n");
43 DefCheckVar("AROS", (LONG)(GVF_LOCAL_ONLY|GVF_BINARY_VAR|GVF_DONT_NULL_TERM), "Amiga R. OS\n1995-1997\n(+garbage)\n");
44 DefDeleteVar("AROS", GVF_LOCAL_ONLY);
45 DefCheckVar("AROS", GVF_LOCAL_ONLY, "no output as var is deleted");
47 DefSetVar("AROS","Amiga R. OS\n1995-1997\n",(LONG)(GVF_LOCAL_ONLY|LVF_IGNORE));
48 DefCheckVar("aros", GVF_LOCAL_ONLY, "no output");
49 DefCheckVar("aros", (LONG)(GVF_LOCAL_ONLY|LVF_IGNORE), "Amiga R. OS");
50 DefCheckVar("aRoS", (LONG)(GVF_LOCAL_ONLY|LVF_IGNORE|GVF_BINARY_VAR), "Amiga R. OS\n1995-1997\n");
51 DefCheckVar("aRoS", (LONG)(GVF_LOCAL_ONLY|LVF_IGNORE|GVF_BINARY_VAR|GVF_DONT_NULL_TERM), "Amiga R. OS\n1995-1997\n (+garbage)\n");
52 DefDeleteVar("AROS", GVF_LOCAL_ONLY);
53 DefCheckVar("aros", (LONG)(GVF_LOCAL_ONLY|LVF_IGNORE), "Amiga R. OS");
54 DefDeleteVar("AROS", (LONG)(GVF_LOCAL_ONLY|LVF_IGNORE));
55 DefCheckVar("aros", (LONG)(GVF_LOCAL_ONLY|LVF_IGNORE), "no output as var is deleted");
57 DefSetVar("AROS","Amiga R. OS\n1995-1997\n",(LONG)(GVF_LOCAL_ONLY|LVF_IGNORE|LV_ALIAS));
58 DefCheckVar("aros", GVF_LOCAL_ONLY, "no output");
59 DefCheckVar("aros", (LONG)(GVF_LOCAL_ONLY|LVF_IGNORE), "no output");
60 DefCheckVar("aros", (LONG)(GVF_LOCAL_ONLY|LV_ALIAS), "no output");
61 DefCheckVar("aros", (LONG)(GVF_LOCAL_ONLY|LVF_IGNORE|LV_ALIAS), "Amiga R. OS");
62 DefCheckVar("aRoS", (LONG)(GVF_LOCAL_ONLY|LVF_IGNORE|GVF_BINARY_VAR|LV_ALIAS), "Amiga R. OS\n1995-1997\n");
63 DefDeleteVar("AROS", GVF_LOCAL_ONLY);
64 DefCheckVar("aros", (LONG)(GVF_LOCAL_ONLY|LVF_IGNORE|LV_ALIAS), "Amiga R. OS");
65 DefDeleteVar("AROS", (LONG)(GVF_LOCAL_ONLY|LVF_IGNORE));
66 DefCheckVar("aros", (LONG)(GVF_LOCAL_ONLY|LVF_IGNORE|LV_ALIAS), "Amiga R. OS");
67 DefDeleteVar("AROS", (LONG)(GVF_LOCAL_ONLY|LVF_IGNORE));
68 DefCheckVar("aros", (LONG)(GVF_LOCAL_ONLY|LVF_IGNORE|LV_ALIAS), "Amiga R. OS");
69 DefDeleteVar("AROS", (LONG)(GVF_LOCAL_ONLY|LVF_IGNORE|LV_ALIAS));
70 DefCheckVar("aros", (LONG)(GVF_LOCAL_ONLY|LVF_IGNORE|LV_ALIAS), "no output as var is deleted");
73 DefSetVar("AROS","Amiga R. OS\n1995-1997\n",GVF_GLOBAL_ONLY);
74 DefCheckVar("aros", GVF_LOCAL_ONLY, "no output");
75 DefCheckVar("aros", GVF_GLOBAL_ONLY, "Amiga R. OS");
76 DefDeleteVar("AROS", GVF_LOCAL_ONLY);
77 DefCheckVar("aros", GVF_GLOBAL_ONLY, "Amiga R. OS");
78 DefDeleteVar("aROS", GVF_GLOBAL_ONLY);
79 DefCheckVar("AROS", GVF_GLOBAL_ONLY, "no output as var is deleted");
81 DefSetVar("AROS","Amiga R. OS\n1995-1997\n",(LONG)(GVF_GLOBAL_ONLY|GVF_SAVE_VAR));
82 DefCheckVar("aros", GVF_LOCAL_ONLY, "no output");
83 DefCheckVar("aros_", GVF_GLOBAL_ONLY, "no output");
84 DefCheckVar("aros", GVF_GLOBAL_ONLY, "Amiga R. OS");
85 DefCheckVar("aRoS", (LONG)(GVF_GLOBAL_ONLY|GVF_BINARY_VAR), "Amiga R. OS\n1995-1997\n");
86 DefCheckVar("aRoS", (LONG)(GVF_GLOBAL_ONLY|GVF_BINARY_VAR|GVF_DONT_NULL_TERM), "Amiga R. OS\n1995-1997\n");
87 DefDeleteVar("AROS", GVF_LOCAL_ONLY);
88 DefCheckVar("aros", GVF_GLOBAL_ONLY, "Amiga R. OS");
89 DefDeleteVar("AROS", GVF_GLOBAL_ONLY);
90 DefCheckVar("aros", GVF_GLOBAL_ONLY, "no output as var is deleted");
93 FreeMem(Buffer,0x1000);
95 return 0;