Debugging <CFDictionary>

db4
Slava Pestov 2009-01-16 22:48:07 -06:00
parent 0086369302
commit a6f8d09214
2 changed files with 12 additions and 4 deletions

View File

@ -21,8 +21,7 @@ FUNCTION: CFDictionaryRef CFDictionaryCreate (
: <CFDictionary> ( alist -- dictionary )
[ kCFAllocatorDefault ] dip
unzip [ >void*-array ] bi@
dup length "void*" heap-size /i
[ [ underlying>> ] bi@ ] dip
[ [ underlying>> ] bi@ ] [ nip length "void*" heap-size /i ] 2bi
&: kCFTypeDictionaryCallBacks
&: kCFTypeDictionaryValueCallbacks
CFDictionaryCreate ;

View File

@ -1,6 +1,15 @@
! Copyright (C) 2009 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: tools.test core-text core-foundation ;
USING: tools.test core-text core-foundation
core-foundation.dictionaries destructors
arrays kernel ;
IN: core-text.tests
[ ] [ "Helvetica" 12 <CTFont> CFRelease ] unit-test
[ ] [ "Helvetica" 12 <CTFont> CFRelease ] unit-test
[ ] [
[
kCTFontAttributeName "Helvetica" 64 <CTFont> &CFRelease 2array 1array
<CFDictionary> &CFRelease drop
] with-destructors
] unit-test