text stringlengths 0 234 |
|---|
begin |
Obj.Setup_Routine; |
declare |
Assert_Outcome : Test_Outcome; |
begin |
R.all; |
Err := False; |
Routine_State_Map_Handler.Get_Assert_Outcome |
(T, Assert_Outcome); |
case Assert_Outcome is |
when Failed => |
raise Assertion_Error; -- Causes a jump to |
-- Assertion_Error handler |
-- below. Happens when a test |
-- assertion has failed but has |
-- been handled in the test |
-- routine. |
when Passed => |
null; |
end case; |
Test_Reporter.Report_Passed_Test_Routine (T, K); |
exception |
when Run_E : Assertion_Error => |
Routine_State_Map_Handler.Get_Assert_Outcome |
(T, Assert_Outcome); |
Err := False; |
Outcome := Failed; |
case Assert_Outcome is |
when Failed => -- Exception very likely originates in |
-- a failed test assertion and not in |
-- an "unexpected error". |
Test_Reporter.Report_Failed_Test_Routine (T, K); |
when Passed => -- Exception may originates in a failed |
-- contract. |
Test_Reporter.Report_Unexpected_Routine_Exception |
(T, K, Run_E); |
end case; |
when Run_E : others => -- Exception originates in an |
-- unexpected error. |
Test_Reporter.Report_Unexpected_Routine_Exception |
(T, K, Run_E); |
Function Definition: procedure Unl_CB is |
Function Body: begin |
if Unlock_CB /= null then |
Unlock_CB.all; |
end if; |
if Deallocation_Needed then |
declare |
procedure Free is new Ada.Unchecked_Deallocation |
(Object => Instance_Ancestor_Type'Class, |
Name => Instance_Type_Access); |
begin |
Deallocation_Needed := False; |
Free (Instance_Access); |
Function Definition: procedure SB_Lock_CB_procedure_Test is |
Function Body: procedure P_Null is new SB_Lock_CB_procedure (null); |
procedure P_Increment_N is new SB_Lock_CB_procedure (Increment_N'Access); |
begin |
P_Null; |
Assert (SBLF.N = 0); |
P_Increment_N; |
Assert (SBLF.N = 1); |
end SB_Lock_CB_procedure_Test; |
---------------------------------------------------------------------------- |
procedure Locked_Test is |
begin |
Assert (not Locked (SBLF.Lock)); |
declare |
Locker : SB_L_Locker (SBLF.Lock'Access); |
pragma Unreferenced (Locker); |
begin |
Assert (Locked (SBLF.Lock)); |
Function Definition: procedure Locked_With_CB_Test is |
Function Body: begin |
Assert (not Locked (SBLF.Lock_W_CB)); |
Assert (SBLF.N = 0); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.