home *** CD-ROM | disk | FTP | other *** search
/ The Unsorted BBS Collection / thegreatunsorted.tar / thegreatunsorted / programming / misc_programming / ADAUTIL / MTEST.ADA < prev    next >
Encoding:
Text File  |  1990-06-28  |  503 b   |  25 lines

  1. with array_type;
  2. with ada_io; use ada_io;
  3. procedure mtest is
  4.   type rec is
  5.     record
  6.       a,b,c: integer;
  7.     end record;
  8.   package arrtyp is new array_type(integer, rec);
  9.   use arrtyp;
  10.   r: rec := (0,0,0);
  11.   a: desc(1,20000);
  12. begin
  13.   for i in a.first..a.last loop
  14.     r.b := i;
  15.     set(a, i, r);
  16.   end loop;
  17.   put_line("init done");
  18.   for i in reverse a.first .. a.last loop
  19.     if get(a, i).b /= i then
  20.       put_line("fail");
  21.     end if;
  22.   end loop;
  23.   put_line("pass");
  24. end;
  25.