23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
-- Lockable.Descriptor Tests --
-------------------------------
function Test_Expression return Atom is
begin
return To_Atom ("(begin(command1 arg1.1 arg1.2)"
& "(command2 (subcmd2.1 arg2.1.1) (subcmd2.3) arg2.4)"
& "end)5:extra");
end Test_Expression;
procedure Test_Interface
(Test : in out NT.Test;
Object : in out Lockable.Descriptor'Class)
|
>
|
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
-- Lockable.Descriptor Tests --
-------------------------------
function Test_Expression return Atom is
begin
return To_Atom ("(begin(command1 arg1.1 arg1.2)"
& "(command2 (subcmd2.1 arg2.1.1) (subcmd2.3) arg2.4)"
& "(command3 (subcmd3.1 ((subcmd3.1.1 arg3.1.1.1)) arg3.1.2))"
& "end)5:extra");
end Test_Expression;
procedure Test_Interface
(Test : in out NT.Test;
Object : in out Lockable.Descriptor'Class)
|
107
108
109
110
111
112
113
114
115
116
117
118
119
120
|
if Level /= 0 then
Test.Fail ("Current level is" & Natural'Image (Level)
& ", expected 0");
end if;
end;
Object.Unlock (Level_1);
Test_Tools.Next_And_Check (Test, Object, To_Atom ("end"), Base);
Test_Tools.Next_And_Check (Test, Object, Events.Close_List, Base - 1);
Test_Tools.Next_And_Check (Test, Object, To_Atom ("extra"), Base - 1);
Object.Lock (Level_1);
Test_Tools.Test_Atom_Accessors (Test, Object, To_Atom ("extra"), 0);
Object.Unlock (Level_1);
|
>
>
>
>
>
>
>
>
>
>
>
>
|
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
|
if Level /= 0 then
Test.Fail ("Current level is" & Natural'Image (Level)
& ", expected 0");
end if;
end;
Object.Unlock (Level_1);
Test_Tools.Next_And_Check (Test, Object, Events.Open_List, Base + 1);
Test_Tools.Next_And_Check (Test, Object, To_Atom ("command3"), Base + 1,
"Before third lock:");
Object.Lock (Level_1);
Test_Tools.Test_Atom_Accessors (Test, Object, To_Atom ("command3"), 0,
"After third lock:");
Test_Tools.Next_And_Check (Test, Object, Events.Open_List, 1);
Test_Tools.Next_And_Check (Test, Object, To_Atom ("subcmd3.1"), 1);
Test_Tools.Next_And_Check (Test, Object, Events.Open_List, 2);
Test_Tools.Next_And_Check (Test, Object, Events.Open_List, 3);
Object.Unlock (Level_1);
Test_Tools.Next_And_Check (Test, Object, To_Atom ("end"), Base);
Test_Tools.Next_And_Check (Test, Object, Events.Close_List, Base - 1);
Test_Tools.Next_And_Check (Test, Object, To_Atom ("extra"), Base - 1);
Object.Lock (Level_1);
Test_Tools.Test_Atom_Accessors (Test, Object, To_Atom ("extra"), 0);
Object.Unlock (Level_1);
|