interplane.Get Omega
Read in your language

aienux

Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately.

Brought by drakestapleton

branch main Branches Tags History

aienux / native / omega / allen / tests / edges.om

157 lines · 2912 bytes Raw Blame History
1note Boundary and recovery gates. Test input construction is handwritten Omega.
2fn rt_edges to void
3reset
4put R 0 100
5put Inlen 0 159
6for i ulong 159
7put In i uchar 120
8end
9check start 1 0 1201
10check eq get R 7 159 1202
11cancel
12put Inlen 0 160
13check not start 1 0 1203
14check eq get R 0 101 1204
15put Inlen 0 1
16put In 0 uchar 9
17check not start 1 0 1205
18check eq classify 0 1206
19put In 0 uchar 120
20check start 1 10 1207
21check heard get R 0 25000 1208
22check eq tick 30010 1 1209
23check eq get R 1 1 1210
24check eq tick 54999 0 1211
25check eq tick 55000 2 1212
26check not heard get R 0 55001 1213
27check restore 1214
28for i ulong 40
29check restore add 1220 i
30end
31check eq get R 9 32 1260
32check eq get Hlen 31 1 1261
33check eq get Hist 4960 120 1262
34end
35fn codeinput part ulong total ulong bytes ulong crcval ulong count ulong to void
36outreset
37emitb 67
38emitb 79
39emitb 68
40emitb 69
41emitb 32
42emitn 1
43emitb 32
44emitn part
45emitb 47
46emitn total
47emitb 32
48emitn bytes
49emitb 32
50for i ulong 8
51emitb get Digits and shr crcval mul sub 7 i 4 15
52end
53emitb 32
54emitb 45
55emitb 32
56for i ulong count
57emitb 120
58end
59put Inlen 0 get Outlen 0
60for i ulong get Outlen 0
61put In i get Outb i
62end
63end
64fn code_edges to void
65codebeg 1
66codeinput 1 1 128 0 127
67check not codetake 1301
68check eq get C 4 0 1302
69codeinput 1 1 128 0 129
70check not codetake 1303
71codeinput 0 1 128 0 128
72check not codetake 1304
73codeinput 1 257 32769 0 128
74check not codetake 1305
75check eq get C 1 0 1306
76for i ulong 256
77codeinput add i 1 256 32768 3124632513 128
78check codetake add 1310 i
79end
80check eq get C 4 256 1570
81check eq missing 0 1571
82check eq codestat 2 1572
83put C 3 0
84check eq codestat 3 1575
85put C 3 3124632513
86check eq codestat 2 1573
87put R 0 1
88put R 1 1
89cancel
90check not codeshow 1 1574
91end
92fn lineinput part ulong bytes ulong to void
93put Inlen 0 bytes
94for i ulong bytes
95put In i uchar 120
96end
97b = packet 2 1 part 0 0
98put Inlen 0 get Outlen 0
99for i ulong get Outlen 0
100put In i get Outb i
101end
102end
103fn q_edges to void
104qbegin 1 1
105for i ulong 8
106lineinput add i 1 1
107check eq qreceive 1 add 1600 i
108end
109lineinput 9 1
110check eq qreceive 0 1610
111check eq get Q 4 8 1611
112check qtake 1612
113lineinput 9 1
114check eq qreceive 1 1613
115check eq get Q 4 8 1614
116lineinput 10 320
117check eq qreceive 0 1615
118check eq get Q 2 9 1616
119put Inlen 0 1001
120check not packet 1 1 1 1 1001 1617
121end
122fn mem_edges to void
123for i ulong 3692
124put Mem i 0
125end
126mset32 32 32
127mset32 36 512
128for i ulong 32
129off = add 40 mul i 113
130put Mem off uchar 107
131put Mem add off 48 uchar 118
132end
133check memenc 10 1701
134check eq get32 12 3692 1702
135check memdec 1703
136mset32 32 33
137check not memenc 11 1704
138check eq get Enc 16 10 1705
139mset32 32 32
140mset32 36 513
141check not memenc 11 1706
142mset32 36 512
143check memenc 11 1707
144put Unit 4095 uchar 1
145check not memdec 1708
146check eq get Md 0 10 1709
147check not txflush true 1710
148check not txread true 1711
149end
150fn main to int
151constants
152rt_edges
153code_edges
154q_edges
155mem_edges
156ret int get Fails 0
157end