]> gitweb.factorcode.org Git - factor.git/commitdiff
Literal aliens in source files are bade bad
authorSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Tue, 8 Jul 2008 20:46:52 +0000 (15:46 -0500)
committerSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Tue, 8 Jul 2008 20:46:52 +0000 (15:46 -0500)
extra/db/pools/pools-tests.factor
extra/io/pools/pools.factor
extra/windows/user32/user32.factor

index f0534a1d3420e828d166679037a3607eb730f9f7..34e072c3a527448b3f321f1c66d76077d278756b 100644 (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
index 0e37e41a76414a0c4c98efe4775e46bcf274f315..aa734e68094c552d56c7908e71aeb7e7824db7bd 100644 (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 ;
 
index 1c1df52da8ad949e8bd528f77f3e14a77631bd6b..241eddf9f0c825c7c8ff0f38dc8b2c609cc267c5 100755 (executable)
@@ -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