info-sather
[Top][All Lists]
Advanced

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

Re : Pre/post conditions not working?


From: fospot-gnu
Subject: Re : Pre/post conditions not working?
Date: Fri, 14 Jan 2011 05:37:33 +0000 (GMT)

Hello Marek,

Ok.
I was also surprised to learn that the compiler does not check preconditions by default.

Just append "-chk" to your sacomp statement.

It is an alias to "-chk_all all" which will make sure that all checks will occur in all classes.
(I got that from the sacomp man page)

(BTW, thanks for asking questions, it "forces" me to look for info :-) ).

Best regards,
Fadi.

Marek Janukowicz wrote:
>
> Hello again
>
> Are pre/post conditions supported by default? I have a test program:
> class MAIN is
> [...]
>  create( a : INT ) : SAME 
>    pre a < 10
>    post self.a < 5
>  is
> [...]
>  main 
>    pre 1 > 2
>    post 1 > 2
>  is
> [...]
>
> and it doesn't raise any error, displaying the messages (as it should if the 
> preconditions were not there). Do I need to somehow switch on with some
> compiler switch?
>
>-- 
> Marek Janukowicz


reply via email to

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