Re: some incorret asserts in AW


Subject: Re: some incorret asserts in AW
From: Thomas Fletcher (thomasf@qnx.com)
Date: Thu Oct 26 2000 - 07:04:40 CDT


On Thu, 26 Oct 2000, Dom Lachowicz wrote:

> I think that this goes deeper:
>
> A lot of code in places has UT_ASSERT in them, when I think they want
> behavior more like g_return(_val)_if_fail that glib provides. UT_Vector
> displays this nicely. Anyone agree/disagree or mind if I go through and
> maybe make a couple of new macros more like the glib ones and use them
> incrementally in the codebase?
>
> Dom

I think that it goes even deeper than this =;-). Those asserts
are in there for a reason. We should find out why they are being
triggered in the first place. If it is as a result in a change
of assumptions then it may be fine to just return. In this case
we can just get rid of the assertion all together. Making it
actually stop is useful since it is the worse kind of "nag" that
there is something not right. My personal opinion is that we
should examine these issues before we move on to adding other
features ... that said I've been no better than anyone else at
actually fixing these conditions.

Just me two bits,
  Thomas

> #define UT_RETURN_IF_FAIL(x) do { if(!(x)) { \
> UT_DEBUGMSG(("Assertion failed file %s line %d\n", __FILE__, __LINE__));
> \
> return; \
> }} while(0)
> #define UT_RETURN_VAL_IF_FAIL(x,v) do {if(!(x)) {\
> UT_DEBUGMSG(("Assertion failed file %s line %d\n", __FILE__, __LINE__));\
> return(v); \
> }} while (0)
>
> >From: Vlad Harchev <hvv@hippo.ru>
> >To: abiword-dev@abisource.com
> >Subject: some incorret asserts in AW
> >Date: Thu, 26 Oct 2000 12:25:18 +0500 (SAMST)
> >
> >
> > I think stability of AW could be greatly improved if several asserts were
> >using correct expressions to be asserted.
> > Here are asserts that are violated when pressing some key sequences in
> >empty
> >document.
> >
> >* Pressing Backspace :
> > (0) at fl_DocLayout.cpp:443
> >
> >* Pressing shift-{left,right} arrow in empty document:
> > m_bCursorIsOn == UT_FALSE at fv_View.cpp:4731
> >
> >* Pressing enter, up, delete:
> > m_iCount > 0 at ut_vector.cpp:200
> >
> >* pressing enter, backspace:
> > m_iCount > 0 at ut_vector.cpp:200
> >
> > Could someone fix these?
> >
> > I'm currently using "yes | abiword" to get rock-solid AW (works if
> >it's compiled with debug enabled) :)
> >
> > Best regards,
> > -Vlad
> >
> >
>
> _________________________________________________________________________
> Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
>
> Share information about yourself, create your own public profile at
> http://profiles.msn.com.
>
>

-------------------------------------------------------------
Thomas (toe-mah) Fletcher QNX Software Systems
thomasf@qnx.com Neutrino Development Group
(613)-591-0931 http://www.qnx.com/~thomasf



This archive was generated by hypermail 2b25 : Thu Oct 26 2000 - 07:03:04 CDT