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 / font.om

114 lines · 2081 bytes Raw Blame History
1global Oldmask uchar 65536
2global Oldmeta ulong 6
3fn test ok bool to void
4check ok add get Checks 0 1
5end
6fn asym to bool
7w = get Af 3
8for y ulong get Af 4
9at = mul y w
10for x ulong w
11a = long get Alpha add at x
12mirror = add at sub sub w 1 x
13b = long get Alpha mirror
14d = sub a b
15if gt d 40
16ret false
17end
18if lt d -40
19ret false
20end
21end
22end
23ret true
24end
25fn main to int
26test not afglyph 65
27test not afinit 0 1250
28test not afinit 65 1250
29test not afinit 30 0
30test not afinit 30 2501
31test afinit 30 1250
32test eq get Af 0 384
33test eq get Af 1 480
34test eq afsqrt 0 0
35test eq afsqrt 15 3
36test eq afsqrt 16 4
37test eq afsqrt 18446744073709551615 4294967295
38test eq afsqrt mul ulong 1000000007 1000000007 1000000007
39test eq afsin 0 0
40test eq afsin 90 16384
41test eq afsin -90 -16384
42test eq afsin 450 16384
43test eq afcos 180 -16384
44for c ulong 95
45test afglyph uchar add c 32
46test gt get Af 5 0
47test le mul get Af 3 get Af 4 len Alpha
48if eq c 0
49test eq get Af 3 0
50test eq get Af 4 1
51else
52ink = ulong 0
53for i ulong mul get Af 3 get Af 4
54if gt get Alpha i 128
55ink = add ink 1
56end
57end
58test ge ink 4
59end
60end
61test afglyph 111
62test asym
63test afglyph 63
64for i ulong mul get Af 3 get Af 4
65put Oldmask i get Alpha i
66end
67for i ulong 6
68put Oldmeta i get Af i
69end
70test afglyph 0
71same = true
72for i ulong 6
73if ne get Oldmeta i get Af i
74same = false
75end
76end
77for i ulong mul get Af 3 get Af 4
78if ne get Oldmask i get Alpha i
79same = false
80end
81end
82test same
83test not afinit 999 1250
84test eq get Af 0 get Oldmeta 0
85test eq get Af 3 get Oldmeta 3
86test afinit 64 2500
87test afglyph 87
88test le mul get Af 3 get Af 4 len Alpha
89test afinit 1 1
90test afglyph 65
91note Independent analytic coverage for round-capped strokes and zero-length dots.
92put Af 2 1
93put Af 1 128
94put Ag 0 0
95put Ag 1 0
96put Ag 2 512
97put Ag 3 0
98test eq afalpha 256 0 255
99test eq afalpha 256 128 127
100test eq afalpha 256 256 0
101test eq afalpha 768 0 0
102test eq afalpha -128 0 127
103put Ag 0 512
104put Ag 2 0
105test eq afalpha 256 128 127
106put Ag 0 0
107test eq afalpha 0 0 255
108test eq afalpha 0 128 127
109test eq afalpha 0 256 0
110if ne get Fails 0 0
111ret 1
112end
113ret 0
114end