Francois Schoubben wrote:
I'd like to know, if the way i do my tests is the right way...
Genrally yes.
fsc04 and fsc05 are not range-check issues. String truncation is a separate topic which I won't be dealing with now. String range-checking occurs with `StringVar[Index]'.
Also fsc06 is another issue (I might fix this soon, but it's not range-checking). However, it will be a compile-time error then (modifying `for' loop counter), so the test must look a little different then.
Actually, fsc07 and fsc08 are (generally) accessing *outside* the array mem space (since the outer dimension is farther apart in memory), but, of course, just as well a case of range-error as `i := 1; j := 4' would be.
Emil Jerabek wrote:
- conformant array range,
? is this for dynamic array sizes?
A dummy but illustrative example:
program Foo (Output);
procedure P (I: Integer; A: array [L .. U: Integer] of Integer); { this is a conformant array ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ } begin WriteLn (L, U, A[I]) end;
var V: array [1 .. 100] of Integer;
begin P (56, V[23 .. 89]) { this ^^^^^^^^^^ is an array slice } end.
Actually, I just noted, for conformant arrays, there can be two kinds of range-errors: Within the procedure, accessing outside of the actual range (here: L .. U); and when calling the procedure, passing a wrong array (this would be relevant if L .. U were of some subrange type in the procedure, and the actual array bounds do not fit into this subrange).
Frank