-- TEST PUT_END AND GET_END WITH AN ENUMERATED TYPE USING X0QUE PKG.

with Instrument, X0que;
use Instrument;

procedure Pgqua2 is

    type Day is (Mon, Tue, Wed, Thu, Fri);

    package Equeue is new X0que (50, Day);

    use Equeue;

    Q : Queue;

    Element : Day;

    Wrong : Boolean := False;

begin

    Start ("PGQUA2", "TEST PUT_END AND GET_END WITH AN ENUMERATED TYPE.");

    --FOR I IN 1..5 LOOP

    --  PUT_END(Q,DAY'VAL(I));  VAL IS NOT SUPPORTED

    --END LOOP;
    for I in 1 .. 1000 loop

        Put_End (Q, Fri);

        Put_End (Q, Thu);

        Put_End (Q, Wed);

        Put_End (Q, Tue);

        Put_End (Q, Mon);

        for I in Day loop

            Get_End (Q, Element);

            if Element /= I then

                Comment ("GET_END OR PUT_END FAILED.");

            end if;

        end loop;
    end loop;
    Stop;

end Pgqua2;