]> gitweb.factorcode.org Git - factor.git/commitdiff
Fix unit test failures caused by alien.data change
authorSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Sun, 26 Dec 2010 06:34:12 +0000 (22:34 -0800)
committerSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Sun, 26 Dec 2010 06:34:12 +0000 (22:34 -0800)
basis/alien/data/data-docs.factor
basis/alien/data/data-tests.factor
basis/alien/fortran/fortran-tests.factor
basis/compiler/tree/cleanup/cleanup-tests.factor
basis/specialized-arrays/specialized-arrays-tests.factor
core/io/encodings/utf16n/utf16n-tests.factor

index 7828b3896ff8919a57df08d48042cf24a6685e21..e860ff688948f554da1b4e20a7d949b3d1ec049d 100644 (file)
@@ -1,7 +1,7 @@
 USING: alien alien.c-types help.syntax help.markup libc
 kernel.private byte-arrays math strings hashtables alien.syntax
 alien.strings sequences io.encodings.string debugger destructors
-vocabs.loader classes.struct quotations ;
+vocabs.loader classes.struct quotations kernel ;
 IN: alien.data
 
 HELP: <c-array>
@@ -189,14 +189,14 @@ $nl
 "For example, if a C function returns a " { $link c-string } " but stipulates that the caller must deallocate the memory afterward, you must define the function as returning " { $snippet "char*" } " and call " { $link (free) } " yourself." ;
 
 HELP: <ref>
-{ $values { "c-type" "a C type" } }
+{ $values { "value" object } { "c-type" "a C type" } { "c-ptr" c-ptr } }
 { $description "Creates a new byte array to store a Factor object as a C value." }
 { $examples
     { $example "USING: alien.c-types alien.data prettyprint sequences ;" "123 int <ref> length ." "4" }
 } ;
 
 HELP: deref
-{ $values { "c-type" "a C type" } }
+{ $values { "c-ptr" c-ptr } { "c-type" "a C type" } { "value" object } }
 { $description "Loads a C value from a byte array." }
 { $examples
     { $example "USING: alien.c-types alien.data prettyprint sequences ;" "321 int <ref> int deref ." "321" }
index 33ee26dc28b1ba7996cbd8342d39219d9f4a1d37..7d53c71815c79523baea390a5a3f0685aef58392 100644 (file)
@@ -1,31 +1,32 @@
-USING: alien alien.c-types alien.data alien.syntax
+USING: alien alien.data alien.syntax
 classes.struct kernel sequences specialized-arrays
-specialized-arrays.private tools.test compiler.units vocabs ;
+specialized-arrays.private tools.test compiler.units vocabs
+system ;
+QUALIFIED-WITH: alien.c-types c
 IN: alien.data.tests
 
-
-[ -1 ] [ -1 char <ref> char deref ] unit-test
-[ -1 ] [ -1 short <ref> short deref ] unit-test
-[ -1 ] [ -1 int <ref> int deref ] unit-test
+[ -1 ] [ -1 c:char <ref> c:char deref ] unit-test
+[ -1 ] [ -1 c:short <ref> c:short deref ] unit-test
+[ -1 ] [ -1 c:int <ref> c:int deref ] unit-test
 
 ! I don't care if this throws an error or works, but at least
 ! it should be consistent between platforms
-[ -1 ] [ -1.0 int <ref> int deref ] unit-test
-[ -1 ] [ -1.0 long <ref> long deref ] unit-test
-[ -1 ] [ -1.0 longlong <ref> longlong deref ] unit-test
-[ 1 ] [ 1.0 uint <ref> uint deref ] unit-test
-[ 1 ] [ 1.0 ulong <ref> ulong deref ] unit-test
-[ 1 ] [ 1.0 ulonglong <ref> ulonglong deref ] unit-test
+[ -1 ] [ -1.0 c:int <ref> c:int deref ] unit-test
+[ -1 ] [ -1.0 c:long <ref> c:long deref ] unit-test
+[ -1 ] [ -1.0 c:longlong <ref> c:longlong deref ] unit-test
+[ 1 ] [ 1.0 c:uint <ref> c:uint deref ] unit-test
+[ 1 ] [ 1.0 c:ulong <ref> c:ulong deref ] unit-test
+[ 1 ] [ 1.0 c:ulonglong <ref> c:ulonglong deref ] unit-test
 
 [
-    0 B{ 1 2 3 4 } <displaced-alien> void* <ref>
+    0 B{ 1 2 3 4 } <displaced-alien> c:void* <ref>
 ] must-fail
 
 os windows? cpu x86.64? and [
-    [ -2147467259 ] [ 2147500037 long <ref> long deref ] unit-test
+    [ -2147467259 ] [ 2147500037 c:long <ref> c:long deref ] unit-test
 ] when
 
-STRUCT: foo { a int } { b void* } { c bool } ;
+STRUCT: foo { a c:int } { b c:void* } { c c:bool } ;
 
 SPECIALIZED-ARRAY: foo
 
index 38e0d5f27a41e1d24c5e3f3ab8328b4f85fd8491..ad2a60ddc47f968813b5eb927252ed6d241a25a8 100644 (file)
@@ -239,7 +239,7 @@ intel-unix-abi fortran-abi [
 
     [ [
         ! [<fortran-result>]
-        [ complex-float <c-object> ] 1 ndip
+        [ complex-float heap-size <byte-array> ] 1 ndip
         ! [fortran-args>c-args]
         { [ { [ ] } spread ] [ { [ drop ] } spread ] } 1 ncleave
         ! [fortran-invoke]
index aedab2b40c098439cb4d2a98f326f9ba674b273d..dfce70ae38107234aecacf686d9a33393dbef725 100644 (file)
@@ -1,11 +1,11 @@
 USING: tools.test kernel.private kernel arrays sequences
 math.private math generic words quotations alien alien.c-types
-strings sbufs sequences.private slots.private combinators
-definitions system layouts vectors math.partial-dispatch
-math.order math.functions accessors hashtables classes assocs
-io.encodings.utf8 io.encodings.ascii io.encodings fry slots
-sorting.private combinators.short-circuit grouping prettyprint
-generalizations
+alien.data strings sbufs sequences.private slots.private
+combinators definitions system layouts vectors
+math.partial-dispatch math.order math.functions accessors
+hashtables classes assocs io.encodings.utf8 io.encodings.ascii
+io.encodings fry slots sorting.private combinators.short-circuit
+grouping prettyprint generalizations
 compiler.tree
 compiler.tree.combinators
 compiler.tree.cleanup
@@ -521,8 +521,6 @@ cell-bits 32 = [
     ] cleaned-up-tree nodes>quot
 ] unit-test
 
-USING: alien alien.c-types ;
-
 [ t ] [
     [ int { } cdecl [ 2 2 + ] alien-callback ]
     { + } inlined?
index 02424a22fdc68cc9cd9c7b1a4ec521fa8c353177..e3770220e89e8f878cbd6b250c8fe894159f249c 100644 (file)
@@ -6,7 +6,8 @@ multiline eval words vocabs namespaces assocs prettyprint
 alien.data math.vectors definitions compiler.test ;
 FROM: specialized-arrays.private => specialized-array-vocab ;
 FROM: alien.c-types => int float bool char float ulonglong ushort uint
-heap-size little-endian? ;
+heap-size ;
+FROM: alien.data => little-endian? ;
 IN: specialized-arrays.tests
 
 SPECIALIZED-ARRAY: int
index 9f3f35ff2a7136f01ab3256eee86f100e025d970..96c4c29265b50ac31ea84a4cfcb7a29f6d356ba1 100644 (file)
@@ -1,4 +1,4 @@
-USING: accessors alien.c-types kernel
+USING: accessors alien.c-types alien.data kernel
 io.encodings.utf16 io.streams.byte-array tools.test ;
 IN: io.encodings.utf16n