comp.lang.ada
 help / color / mirror / Atom feed
From: Dale Stanbrough <dale@goanna.cs.rmit.edu.au>
Subject: Re: Assertion Error
Date: 1998/02/03
Date: 1998-02-03T00:00:00+00:00	[thread overview]
Message-ID: <6b64u1$cjd$1@goanna.cs.rmit.edu.au> (raw)
In-Reply-To: 6b3oi8$osq$1@gte1.gte.net


"Got a problem:
 
   When compiling code being ported from another platform, we get an
 "assertion error".   We are using the Rational VADS system on Solaris.  
Can
 someone explain to me what the meaning is and what we might  possibly do
to
 remedy the problem?"


You make lots of assertions about programs when you write them. Most are
in the form of type declarations ('this variable is used to hold integer
values'). Some are about the valid range of values it may hold ('this
variable can only have values b/w 1 and 10'). Other things you may
want to assert may not be directly expressed using language features
but can be in the form of a boolean expression (e.g. 'this pointer is now
non null'). Somewhere, some clever person has put an assertion in your
code, and now some fundamental assumption that they made (either about
the environment, or how the program is to work) has been broken, and
your software is kindly telling you about it.

Typically assertions look like a procedure call...

	assert (ptr /= null);
	
	assert (x in 1..40);
	
	assert (present (language_list, "Ada"));

and raise an exception when the boolean expression evaluates to false.

Dale




  parent reply	other threads:[~1998-02-03  0:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <6b3oi8$osq$1@gte1.gte.net>
1998-02-02  0:00 ` Assertion Error Matthew Heaney
1998-02-03  0:00 ` Dale Stanbrough [this message]
1998-02-03  0:00   ` Reusability and assertions (Was: Assertion Error) Michel Gauthier
replies disabled

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