From a6f8d0921424c37c1c9f2d68717ad3038b12cbd5 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Fri, 16 Jan 2009 22:48:07 -0600 Subject: [PATCH] Debugging --- .../dictionaries/dictionaries.factor | 3 +-- basis/core-text/core-text-tests.factor | 13 +++++++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/basis/core-foundation/dictionaries/dictionaries.factor b/basis/core-foundation/dictionaries/dictionaries.factor index dd2a5e1727..f38dc49ba8 100644 --- a/basis/core-foundation/dictionaries/dictionaries.factor +++ b/basis/core-foundation/dictionaries/dictionaries.factor @@ -21,8 +21,7 @@ FUNCTION: CFDictionaryRef CFDictionaryCreate ( : ( 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 ; \ No newline at end of file diff --git a/basis/core-text/core-text-tests.factor b/basis/core-text/core-text-tests.factor index ce943a371d..63fbdef3ac 100644 --- a/basis/core-text/core-text-tests.factor +++ b/basis/core-text/core-text-tests.factor @@ -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 CFRelease ] unit-test \ No newline at end of file +[ ] [ "Helvetica" 12 CFRelease ] unit-test + +[ ] [ + [ + kCTFontAttributeName "Helvetica" 64 &CFRelease 2array 1array + &CFRelease drop + ] with-destructors +] unit-test \ No newline at end of file