Sorry for the late reply, I've applied this patch together with your NO_UI patch for factor.sh.
On Tue, Dec 29, 2009 at 3:05 PM, Alec Berryman <[email protected]> wrote: > The error string is looked up in an array, but because zlib > error codes are negative, the error's string was always "f". > --- > > Two quick notes: > > - zlib-tests: QUALIFIED-WITH used because compression.zlib.ffi also has > a word "compress" > > - zlib: make sure to flip the sign after "dup" so that the error code > stays negative > > > basis/compression/zlib/zlib-tests.factor | 5 ++++- > basis/compression/zlib/zlib.factor | 4 +++- > 2 files changed, 7 insertions(+), 2 deletions(-) > > diff --git a/basis/compression/zlib/zlib-tests.factor > b/basis/compression/zlib/zlib-tests.factor > index 1baeba7..b9bc502 100644 > --- a/basis/compression/zlib/zlib-tests.factor > +++ b/basis/compression/zlib/zlib-tests.factor > @@ -1,9 +1,12 @@ > ! Copyright (C) 2009 Doug Coleman. > ! See http://factorcode.org/license.txt for BSD license. > -USING: kernel tools.test compression.zlib classes ; > +USING: accessors kernel tools.test compression.zlib classes ; > +QUALIFIED-WITH: compression.zlib.ffi ffi > IN: compression.zlib.tests > > : compress-me ( -- byte-array ) B{ 1 2 3 4 5 } ; > > [ t ] [ compress-me [ compress uncompress ] keep = ] unit-test > [ t ] [ compress-me compress compressed instance? ] unit-test > + > +[ ffi:Z_DATA_ERROR zlib-error-message ] [ string>> "data error" = ] > must-fail-with > diff --git a/basis/compression/zlib/zlib.factor > b/basis/compression/zlib/zlib.factor > index 7818173..83c3e4e 100644 > --- a/basis/compression/zlib/zlib.factor > +++ b/basis/compression/zlib/zlib.factor > @@ -19,7 +19,9 @@ ERROR: zlib-failed n string ; > dup compression.zlib.ffi:Z_ERRNO = [ > drop errno "native libc error" > ] [ > - dup { > + dup > + -1 * ! zlib error codes are negative > + { > "no error" "libc_error" > "stream error" "data error" > "memory error" "buffer error" "zlib version error" > -- > 1.6.5 > > > > ------------------------------------------------------------------------------ > This SF.Net email is sponsored by the Verizon Developer Community > Take advantage of Verizon's best-in-class app development support > A streamlined, 14 day to market process makes app distribution fast and easy > Join now and get one step closer to millions of Verizon customers > http://p.sf.net/sfu/verizon-dev2dev > _______________________________________________ > Factor-talk mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/factor-talk > ------------------------------------------------------------------------------ This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers http://p.sf.net/sfu/verizon-dev2dev _______________________________________________ Factor-talk mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/factor-talk
