Boost logo

Boost Testing :

From: Victor A. Wagner Jr. (vawjr_at_[hidden])
Date: 2005-05-01 20:10:22

At Saturday 2005-04-30 08:14, you wrote:

>On Apr 30, 2005, at 3:06 AM, Victor A. Wagner Jr. wrote:
>>At Friday 2005-04-29 20:39, you wrote:
>>>On Apr 29, 2005, at 1:55 PM, Victor A. Wagner Jr. wrote:
>>>>shows an error that should be trivial to find (and I'd get to practice
>>>>with the new beta).
>>>>Unfortunately, I can't figure out how to build and run the test under
>>>>the debugger.
>>>>I get missing symbols from the test framework.... any help would be
>>>For debugging, you should probably comment out the line in
>>>libs/graph/build/Jamfile that starts with:
>>> <debug-symbols>off
>>>Then rebuild the graphviz_test. Thanks for looking into this!
>>I'm trying to figure out how to build it at all, and after I do, how to
>>get the debugger to grab onto it.
>After commenting out that <debug-symbols>off line, you should be able to
>just run
> bjam -sTOOLS=vc-8_0 graphviz_test
>from libs/graph/test. It'll run the test, fail miserably, then it should
>leave the executable around for debugging, which should work fine in the
>normal debugger.

actually it was a bit better than that.. I didn't have to rebuild the test
at all, apparently whatever gets built already has symbols in it.

Ok, the obvious thing is that the error says "can't dereference auto_ptr"
the reason it cannot dereference it, is the pointer is 0 and the statement is:
return *m_property;
and the return type is Property&
this makes the program (from [Note: in particular, a null
reference cannot exist in a well-defined program, because the only way to
create such a reference would be to bind it to the "object" obtained by
dereferencing a null pointer, which causes undefined behavior.) not

I thought I could do a simple fix, but alas, there isn't any way outside of
the class to access whether the auto_ptr is actually pointing at something.

just to add a little more confusion to attempting to fix this (by someone
not _intimately_ familiar with the product) is the fact that there are
two(2) different flavors of methods called "get_property".
one of them returns a Property*
the others return a Property&
(other than to comment that this is certainly fraught with danger for
writing correct code, I'll not comment further)
This makes it impractical for me to determine how to approach fixing this
it _appears_ that almost everyone who calls get_property() almost
immediately turns the return into a pointer to hand it off to some other
function, so I'm somewhat baffled as to why anyone would choose to return a
reference since


is undefined behavior.

At any rate, I've got a ton to do before heading out Wednesday morning for
an out of town job interview. I'll pretty much be offline starting at 2005
May 4 0500 -0700 for almost a week.
I'm sorry I don't have time to actually fix this.

> Doug
>Boost-Testing mailing list

Victor A. Wagner Jr.
The five most dangerous words in the English language:
               "There oughta be a law"

Boost-testing list run by mbergal at