repo.or.cz
/
openc2e.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
add unfinished bmpImage implementation
[openc2e.git]
/
unittests
/
timeslice.c1,c2.cos
blob
4b6b15660bbd8d79e10337df35b292831ae13520
1
* unit tests for time slicing
2
* nornagon 04/08/07
3
4
dbg: outs "# Time slicing and evalcosts"
5
dbg: outs "1..9"
6
7
* setv
8
setv var0 100
9
dbg: tslc var0
10
setv var1 42
11
subv var0 dbg: tslc
12
doif var0 eq 0
13
dbg: outs "ok 1"
14
else
15
dbg: outs "not ok 1"
16
endi
17
18
* doif
19
setv var0 100
20
dbg: tslc var0
21
22
doif 1 eq 2
23
dbg: outs "not ok 2"
24
elif 3 eq 4
25
dbg: outs "not ok 2"
26
else
27
setv var1 2
28
endi
29
30
subv var0 dbg: tslc
31
doif var0 eq 0
32
dbg: outs "ok 2"
33
else
34
dbg: outs "not ok 2"
35
endi
36
37
* math
38
setv var0 100
39
dbg: tslc var0
40
setv var1 0
41
addv var1 17
42
divv var1 3
43
mulv var1 32
44
modv var1 6
45
rndv var1 -5 5
46
andv var1 3
47
orrv var1 8
48
subv var1 9
49
negv var1
50
subv var0 dbg: tslc
51
doif var0 eq 0
52
dbg: outs "ok 3"
53
else
54
dbg: outs "not ok 3"
55
endi
56
57
* new: simp
58
setv var0 100
59
dbg: tslc var0
60
new: simp eggs 1 0 1 0
61
subv var0 dbg: tslc
62
doif var0 eq 1
63
dbg: outs "ok 4"
64
else
65
dbg: outs "not ok 4"
66
endi
67
kill targ
68
69
* kill
70
new: simp eggs 1 0 1 0
71
setv var0 100
72
dbg: tslc var0
73
kill targ
74
subv var0 dbg: tslc
75
doif var0 eq 1
76
dbg: outs "ok 5"
77
else
78
dbg: outs "not ok 5"
79
endi
80
81
* pose
82
new: simp eggs 48 0 1 0
83
setv var0 100
84
dbg: tslc var0
85
pose 2
86
subv var0 dbg: tslc
87
doif var0 eq 1
88
dbg: outs "ok 6"
89
else
90
dbg: outs "not ok 6"
91
endi
92
kill targ
93
94
* anim
95
new: simp eggs 48 0 1 0
96
setv var0 100
97
dbg: tslc var0
98
anim [0101]
99
subv var0 dbg: tslc
100
doif var0 eq 1
101
dbg: outs "ok 7"
102
else
103
dbg: outs "not ok 7"
104
endi
105
kill targ
106
107
* loop..untl
108
setv var0 100
109
dbg: tslc var0
110
setv var1 0
111
loop
112
addv var1 1
113
untl var1 ge 3
114
subv var0 dbg: tslc
115
doif var0 eq 0
116
dbg: outs "ok 8"
117
else
118
dbg: outs "not ok 8"
119
endi
120
121
* stim
122
setv var0 100
123
dbg: tslc var0
124
stim shou 100 1 30 0 0 0 0 0 0 0 0 0
125
subv var0 dbg: tslc
126
doif var0 eq 0
127
dbg: outs "ok 9"
128
else
129
dbg: outs "not ok 9"
130
endi