Remove obsolete file, add unit tests for core-foundation.run-loop, add <CFTimer> word

db4
Slava Pestov 2008-12-12 02:18:50 -06:00
parent 36c36a7f83
commit 0ba2c964af
3 changed files with 10 additions and 11 deletions

View File

@ -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

View 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,

View File

@ -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