text
stringlengths
0
234
function Ind (A : Test_Node_Char_Array) return Test_Node_Array is
Ret : Test_Node_Array (1 .. A'Length) := (others => A(A'First));
K : Test_Node_Count := 0;
begin
for E of A loop
K := K + 1;
Ret(K) := E;
end loop;
return Ret;
Function Definition: procedure Process is
Function Body: begin
K := K + 1;
if Node_Tag_Tree(K).Node_Tag = Parent_Tag then
A.Parent_Index := K;
end if;
end Process;
begin
A.Parent_Index := 0;
while A.Parent_Index = 0 and then K < Node_Tag_Tree'Last loop
Process;
end loop;
K := 0;
while A.Parent_Index = 0 and then K < K_Node_Tag_Tree loop
Process;
end loop;
Ada.Assertions.Assert
(A.Parent_Index /= 0,
"Unable to build Node_Tag_Tree array");
Function Definition: procedure Free is new Ada.Unchecked_Deallocation
Function Body: (Object => Test_Node_Array,
Name => Test_Node_Array_Access);
begin
Free (Obj.A);
end Finalize;
----------------------------------------------------------------------------
overriding
procedure Run
(Obj : in out Test_Runner_Sequential_W_Slave_Tasks;
Outcome : out Test_Outcome;
Kind : Run_Kind := Assert_Cond_And_Run_Test)
is
use Private_Test_Reporter;
R_A : constant Shared_Instance.Instance_Type_Access
:= Shared_Instance.Instance_Type_Access (Obj.Reporter_Access);
procedure CB is new SB_Lock_CB_procedure (SBLCB_Access => Obj.R_A_S_CB);
package Test_Reporter_Access_Setter is new Shared_Instance.Access_Setter
(Inst_Access => R_A,
CB => CB);
pragma Unreferenced (Test_Reporter_Access_Setter);
-----------------------------------------------------
procedure Run_Test is
Node_Task : Slave_Node_Task_Array (Obj.Slaves.A'Range);
Ex : Exception_Occurrence_Access;
procedure Free is new Ada.Unchecked_Deallocation
(Object => Exception_Occurrence,
Name => Exception_Occurrence_Access);
begin
for K in Node_Task'Range loop
Node_Task(K).Start_Run (Obj.Slaves.A(K));
end loop;
Test_Runner_Sequential (Obj).Run (Outcome);
-- Inherited procedure call.
for Ta of Node_Task loop
declare
Outc : Test_Outcome;
E : Exception_Occurrence_Access;
begin
Ta.Get_Outcome_And_E (Outc, E);
if Ex /= null and then E /= null then
Free (E);
elsif E /= null then
Ex := E; -- Ex will be freed later.