chicken-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-hackers] incorrect warning during compilation


From: Peter Bex
Subject: Re: [Chicken-hackers] incorrect warning during compilation
Date: Fri, 11 Jul 2014 10:37:00 +0200
User-agent: Mutt/1.4.2.3i

On Fri, Jul 11, 2014 at 10:32:23AM +0200, Kristian Lein-Mathisen wrote:
> I've tried to modify the way test works, too, I've concluded it's very
> messy. It's not very modular, so you have to copy-paste parts of the
> original and do your modifications there. It gave me the idea to write a
> new test egg with the same simple API but where it somehow was easier to
> modify the output like you describe.
> 
> Is your proposal to create a new test-egg-inspired test unit in core?

Yes.

> > Anyway, your test would probably succeed even if the pointer type would
> > be incorrect.  It would just compile with a warning (which gets lost
> > in the noise).  If you change the index to 1 or 2, it might be a better
> > test since it would fail when the pointer type would be anything larger
> > than a char due to the address calculation ending up somewhere beyond
> > the string.  Additionally, we could compile the test with -Wall -Werror
> > for example, to catch C type errors.  Would you care to write a complete
> > patch to add FFI tests?  You can mail it with "git format-patch"
> 
> Of course, how silly of me! That should have been x[1]='B' and change input
> to "AxC". Writing good tests, I guess, is always a challenge.

It's never easy :)

> I could put some tests down, but I wouldn't know where to start.

Well, the test you posted is a good start.  Just work your way through
the various type specifiers.

> What would be "complete"?

Don't worry about being absolutely complete; we never do that anywhere.
It's good to have at least the basics covered, we can always add more
tests later.  Besides, running the tests should not take ages.

> Perhaps we could put this on the agenda for T-DOSE? I think
> that could be fun!

Sure, we could work on that together.

Cheers,
Peter
-- 
http://www.more-magic.net



reply via email to

[Prev in Thread] Current Thread [Next in Thread]