Add tests that backtrace and backtrace_symbols produce correct results

Joseph S. Myers joseph@codesourcery.com
Sat Jan 19 22:26:00 GMT 2013


On Sat, 19 Jan 2013, Andreas Schwab wrote:

> "Joseph S. Myers" <joseph@codesourcery.com> writes:
> 
> > +  for (i = 0; i < n - 1; ++i)
> > +    if (strstr (symbols[i], "fn") == NULL)
> > +      {
> > +	FAIL ();
> 
> This always fails for do_test, and can also spuriously match the build
> directory name.

This code should not be called for the do_test frame; if it is, you have 
some other problem with the frames before do_test.  The code deliberately 
does not check for a function name for the do_test frame.

Making the tests more robust (to avoid spurious passes) regarding build 
directory names would indeed be worthwhile.

-- 
Joseph S. Myers
joseph@codesourcery.com



More information about the Libc-alpha mailing list