lumiera_/tests/10timefunctions.tests

58 lines
1,021 B
Text
Raw Normal View History

2007-08-21 17:33:19 +02:00
2007-08-24 06:02:51 +02:00
TESTING "Time functions" ./test-time
2007-08-21 17:33:19 +02:00
2007-08-24 06:02:51 +02:00
TEST "time init" init 15 500000 <<END
out: 15 500000
END
TEST "time normalize" init 0 1500000 <<END
out: 1 500000
END
TEST "time to float" todouble 15 500000 <<END
2007-08-23 06:57:08 +02:00
out: 15.5
END
2007-08-24 06:02:51 +02:00
TEST "time to float, NULL gives a NaN" todoublenull <<END
out: nan
END
TEST "float to time" fromdouble 33.6666666661 <<END
2007-08-23 06:57:08 +02:00
out: 33 666667
END
2007-08-24 06:02:51 +02:00
TEST "float to time, round down" fromdouble 0.00000049 <<END
out: 0 0
END
TEST "float to time, round up" fromdouble 0.0000005 <<END
out: 0 1
2007-08-23 06:57:08 +02:00
END
2007-08-24 06:02:51 +02:00
TEST "current time" currenttime <<END
2007-08-23 06:57:08 +02:00
return: 0
END
2007-08-24 06:02:51 +02:00
TEST "add time, normalized" add 1000001 2000002 <<END
out: 3 3
2007-08-23 06:57:08 +02:00
END
2007-08-24 06:02:51 +02:00
TEST "substract time, normalized" sub 3000003 2000002 <<END
out: 1 1
2007-08-23 06:57:08 +02:00
END
PLANNED "overflow"
PLANNED "underflow"
2007-08-21 17:33:19 +02:00
# the next ones for different common framerates, check corner cases
PLANNED "time to frame"
PLANNED "frame to time"
# how long are N frames on average (beware of precision!)
PLANNED "frame duration"
# how much frames fall in a certain timerange
PLANNED "frames in range"