2013-06-24 02:36:52 +00:00
|
|
|
#include "test-harness.h"
|
|
|
|
|
|
|
|
.void() think;
|
|
|
|
.float nextthink;
|
|
|
|
.float frame;
|
|
|
|
entity self;
|
|
|
|
float time;
|
|
|
|
|
|
|
|
$frame frame0 frame1 frame2 frame3
|
|
|
|
|
|
|
|
void
|
|
|
|
state0 (void)
|
2023-02-08 02:18:42 +00:00
|
|
|
>> [$frame1, state1]
|
2013-06-24 02:36:52 +00:00
|
|
|
{
|
|
|
|
if (self.frame != $frame1 || self.think != state1
|
2020-02-14 11:08:59 +00:00
|
|
|
|| self.nextthink != 0.1f) {
|
2013-06-24 02:36:52 +00:00
|
|
|
printf ("state0: %g %x %g\n", self.frame, self.think, self.nextthink);
|
|
|
|
exit (1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
state1 (void)
|
2023-02-08 02:18:42 +00:00
|
|
|
>> [$frame2, state2, 0.2f]
|
2013-06-24 02:36:52 +00:00
|
|
|
{
|
|
|
|
if (self.frame != $frame2 || self.think != state2
|
2020-02-14 11:08:59 +00:00
|
|
|
|| self.nextthink != 0.2f) {
|
2021-07-15 07:55:02 +00:00
|
|
|
printf ("state1: %g %x %g\n", self.frame, self.think, self.nextthink);
|
2013-06-24 02:36:52 +00:00
|
|
|
exit (1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
state2 (void)
|
2023-02-08 02:18:42 +00:00
|
|
|
>> [$frame0, state0, 0.5f]
|
2013-06-24 02:36:52 +00:00
|
|
|
{
|
|
|
|
if (self.frame != $frame0 || self.think != state0
|
2020-02-14 11:08:59 +00:00
|
|
|
|| self.nextthink != 0.5f) {
|
2021-07-15 07:55:02 +00:00
|
|
|
printf ("state2: %g %x %g\n", self.frame, self.think, self.nextthink);
|
2013-06-24 02:36:52 +00:00
|
|
|
exit (1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
main ()
|
|
|
|
{
|
|
|
|
self = spawn ();
|
|
|
|
state0();
|
|
|
|
while (self.frame != $frame0) {
|
|
|
|
self.think();
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|