text
stringlengths
0
234
(Allocate => Allocate_SIFLI_Concrete_2_U);
begin
Assert (SIFLI_Shared_Instance_U.Locked);
Assert (SIFLI_Shared_Instance_U.Instantiated);
Assert (SIFLI_Shared_Instance_U.Instance'Tag = SIFLI_Concrete_2'Tag);
Assert (SIFLI_Shared_Instance_U.Instance.Primitive = '2');
Assert (SIF.Lock_Count = 0);
Assert (SIF.Unlock_Count = 0);
Assert (Outer_C.Has_Actually_Created);
declare
package Inner_C is new SIFLI_Shared_Instance_U.Creator
(Allocate => Allocate_SIFLI_Concrete_2_U);
begin
Assert (SIFLI_Shared_Instance_U.Locked);
Assert (SIFLI_Shared_Instance_U.Instantiated);
Assert (SIFLI_Shared_Instance_U.Instance'Tag
=
SIFLI_Concrete_2'Tag);
Assert (SIFLI_Shared_Instance_U.Instance.Primitive = '2');
Assert (SIF.Lock_Count = 0);
Assert (SIF.Unlock_Count = 0);
Assert (Outer_C.Has_Actually_Created);
Assert (not Inner_C.Has_Actually_Created);
Function Definition: procedure Shared_Instance_Creator_CB_Test is
Function Body: begin
Assert (SIF.CB_Calls_Count = 0);
declare
package C is new SIFLI_Shared_Instance_L.Creator
(Allocate => Allocate_SIFLI_Concrete_1_L,
CB => CB);
pragma Unreferenced (C);
begin
Assert (SIF.CB_Calls_Count = 1);
Function Definition: procedure Shared_Instance_Fallback_Switch_Test is
Function Body: use Ada.Tags;
use SIFLI_Shared_Instance_L;
package F_S is new SIFLI_Shared_Instance_L.Fallback_Switch
(Fallback_Instance => SIFLI_Concrete_2_Instance'Access);
begin
Assert (not SIFLI_Shared_Instance_L.Locked);
Assert (not SIFLI_Shared_Instance_L.Instantiated);
Assert (SIFLI_Shared_Instance_L.Instance = null);
Assert (F_S.Instance_FS'Tag = SIFLI_Concrete_2'Tag);
Assert (F_S.Instance_FS.Primitive = '2');
declare
package A_S is new SIFLI_Shared_Instance_L.Access_Setter
(Inst_Access => SIFLI_Concrete_1_Instance'Access);
begin
Assert (SIFLI_Shared_Instance_L.Locked);
Assert (SIFLI_Shared_Instance_L.Instantiated);
Assert (SIFLI_Shared_Instance_L.Instance'Tag = SIFLI_Concrete_1'Tag);
Assert (SIFLI_Shared_Instance_L.Instance.Primitive = '1');
Assert (A_S.Has_Actually_Set);
Assert (F_S.Instance_FS'Tag = SIFLI_Concrete_1'Tag);
Assert (F_S.Instance_FS.Primitive = '1');
Function Definition: procedure Free is new Ada.Unchecked_Deallocation
Function Body: (Object => Exception_Occurrence,
Name => Exception_Occurrence_Access);
begin
Inc (Crossing_Count);
if not Permanently_Opened then
if Sat (Crossing_Count) then
Permanent_Opening_Cause
:= Saturation; -- Causes Permanently_Opened to be True from
-- from now on.
C_D_T.Trace ("Test node barrier saturated");
elsif Val (Crossing_Count) > Expected_Tag'Length then
Permanent_Opening_Cause := Overflow; -- Ditto.
Crossing_Count_On_Overflow := Val (Crossing_Count) - 1;
C_D_T.Trace ("Test node barrier overflowed");
end if;
end if;
if not Permanently_Opened then
declare
Excep : Exception_Occurrence_Access := Event_Data.E;
begin
Validate (Val (Crossing_Count),
Event_Kind,
Event_Data,
Char,
Char_To_Tag,
Msg_Pref);
Free (Excep); -- Free the exception allocated by Save_Occurrence