text stringlengths 0 234 |
|---|
-- in the Report_ primitives of |
-- Test_Reporter_W_Barrier. |
exception |
when E : others => -- Probably |
-- Ada.Assertions.Assertion_Error. |
C_D_T.Trace (Msg_Pref & Exception_Message (E)); |
Failed_Validation_Flag := True; |
Failed_Val := True; |
Function Definition: procedure Assert_Node_Tags is |
Function Body: Not_All_Desc : constant String |
:= " elements are not all descendant of "; |
Dup_Tag : constant String := "Duplicate tag in array "; |
begin |
Ada.Assertions.Assert |
((for all E of Simu_Case => |
Is_Descendant_At_Same_Level (E'Tag, Simu_Test_Case'Tag)), |
"Simu_Case" & Not_All_Desc & "Simu_Test_Case"); |
Ada.Assertions.Assert |
((for all K_1 in Simu_Case'Range => |
(for all K_2 in Simu_Case'Range => |
K_1 = K_2 |
or else |
Simu_Case(K_1)'Tag /= Simu_Case(K_2)'Tag)), |
Dup_Tag & "Simu_Case"); |
Ada.Assertions.Assert |
((for all E of Slave_Runner_Arr => |
Is_Descendant_At_Same_Level (E'Tag, Test_Runner_Sequential'Tag)), |
"Slave_Runner_Arr" & Not_All_Desc & "Test_Runner_Sequential"); |
Ada.Assertions.Assert |
(not (for some E of Slave_Runner_Arr => |
E'Tag = Test_Runner_Sequential_W_Slave_Tasks'Tag), |
"No element in Slave_Runner_Arr should have the tag of " |
& "Test_Runner_Sequential_W_Slave_Tasks"); |
Ada.Assertions.Assert |
((for all K_1 in Slave_Runner_Arr'Range => |
(for all K_2 in Slave_Runner_Arr'Range => |
K_1 = K_2 |
or else |
Slave_Runner_Arr(K_1)'Tag /= Slave_Runner_Arr(K_2)'Tag)), |
Dup_Tag & "Slave_Runner_Arr"); |
end Assert_Node_Tags; |
---------------------------------------------------------------------------- |
procedure Assert_Barrier_Status |
(Barrier : not null Test_Node_Barrier_Access; |
Expected_Tag_Length : Natural) is |
F : constant Boolean := Barrier.Timed_Out; |
N : constant Natural := Barrier.Cross_Count_On_Time_Out; |
M : constant String := (if F then |
(if N = 0 then |
", no crossing happened" |
else |
" after crossing ") |
else |
""); |
Image_N : String := (if F and then N > 0 then |
Positive'Image (N) |
else |
""); |
begin |
if Image_N'Length > 0 then |
Image_N(Image_N'First) := '#'; |
end if; |
Ada.Assertions.Assert (not Barrier.Timed_Out, |
"Barrier timed out" & M & Image_N); |
Ada.Assertions.Assert (not Barrier.Saturated, |
"Barrier saturated (quite an exploit)"); |
Ada.Assertions.Assert (not Barrier.Overflowed, "Barrier overflowed, " |
& "looks like Expected_Tag.all'Length should be greater (than" |
& Integer'Image (Barrier.Cross_Count_On_Overflow) & ")"); |
Ada.Assertions.Assert (Barrier.Completed, |
"Expected_Tag'Length is" & Integer'Image (Expected_Tag_Length) |
& (if Barrier.Cross_Count = 0 then |
", O crossing done" |
else |
", only" & Natural'Image (Barrier.Cross_Count) |
& " crossing(s) done")); |
Ada.Assertions.Assert (not Barrier.Failed_Validation, |
"Failed validation, please analyse trace for details"); |
end Assert_Barrier_Status; |
---------------------------------------------------------------------------- |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.