comp.lang.ada
 help / color / mirror / Atom feed
From: Simon Wright <simon@pushface.org>
Subject: Re: Suggestion for gnatstub
Date: 09 Nov 2002 20:05:44 +0000
Date: 2002-11-09T20:05:44+00:00	[thread overview]
Message-ID: <x7v8z0233vr.fsf@smaug.pushface.org> (raw)
In-Reply-To: aqj7ca$44t$1@slb4.atl.mindspring.net

"Marin David Condic" <mcondic.auntie.spam@acm.org> writes:

(posting after the thing he's replying to! please don't!!)

> Simon Wright <simon@pushface.org> wrote in message
> news:x7vn0oizv5j.fsf@smaug.pushface.org...
> >
> > My ColdFrame framework generator goes to a lot of trouble to generate
> > compilable subprograms that raise Program_Error if executed. I think
> > there is one case where this doesn't work (functions returning a value
> > of an imported type, eg GNAT.Socket_Type, that turns out to be
> > private).

> Well, yeah, but that's exactly what I *don't* want. I'd like a stub
> generator that built something that would execute without raising an
> exception. (Unless, of course, there was something else wrong with the code.
> Id est, returning some default value that caused a calculation to go awry.)
> 
> I used to have a stub generator of my own that worked with Ada83 code.
> Procedures simply had a "null ;" statement. Functions would declare a
> temporary variable of the return type and to the extent that the tool could
> figure out the kind of type it was, it provided an initial value to the
> temporary. Then it just generated a "return Temp ;" statement. 99.9% of the
> time, what it built was "Good Enough" for testing purposes. Occasionally,
> you'd have to add some modifications by hand to get something usable as a
> stub. But the point was, for getting a set of stubs built for
> quick-and-dirty Smoke Testing, it saved a bunch of time. You could run your
> main program and test its behavior and do iterative builds as you went
> along.

One of the advantages of an open code gnerator is that you can fix it
to do this sort of thing.

However, I would seriously question what you're suggesting. I don't
want the slightest chance that code like this could make it into the
delivered system unnoticed. And what value can there possibly be in a
test that doesn't pick up the fact that values being returned are
arbitrarily different from what they should be?



  reply	other threads:[~2002-11-09 20:05 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-08 11:14 Suggestion for gnatstub Victor Porton
2002-11-08 12:56 ` Marc A. Criley
2002-11-08 13:23   ` Marin David Condic
2002-11-08 21:09     ` chris.danx
2002-11-15 17:08       ` Wes Groleau
2002-11-15 17:35         ` Stephen Leake
2002-11-16 14:36         ` Marin David Condic
2002-11-09 14:15     ` Simon Wright
2002-11-09 14:50       ` Marin David Condic
2002-11-09 20:05         ` Simon Wright [this message]
2002-11-10 15:58           ` Marin David Condic
2002-11-10 20:31             ` Robert A Duff
2002-11-11 13:46               ` Marin David Condic
2002-11-11 15:31                 ` Robert A Duff
2002-11-11 20:32                   ` Randy Brukardt
2002-11-11  6:31             ` Simon Wright
2002-11-09 15:44       ` Robert A Duff
2002-11-09 20:08         ` Simon Wright
2002-11-09 21:56           ` Robert A Duff
2002-11-10  8:42             ` Pascal Obry
2002-11-10 12:20               ` Simon Wright
2002-11-10 16:04               ` Marin David Condic
2002-11-14 20:10               ` Robert I. Eachus
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox