]> gitweb.factorcode.org Git - factor.git/commitdiff
Remove obsolete file, add unit tests for core-foundation.run-loop, add <CFTimer>...
authorSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Fri, 12 Dec 2008 08:18:50 +0000 (02:18 -0600)
committerSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Fri, 12 Dec 2008 08:18:50 +0000 (02:18 -0600)
basis/core-foundation/core-foundation-tests.factor [deleted file]
basis/core-foundation/timers/timers.factor
basis/io/unix/multiplexers/run-loop/run-loop-tests.factor [new file with mode: 0644]

diff --git a/basis/core-foundation/core-foundation-tests.factor b/basis/core-foundation/core-foundation-tests.factor
deleted file mode 100644 (file)
index c1d6788..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-! Copyright (C) 2008 Slava Pestov.
-! See http://factorcode.org/license.txt for BSD license.
-USING: core-foundation tools.test kernel ;
-IN: core-foundation
-
-[ ] [ "Hello" <CFString> CFRelease ] unit-test
-[ "Hello" ] [ "Hello" <CFString> [ CF>string ] [ CFRelease ] bi ] unit-test
-[ "Hello\u003456" ] [ "Hello\u003456" <CFString> [ CF>string ] [ CFRelease ] bi ] unit-test
-[ "Hello\u013456" ] [ "Hello\u013456" <CFString> [ CF>string ] [ CFRelease ] bi ] unit-test
index eddeb87d1d1767ff2827121b08b3eb7219fc7348..1d17d99a4d54dd8ef5dab1e16f465b45401ae921 100644 (file)
@@ -1,6 +1,6 @@
 ! Copyright (C) 2008 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: alien.syntax ;
+USING: alien.syntax system math kernel ;
 IN: core-foundation.timers
 
 TYPEDEF: void* CFRunLoopTimerRef
@@ -17,9 +17,12 @@ FUNCTION: CFRunLoopTimerRef CFRunLoopTimerCreate (
    CFRunLoopTimerContext* context
 ) ;
 
+: <CFTimer> ( callback -- timer )
+    [ f millis 1000 /f 60 0 0 ] dip f CFRunLoopTimerCreate ;
+
 FUNCTION: void CFRunLoopTimerInvalidate (
    CFRunLoopTimerRef timer
-);
+) ;
 
 FUNCTION: void CFRunLoopTimerSetNextFireDate (
    CFRunLoopTimerRef timer,
diff --git a/basis/io/unix/multiplexers/run-loop/run-loop-tests.factor b/basis/io/unix/multiplexers/run-loop/run-loop-tests.factor
new file mode 100644 (file)
index 0000000..5f249c6
--- /dev/null
@@ -0,0 +1,5 @@
+USING: io.unix.multiplexers.run-loop tools.test
+destructors ;
+IN: io.unix.multiplexers.run-loop.tests
+
+[ ] [ <run-loop-mx> dispose ] unit-test