From: adam Date: Sat, 11 Mar 2006 11:05:59 +0000 (+0000) Subject: updated tests X-Git-Url: http://git.megacz.com/?p=org.ibex.core.git;a=commitdiff_plain;h=c93b6c2e62a21de425ceff3ec9e4a5264e73142c updated tests darcs-hash:20060311110559-5007d-9f985229684e88d62e83efdcb654c204d3c68438.gz --- 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; } } - +