text
stringlengths
0
234
if T = Node_Tag and then M.Length > 0 then
declare
C_First : constant Cursor := M.First;
begin
T := Key (C_First);
S := Element (C_First);
Function Definition: procedure Populate_Current is
Function Body: begin
if N /= 0 then
Ret(1).T := T;
Ret(1).S := S;
end if;
end Populate_Current;
procedure Populate_Others is
K : Index_Type := 1;
procedure Process (C : Cursor) is
Key_C : constant Tag := Key (C);
begin
if Key_C /= T then
K := K + 1;
Ret(K).T := Key_C;
Ret(K).S := Element (C);
end if;
end Process;
begin
M.Iterate (Process'Access);
Ada.Assertions.Assert ((N = 0 and then K = 1)
or else
(N > 0 and then K = N));
end Populate_Others;
begin
Populate_Current;
Populate_Others;
return Ret;
end To_Array;
-----------------------------------------------------
end Routine_State_Map_Handler;
----------------------------------------------------------------------------
procedure Run_Test_Routines (Obj : Test_Node_Interfa'Class;
Outcome : out Test_Outcome;
Kind : Run_Kind) is
use Ada.Assertions,
Private_Test_Reporter;
pragma Unreferenced (Kind);
T : constant Tag := Obj'Tag;
K : Test_Routine_Count := 0;
R : Test_Routine := Null_Test_Routine'Access;
Err : Boolean := False; -- "Unexpected error" flag.
-----------------------------------------------------
function Done return Boolean is
N : constant Test_Routine_Count := Obj.Routine_Count;
Ret : Boolean := K >= N;
begin
if Err and then not Ret then
Ret := True;
Outcome := Failed;
Test_Reporter.Report_Test_Routines_Cancellation (Obj'Tag,
K + 1,
N);
end if;
return Ret;
end Done;
-----------------------------------------------------
begin
Outcome := Passed;
while not Done loop
K := K + 1;
Err := True;
Routine_State_Map_Handler.Reset_Routine_State (T, K);
Test_Reporter.Report_Test_Routine_Start (T, K);
begin
R := Obj.Routine (K);