From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,34872f3f22b5b140 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-11-09 12:05:39 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed.wirehub.nl!kibo.news.demon.net!news.demon.co.uk!demon!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Suggestion for gnatstub Date: 09 Nov 2002 20:05:44 +0000 Organization: Pushface Sender: simon@smaug.pushface.org Message-ID: References: <3dcb9e51$0$303$bed64819@news.gradwell.net> <3DCBC4C9.AD436CD9@earthlink.net> NNTP-Posting-Host: pogner.demon.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: news.demon.co.uk 1036872338 8339 62.49.19.209 (9 Nov 2002 20:05:38 GMT) X-Complaints-To: abuse@demon.net NNTP-Posting-Date: Sat, 9 Nov 2002 20:05:38 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 Xref: archiver1.google.com comp.lang.ada:30667 Date: 2002-11-09T20:05:44+00:00 List-Id: "Marin David Condic" writes: (posting after the thing he's replying to! please don't!!) > Simon Wright 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?