Literal aliens in source files are bade bad

db4
Slava Pestov 2008-07-08 15:46:52 -05:00
parent 7248af54cc
commit 6ad09779cc
3 changed files with 20 additions and 6 deletions

View File

@ -1,8 +1,22 @@
IN: db.pools.tests
USING: db.pools tools.test ;
USING: db.pools tools.test continuations io.files namespaces
accessors kernel math destructors ;
\ <db-pool> must-infer
{ 2 0 } [ [ ] with-db-pool ] must-infer-as
{ 1 0 } [ [ ] with-pooled-db ] must-infer-as
! Test behavior after image save/load
USE: db.sqlite
[ "pool-test.db" temp-file delete-file ] ignore-errors
[ ] [ "pool-test.db" sqlite-db <db-pool> "pool" set ] unit-test
[ ] [ "pool" get expired>> t >>expired drop ] unit-test
[ ] [ 1000 [ "pool" get [ ] with-pooled-db ] times ] unit-test
[ ] [ "pool" get dispose ] unit-test

View File

@ -9,7 +9,7 @@ TUPLE: pool connections disposed expired ;
: check-pool ( pool -- )
dup check-disposed
dup expired>> expired? [
ALIEN: 31337 >>expired
31337 <alien> >>expired
connections>> delete-all
] [ drop ] if ;

View File

@ -1285,10 +1285,10 @@ FUNCTION: void SetLastErrorEx ( DWORD dwErrCode, DWORD dwType ) ;
! FUNCTION: SetWindowPlacement
FUNCTION: BOOL SetWindowPos ( HWND hWnd, HWND hWndInsertAfter, int X, int Y, int cx, int cy, UINT uFlags ) ;
: HWND_BOTTOM ALIEN: 1 ;
: HWND_NOTOPMOST ALIEN: -2 ;
: HWND_TOP ALIEN: 0 ;
: HWND_TOPMOST ALIEN: -1 ;
: HWND_BOTTOM ( -- alien ) 1 <alien> ;
: HWND_NOTOPMOST ( -- alien ) -2 <alien> ;
: HWND_TOP ( -- alien ) 0 <alien> ;
: HWND_TOPMOST ( -- alien ) -1 <alien> ;
! FUNCTION: SetWindowRgn
! FUNCTION: SetWindowsHookA