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=BAYES_00,FORGED_MUA_MOZILLA autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,5312057f44240abb X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.213.29.66 with SMTP id p2mr1601854ebc.4.1323207757119; Tue, 06 Dec 2011 13:42:37 -0800 (PST) Path: ty4ni11934bkb.0!nntp.google.com!news1.google.com!goblin2!goblin.stu.neva.ru!feeder.erje.net!news.internetdienste.de!news.tu-darmstadt.de!news.belwue.de!newsfeed.ision.net!newsfeed2.easynews.net!ision!newsfeed.arcor.de!newsspool2.arcor-online.net!news.arcor.de.POSTED!not-for-mail Date: Tue, 06 Dec 2011 22:42:35 +0100 From: Georg Bauhaus User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:8.0) Gecko/20111105 Thunderbird/8.0 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: AUnit: access to local procedure needed when asserting exception References: <4edd6c0a$0$6581$9b4e6d93@newsspool3.arcor-online.net> <4ede5c09$0$6567$9b4e6d93@newsspool4.arcor-online.net> In-Reply-To: Message-ID: <4ede8c4c$0$6570$9b4e6d93@newsspool4.arcor-online.net> Organization: Arcor NNTP-Posting-Date: 06 Dec 2011 22:42:36 CET NNTP-Posting-Host: 4f446fae.newsspool4.arcor-online.net X-Trace: DXC=h[_BejV8gUIh?0i>8D=81F<^iOIPP5 X-Complaints-To: usenet-abuse@arcor.de Xref: news1.google.com comp.lang.ada:19374 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Date: 2011-12-06T22:42:36+01:00 List-Id: On 06.12.11 21:02, Simon Wright wrote: >> procedure Generic_Assert_Exception >> (Message : String; >> Source : String := GNAT.Source_Info.File; >> Line : Natural := GNAT.Source_Info.Line) is >> begin >> begin >> Proc; >> exception >> when others => > ^^^^^^^^^^^ > > I quite often want to make sure that a specific exception has been > raised. Yes, me too. However, just like AUnit has only one Assert---suggesting that we should use Ada operators for different comparisons---I'd make the specific exception logic part of the operation. Then I have a kind of symmetry or mapping: I'd use operators with Assert and procedure'access (or generic actual) with Assert_Exception.