aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/gna/bug060/Integer_List_tb.vhdl
blob: cc60b0bbdd0d366b7a81aa9ce7caeb40f3200855 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
use std.textio.all;
use			work.corelib.all;

entity Integer_List_tb is
end entity;

architecture test of Integer_List_tb is
	-- shared variable	GlobalStdOut	: T_STDOUT;
	shared variable List1					: Integer_List;
begin
	process
		variable index		: INTEGER;
		variable element	: INTEGER;
	begin
		List1.Init;
		
		for i in 0 to 67 loop
			element := i + 1;
			report "Append " & INTEGER'image(element);
			index		:= List1.Append(element);
			report "  index= " & INTEGER'image(index);
			
			index		:= List1.IndexOf(element);
			List1.Set(index, element + 100);
			element	:= List1.Get(i);
			report "  IndexOf -> " & INTEGER'image(index);
			report "  Get -> " & INTEGER'image(element);
		end loop;
		for i in 54 downto 27 loop
                  report "RemoveAt " & INTEGER'image(i);
			List1.RemoveAt(i);
		end loop;
		for i in 20 downto 7 loop
                  report "Remove " & INTEGER'image(i + 101);
			List1.Remove(i + 101);
		end loop;
		wait;
	end process;
end architecture;