From c93b6c2e62a21de425ceff3ec9e4a5264e73142c Mon Sep 17 00:00:00 2001 From: adam Date: Sat, 11 Mar 2006 11:05:59 +0000 Subject: [PATCH] updated tests darcs-hash:20060311110559-5007d-9f985229684e88d62e83efdcb654c204d3c68438.gz --- tests/rotate.t | 40 ++++++++++++++++++++++++++++++++++++++++ tests/test.t | 17 +++++++++++++++++ tests/test2.t | 21 +++++++++------------ 3 files changed, 66 insertions(+), 12 deletions(-) create mode 100644 tests/rotate.t create mode 100644 tests/test.t diff --git a/tests/rotate.t b/tests/rotate.t new file mode 100644 index 0000000..570edda --- /dev/null +++ b/tests/rotate.t @@ -0,0 +1,40 @@ + + + ibex.log.warn("foog!"); + ibex.ui.frame = thisbox; + + // this thread makes things spin. + var rot = 0; + ibex.thread = function(f) { while(true) { + ibex.thread.yield(); + if (ibex.math.floor(rot / 90) == rot / 90) + $top.transform = "rotate(" + rot + ")"; + $bot.transform = "rotate(" + (-2 * rot) + ")"; + rot += 1; + } } + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/test.t b/tests/test.t new file mode 100644 index 0000000..162aa96 --- /dev/null +++ b/tests/test.t @@ -0,0 +1,17 @@ + + + ibex.ui.frame = thisbox; + + + + // this thread makes things spin. + var rot = 0; + ibex.thread = function(f) { while(true) { + ibex.thread.sleep(100); + $blue.transform = "rotate(" + rot + ")"; + $blue.x = 100; + $blue.y = 100; + rot += 5; + } } + + diff --git a/tests/test2.t b/tests/test2.t index 3dcc5e3..ce02efb 100644 --- a/tests/test2.t +++ b/tests/test2.t @@ -1,23 +1,20 @@ ibex.ui.frame = thisbox; - + // this thread makes things spin. var rot = 0; ibex.thread = function(f) { while(true) { - ibex.thread.yield(); -// if (ibex.math.floor(rot / 90) == rot / 90) -// $top.transform = "rotate(" + rot + ")"; -// $bot.transform = "rotate(" + (-2 * rot) + ")"; - $red.fill = "red"; - ibex.thread.yield(); - $red.fill = "green"; - ibex.thread.yield(); - rot += 1; + ibex.thread.sleep(100); + if (ibex.math.floor(rot / 90) == rot / 90) + $top.transform = "rotate(" + rot + ")"; + $bot.transform = "rotate(" + (-2 * rot) + ")"; + rot += 5; } } - + -- 1.7.10.4