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=-0.4 required=5.0 tests=AC_FROM_MANY_DOTS,BAYES_00 autolearn=no 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 06:50:50 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!arclight.uoregon.edu!wn13feed!worldnet.att.net!207.217.77.102!newsfeed2.earthlink.net!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!stamper.news.atl.earthlink.net!harp.news.atl.earthlink.net!not-for-mail From: "Marin David Condic" Newsgroups: comp.lang.ada Subject: Re: Suggestion for gnatstub Date: Sat, 9 Nov 2002 09:50:29 -0500 Organization: MindSpring Enterprises Message-ID: References: <3dcb9e51$0$303$bed64819@news.gradwell.net> <3DCBC4C9.AD436CD9@earthlink.net> NNTP-Posting-Host: d1.56.b4.c5 X-Server-Date: 9 Nov 2002 14:50:50 GMT X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2314.1300 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Xref: archiver1.google.com comp.lang.ada:30645 Date: 2002-11-09T14:50:50+00:00 List-Id: 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. Generating an exception instead is dramatically less useful. To be able to successfully call the stub and move on with tests, you've got to hand modify the code. Not impossible, but it does add labor. MDC -- ====================================================================== Marin David Condic I work for: http://www.belcan.com/ My project is: http://www.jast.mil/ Send Replies To: m c o n d i c @ a c m . o r g "I'd trade it all for just a little more" -- Charles Montgomery Burns, [4F10] ====================================================================== 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).