diff --git a/doc/example_architecture/active_component/component-active_component-implementation.adb b/doc/example_architecture/active_component/component-active_component-implementation.adb index 1756e74e..97f63c5b 100644 --- a/doc/example_architecture/active_component/component-active_component-implementation.adb +++ b/doc/example_architecture/active_component/component-active_component-implementation.adb @@ -19,7 +19,7 @@ package body Component.Active_Component.Implementation is Sequence_Count => 0, Buffer_Length => Packed_Byte.Serialization.Serialized_Length ), - Buffer => (others => 0) + Buffer => [others => 0] ); begin -- Set the packet data: @@ -38,7 +38,7 @@ package body Component.Active_Component.Implementation is Id => 0, Sequence_Count => 0, Buffer_Length => Packed_U16.Serialization.Serialized_Length ), - Buffer => (others => 0) + Buffer => [others => 0] ); begin -- Set the packet data: diff --git a/doc/example_architecture/active_component/test/active_component_tests-implementation.adb b/doc/example_architecture/active_component/test/active_component_tests-implementation.adb index 5d4ad32e..12c59783 100644 --- a/doc/example_architecture/active_component/test/active_component_tests-implementation.adb +++ b/doc/example_architecture/active_component/test/active_component_tests-implementation.adb @@ -42,7 +42,7 @@ package body Active_Component_Tests.Implementation is Sequence_Count => 0, Buffer_Length => 1 ), - Buffer => (others => 0) + Buffer => [others => 0] ); begin -- Put some data in the component's queue: diff --git a/doc/example_architecture/array_representation/main.adb b/doc/example_architecture/array_representation/main.adb index bf91fab0..d14dcca0 100644 --- a/doc/example_architecture/array_representation/main.adb +++ b/doc/example_architecture/array_representation/main.adb @@ -3,7 +3,7 @@ with Example_Array.Representation; procedure Main is -- A packed version of the type. - Packed_Type_1 : constant Example_Array.T := (11, 22, 33, 44, 55, 66, 77, 88); + Packed_Type_1 : constant Example_Array.T := [11, 22, 33, 44, 55, 66, 77, 88]; begin -- Print the packed array to the terminal in human readable form: Put_Line ("Human readable:"); diff --git a/doc/example_architecture/background_component/component-background_component-implementation.adb b/doc/example_architecture/background_component/component-background_component-implementation.adb index 7c818c1c..5790e0ed 100644 --- a/doc/example_architecture/background_component/component-background_component-implementation.adb +++ b/doc/example_architecture/background_component/component-background_component-implementation.adb @@ -51,7 +51,7 @@ package body Component.Background_Component.Implementation is Sequence_Count => 0, Buffer_Length => 2 ), - Buffer => (others => 0) + Buffer => [others => 0] ); begin -- Set the packet data: diff --git a/doc/example_architecture/background_component/component-background_component-implementation.ads b/doc/example_architecture/background_component/component-background_component-implementation.ads index 6df7fcb9..47072089 100644 --- a/doc/example_architecture/background_component/component-background_component-implementation.ads +++ b/doc/example_architecture/background_component/component-background_component-implementation.ads @@ -28,7 +28,7 @@ private -- Fetch the data. function Get_Data return Two_Byte_Array; private - Data : Basic_Types.Byte_Array (0 .. 1) := (0, 0); + Data : Basic_Types.Byte_Array (0 .. 1) := [0, 0]; end Protected_Data; -- The component class instance record: diff --git a/doc/example_architecture/background_component/test/background_component_tests-implementation.adb b/doc/example_architecture/background_component/test/background_component_tests-implementation.adb index b77fd6b8..e7d4ad8e 100644 --- a/doc/example_architecture/background_component/test/background_component_tests-implementation.adb +++ b/doc/example_architecture/background_component/test/background_component_tests-implementation.adb @@ -42,7 +42,7 @@ package body Background_Component_Tests.Implementation is Sequence_Count => 0, Buffer_Length => 2 ), - Buffer => (others => 0) + Buffer => [others => 0] ); begin -- Put some data in the component's queue: diff --git a/doc/example_architecture/example_component/component-example_component-implementation.adb b/doc/example_architecture/example_component/component-example_component-implementation.adb index 4fe53e22..05e41094 100644 --- a/doc/example_architecture/example_component/component-example_component-implementation.adb +++ b/doc/example_architecture/example_component/component-example_component-implementation.adb @@ -24,7 +24,7 @@ package body Component.Example_Component.Implementation is Sequence_Count => 0, Buffer_Length => 1 -- We are using 1 byte of data. ), - Buffer => (others => 0) + Buffer => [others => 0] ); begin -- Set the packet data: diff --git a/doc/example_architecture/example_component/test/example_component_tests-implementation.adb b/doc/example_architecture/example_component/test/example_component_tests-implementation.adb index 613b70dc..369cddeb 100644 --- a/doc/example_architecture/example_component/test/example_component_tests-implementation.adb +++ b/doc/example_architecture/example_component/test/example_component_tests-implementation.adb @@ -42,7 +42,7 @@ package body Example_Component_Tests.Implementation is Sequence_Count => 0, Buffer_Length => 1 ), - Buffer => (others => 0) + Buffer => [others => 0] ); begin -- Send the example component a tick: diff --git a/doc/example_architecture/example_component/test2/example_component_tests-implementation.adb b/doc/example_architecture/example_component/test2/example_component_tests-implementation.adb index 3af6f852..ea7c5b57 100644 --- a/doc/example_architecture/example_component/test2/example_component_tests-implementation.adb +++ b/doc/example_architecture/example_component/test2/example_component_tests-implementation.adb @@ -42,7 +42,7 @@ package body Example_Component_Tests.Implementation is Sequence_Count => 0, Buffer_Length => 1 ), - Buffer => (others => 0) + Buffer => [others => 0] ); begin -- Send the example component a tick: diff --git a/doc/example_architecture/example_component/test3/example_component_tests-implementation.adb b/doc/example_architecture/example_component/test3/example_component_tests-implementation.adb index 125da6a7..405ff814 100644 --- a/doc/example_architecture/example_component/test3/example_component_tests-implementation.adb +++ b/doc/example_architecture/example_component/test3/example_component_tests-implementation.adb @@ -42,7 +42,7 @@ package body Example_Component_Tests.Implementation is Sequence_Count => 0, Buffer_Length => 1 ), - Buffer => (others => 0) + Buffer => [others => 0] ); begin -- Send the example component a tick: diff --git a/doc/example_architecture/example_component/test4/example_component_tests-implementation.adb b/doc/example_architecture/example_component/test4/example_component_tests-implementation.adb index 9e4aad40..c363fc8d 100644 --- a/doc/example_architecture/example_component/test4/example_component_tests-implementation.adb +++ b/doc/example_architecture/example_component/test4/example_component_tests-implementation.adb @@ -42,7 +42,7 @@ package body Example_Component_Tests.Implementation is Sequence_Count => 0, Buffer_Length => 1 ), - Buffer => (others => 0) + Buffer => [others => 0] ); begin -- Send the example component a tick: diff --git a/doc/example_architecture/example_component/test5/example_component_tests-implementation.adb b/doc/example_architecture/example_component/test5/example_component_tests-implementation.adb index 8f09ce45..c77c0676 100644 --- a/doc/example_architecture/example_component/test5/example_component_tests-implementation.adb +++ b/doc/example_architecture/example_component/test5/example_component_tests-implementation.adb @@ -45,7 +45,7 @@ package body Example_Component_Tests.Implementation is Sequence_Count => 0, Buffer_Length => 1 ), - Buffer => (others => 0) + Buffer => [others => 0] ); begin -- Send the example component a tick: diff --git a/doc/example_architecture/initialized_component/component-initialized_component-implementation.adb b/doc/example_architecture/initialized_component/component-initialized_component-implementation.adb index 4896a00b..11c85314 100644 --- a/doc/example_architecture/initialized_component/component-initialized_component-implementation.adb +++ b/doc/example_architecture/initialized_component/component-initialized_component-implementation.adb @@ -27,7 +27,7 @@ package body Component.Initialized_Component.Implementation is -- Other computations can be performed here too! -- Let's set the packet data to 5 + the packets_Per_Tick Self.Pkt.Header.Buffer_Length := 7; - Self.Pkt.Buffer := (others => 5 + Unsigned_8 (Self.Packets_Per_Tick)); + Self.Pkt.Buffer := [others => 5 + Unsigned_8 (Self.Packets_Per_Tick)]; end Init; --------------------------------------- diff --git a/doc/example_architecture/packet_component/test/packet_component_tests-implementation.adb b/doc/example_architecture/packet_component/test/packet_component_tests-implementation.adb index 2ef2f1af..e3c62bad 100644 --- a/doc/example_architecture/packet_component/test/packet_component_tests-implementation.adb +++ b/doc/example_architecture/packet_component/test/packet_component_tests-implementation.adb @@ -44,8 +44,8 @@ package body Packet_Component_Tests.Implementation is -- Make sure 2 Counter packets were sent: Natural_Assert.Eq (Self.Tester.Counter_History.Get_Count, 2); - Byte_Array_Assert.Eq (Self.Tester.Counter_History.Get (1).Buffer (0 .. 1), (0, 0)); - Byte_Array_Assert.Eq (Self.Tester.Counter_History.Get (2).Buffer (0 .. 1), (0, 1)); + Byte_Array_Assert.Eq (Self.Tester.Counter_History.Get (1).Buffer (0 .. 1), [0, 0]); + Byte_Array_Assert.Eq (Self.Tester.Counter_History.Get (2).Buffer (0 .. 1), [0, 1]); -- Make sure 2 Last_Tick_Received packets were sent: Natural_Assert.Eq (Self.Tester.Last_Tick_Received_History.Get_Count, 2); diff --git a/doc/example_architecture/parameter_component/test/component-parameter_component-implementation-tester.adb b/doc/example_architecture/parameter_component/test/component-parameter_component-implementation-tester.adb index 26ad199f..85c9434e 100644 --- a/doc/example_architecture/parameter_component/test/component-parameter_component-implementation-tester.adb +++ b/doc/example_architecture/parameter_component/test/component-parameter_component-implementation-tester.adb @@ -32,7 +32,7 @@ package body Component.Parameter_Component.Implementation.Tester is not overriding function Fetch_Parameter (Self : in out Instance; Id : in Parameter_Types.Parameter_Id; Par : out Parameter.T) return Parameter_Update_Status.E is use Parameter_Enums.Parameter_Update_Status; use Parameter_Enums.Parameter_Operation_Type; - Param_Update : Parameter_Update.T := (Operation => Fetch, Status => Success, Param => (Header => (Id => Id, Buffer_Length => 0), Buffer => (others => 0))); + Param_Update : Parameter_Update.T := (Operation => Fetch, Status => Success, Param => (Header => (Id => Id, Buffer_Length => 0), Buffer => [others => 0])); begin -- Set the ID to fetch: Param_Update.Param.Header.Id := Id; @@ -44,7 +44,7 @@ package body Component.Parameter_Component.Implementation.Tester is not overriding function Update_Parameters (Self : in out Instance) return Parameter_Update_Status.E is use Parameter_Enums.Parameter_Update_Status; use Parameter_Enums.Parameter_Operation_Type; - Param_Update : Parameter_Update.T := (Operation => Update, Status => Success, Param => ((0, 0), (others => 0))); + Param_Update : Parameter_Update.T := (Operation => Update, Status => Success, Param => ((0, 0), [others => 0])); begin Self.Parameter_Update_T_Provide (Param_Update); return Param_Update.Status; diff --git a/doc/example_architecture/queued_component/component-queued_component-implementation.adb b/doc/example_architecture/queued_component/component-queued_component-implementation.adb index aff39b22..89ba11cf 100644 --- a/doc/example_architecture/queued_component/component-queued_component-implementation.adb +++ b/doc/example_architecture/queued_component/component-queued_component-implementation.adb @@ -33,7 +33,7 @@ package body Component.Queued_Component.Implementation is Sequence_Count => 0, Buffer_Length => Self.Data_Length ), - Buffer => (others => 0) + Buffer => [others => 0] ); begin -- Set the packet data: diff --git a/doc/example_architecture/queued_component/component-queued_component-implementation.ads b/doc/example_architecture/queued_component/component-queued_component-implementation.ads index 3c38b70c..46341a8c 100644 --- a/doc/example_architecture/queued_component/component-queued_component-implementation.ads +++ b/doc/example_architecture/queued_component/component-queued_component-implementation.ads @@ -21,7 +21,7 @@ private -- The length of the packet data to send out: Data_Length : Packet_Buffer_Length_Type := 0; -- The content of the packet data to send out: - Data : Basic_Types.Byte_Array (0 .. 1) := (0, 0); + Data : Basic_Types.Byte_Array (0 .. 1) := [0, 0]; end record; --------------------------------------- diff --git a/doc/example_architecture/queued_component/test/queued_component_tests-implementation.adb b/doc/example_architecture/queued_component/test/queued_component_tests-implementation.adb index 7f6a75b4..2a335568 100644 --- a/doc/example_architecture/queued_component/test/queued_component_tests-implementation.adb +++ b/doc/example_architecture/queued_component/test/queued_component_tests-implementation.adb @@ -42,7 +42,7 @@ package body Queued_Component_Tests.Implementation is Sequence_Count => 0, Buffer_Length => 1 ), - Buffer => (others => 0) + Buffer => [others => 0] ); begin -- Put some data in the component's queue: diff --git a/doc/example_architecture/queued_component/test2/queued_component_tests-implementation.adb b/doc/example_architecture/queued_component/test2/queued_component_tests-implementation.adb index dc27ea08..9416a543 100644 --- a/doc/example_architecture/queued_component/test2/queued_component_tests-implementation.adb +++ b/doc/example_architecture/queued_component/test2/queued_component_tests-implementation.adb @@ -42,7 +42,7 @@ package body Queued_Component_Tests.Implementation is Sequence_Count => 0, Buffer_Length => 1 ), - Buffer => (others => 0) + Buffer => [others => 0] ); begin -- Put some data in the component's queue: diff --git a/doc/example_architecture/record_validation/main.adb b/doc/example_architecture/record_validation/main.adb index 1cf9dccb..e21bb44a 100644 --- a/doc/example_architecture/record_validation/main.adb +++ b/doc/example_architecture/record_validation/main.adb @@ -6,7 +6,7 @@ procedure Main is -- A packed version of the type. Packed_Type_1 : constant Example_Record.T := (Value_1 => 2, Value_2 => -1, Value_3 => Green, Value_4 => 0.5); -- Deserialize a byte array of all 0xFF into the record. - Packed_Type_2 : constant Example_Record.T := Example_Record.Serialization.From_Byte_Array ((255, 255, 255, 255, 255, 255)); + Packed_Type_2 : constant Example_Record.T := Example_Record.Serialization.From_Byte_Array ([255, 255, 255, 255, 255, 255]); Errant_Field : Unsigned_32 := 0; begin if Example_Record.Validation.Valid (Packed_Type_1, Errant_Field) then diff --git a/gen/templates/assembly/name.ads b/gen/templates/assembly/name.ads index 9e77829c..0c3beb97 100644 --- a/gen/templates/assembly/name.ads +++ b/gen/templates/assembly/name.ads @@ -118,16 +118,16 @@ package {{ name }} is {% endfor %} -- List of task infos for all tasks: - Task_List : aliased Task_Types.Task_Info_List := ( + Task_List : aliased Task_Types.Task_Info_List := [ {% for task in task_list %} -- {{ task.component_name }}.{{ task.name }}: {{ task.number }} => {{ task.component_name }}_{{ task.name }}_Task_Info'Access{{ "," if not loop.last }} {% endfor %} - ); + ]; {% else %} -- List of task infos for all tasks: - Task_List : aliased Task_Types.Task_Info_List := (1 .. 0 => null); -- empty + Task_List : aliased Task_Types.Task_Info_List := [1 .. 0 => null]; -- empty {% endif %} {% if interrupt_list %} @@ -135,32 +135,32 @@ package {{ name }} is pragma Style_Checks ("-rn"); -- List of all interrupts used in the system: - Interrupt_List : aliased Interrupt_Types.Interrupt_Id_List := ( + Interrupt_List : aliased Interrupt_Types.Interrupt_Id_List := [ {% for interrupt in interrupt_list %} -- {{ interrupt.component_name }}.{{ interrupt.name }}: {{ loop.index0 }} => {{ interrupt.id }}{{ "," if not loop.last }} {% endfor %} - ); + ]; -- Remove some reference style checking to deal with incorrect capitalization in system packages. pragma Style_Checks ("+rn"); {% else %} -- List of all interrupts used in the system: - Interrupt_List : aliased Interrupt_Types.Interrupt_Id_List := (1 .. 0 => 0); -- empty + Interrupt_List : aliased Interrupt_Types.Interrupt_Id_List := [1 .. 0 => 0]; -- empty {% endif %} {% if component_kind_dict["queued"] %} -- List of all components with positive queue sizes in the system: - Queued_Component_List : aliased Component.Component_List := ( + Queued_Component_List : aliased Component.Component_List := [ {% for component in component_kind_dict["queued"] %} {{ loop.index0 }} => {{ component.instance_name }}'Access{{ "," if not loop.last }} {% endfor %} - ); + ]; {% else %} -- List of all components with positive queue sizes in the system: - Queued_Component_List : aliased Component.Component_List := (1 .. 0 => null); -- empty + Queued_Component_List : aliased Component.Component_List := [1 .. 0 => null]; -- empty {% endif %} end {{ name }}; diff --git a/gen/templates/commands/name_commands.adb b/gen/templates/commands/name_commands.adb index 4224ae42..23429003 100644 --- a/gen/templates/commands/name_commands.adb +++ b/gen/templates/commands/name_commands.adb @@ -76,7 +76,7 @@ package body {{ name }} is pragma Annotate (CodePeer, False_Positive, "dead code", "Some CodePeer can prove the Len can never be too large so this code does not execute. This is OK."); end if; - Cmd := (Header => (Source_Id => Self.Source_Id, Id => Self.Get_{{ command.name }}_Id, Arg_Buffer_Length => Len), Arg_Buffer => (others => 0)); + Cmd := (Header => (Source_Id => Self.Source_Id, Id => Self.Get_{{ command.name }}_Id, Arg_Buffer_Length => Len), Arg_Buffer => [others => 0]); -- Serialize the argument onto the buffer: Stat := {{ command.type_package }}.Serialization.To_Byte_Array (Cmd.Arg_Buffer, Arg, Ignore); @@ -94,9 +94,9 @@ package body {{ name }} is {% else %} package Arg_Serializer is new Serializer ({{ command.type }}); {% endif %} - Cmd : {% if not command.type %}constant {% endif %}Command.T := (Header => (Source_Id => Self.Source_Id, Id => Self.Get_{{ command.name }}_Id, Arg_Buffer_Length => Arg_Serializer.Serialized_Length), Arg_Buffer => (others => 0)); + Cmd : {% if not command.type %}constant {% endif %}Command.T := (Header => (Source_Id => Self.Source_Id, Id => Self.Get_{{ command.name }}_Id, Arg_Buffer_Length => Arg_Serializer.Serialized_Length), Arg_Buffer => [others => 0]); {% else %} - Cmd : {% if not command.type %}constant {% endif %}Command.T := (Header => (Source_Id => Self.Source_Id, Id => Self.Get_{{ command.name }}_Id, Arg_Buffer_Length => 0), Arg_Buffer => (others => 0)); + Cmd : {% if not command.type %}constant {% endif %}Command.T := (Header => (Source_Id => Self.Source_Id, Id => Self.Get_{{ command.name }}_Id, Arg_Buffer_Length => 0), Arg_Buffer => [others => 0]); {% endif %} begin {% if command.type %} diff --git a/gen/templates/component/component-name.adb b/gen/templates/component/component-name.adb index 222d9ca0..3b8a5033 100644 --- a/gen/templates/component/component-name.adb +++ b/gen/templates/component/component-name.adb @@ -758,7 +758,7 @@ package body Component.{{ name }} is else -- Id is not valid for component, so call the invalid command handler and return the the error status: declare - P_Type : Basic_Types.Poly_Type := (others => 0); + P_Type : Basic_Types.Poly_Type := [others => 0]; begin -- Copy id into poly type: Byte_Array_Util.Safe_Right_Copy (P_Type, Command_Id.Serialization.To_Byte_Array ((Id => Cmd.Header.Id))); @@ -807,7 +807,7 @@ package body Component.{{ name }} is end Register_Commands; not overriding procedure Handle_Command_Length_Error (Self : in out Base_Instance; Cmd : in Command.T) is - P_Type : Basic_Types.Poly_Type := (others => 0); + P_Type : Basic_Types.Poly_Type := [others => 0]; begin -- Copy length into poly type: Byte_Array_Util.Safe_Right_Copy (P_Type, Command_Arg_Buffer_Length.Serialization.To_Byte_Array ((Arg_Buffer_Length => Cmd.Header.Arg_Buffer_Length))); @@ -881,7 +881,7 @@ package body Component.{{ name }} is {% if command.type_model %} P_Type : constant Basic_Types.Poly_Type := {{ command.type_package }}.Validation.Get_Field (Args, Errant_Field); {% else %} - P_Type : Basic_Types.Poly_Type := (others => 0); + P_Type : Basic_Types.Poly_Type := [others => 0]; {% endif %} begin {% if not command.type_model %} @@ -980,7 +980,7 @@ package body Component.{{ name }} is else -- Id is not valid for component, so call the invalid parameter handler and return the the error status: declare - P_Type : Basic_Types.Poly_Type := (others => 0); + P_Type : Basic_Types.Poly_Type := [others => 0]; begin -- Copy id into poly type: Byte_Array_Util.Safe_Right_Copy (P_Type, Parameter_Id.Serialization.To_Byte_Array ((Id => Par.Header.Id))); @@ -992,7 +992,7 @@ package body Component.{{ name }} is end Stage_Parameter; not overriding procedure Handle_Parameter_Length_Error (Self : in out Base_Instance; Par : in Parameter.T) is - P_Type : Basic_Types.Poly_Type := (others => 0); + P_Type : Basic_Types.Poly_Type := [others => 0]; begin -- Copy length into poly type: Byte_Array_Util.Safe_Right_Copy (P_Type, Parameter_Buffer_Length.Serialization.To_Byte_Array ((Buffer_Length => Par.Header.Buffer_Length))); @@ -1041,7 +1041,7 @@ package body Component.{{ name }} is {% if par.type_model %} P_Type : constant Basic_Types.Poly_Type := {{ par.type_package }}.Validation.Get_Field (Par_To_Stage, Errant_Field); {% else %} - P_Type : Basic_Types.Poly_Type := (others => 0); + P_Type : Basic_Types.Poly_Type := [others => 0]; {% endif %} begin {% if not par.type_model %} diff --git a/gen/templates/component/component-name.ads b/gen/templates/component/component-name.ads index 8359cb95..2718d3f1 100644 --- a/gen/templates/component/component-name.ads +++ b/gen/templates/component/component-name.ads @@ -424,12 +424,12 @@ private -- Procedure lookup table for dispatching to correct connector handler: type Dispatch_Procedure is not null access procedure (Self : in out Base_Instance;{% if connectors.arrayed_invokee() %} Index : in Connector_Index_Type;{% endif %} Bytes : in Basic_Types.Byte_Array); type Dispatch_Table_T is array (Connector_Identifier_Enum) of Dispatch_Procedure; - Dispatch_Table : constant Dispatch_Table_T := ( + Dispatch_Table : constant Dispatch_Table_T := [ Quit => Dispatch_Quit'Access, {% for connector in connectors.of_kind('recv_async') %} {{ connector.name }} => Dispatch_{{ connector.name }}'Access{{ "," if not loop.last }} {% endfor %} - ); + ]; --------------------------------------- -- Private methods for a component queue @@ -546,11 +546,11 @@ private -- Procedure lookup table for dispatching to correct command handler: type Execute_Function is not null access function (Self : in out Base_Instance; Cmd : in Command.T) return Command_Response_Status.E; type Command_Table_T is array ({{ commands.name }}.Local_Command_Id_Type) of Execute_Function; - Command_Id_Table : constant Command_Table_T := ( + Command_Id_Table : constant Command_Table_T := [ {% for command in commands %} {{ commands.name }}.{{ command.name }}_Id => Execute_{{ command.name }}'Access{{ "," if not loop.last }} {% endfor %} - ); + ]; {% endif %} {% if parameters %} @@ -585,20 +585,20 @@ private -- Procedure lookup table for dispatching to parameter stage handler: type Stage_Function is not null access function (Self : in out Base_Instance; Par : in Parameter.T) return Parameter_Update_Status.E; type Parameter_Table_T is array ({{ parameters.name }}.Local_Parameter_Id_Type) of Stage_Function; - Parameter_Id_Table : constant Parameter_Table_T := ( + Parameter_Id_Table : constant Parameter_Table_T := [ {% for par in parameters %} {{ parameters.name }}.{{ par.name }}_Id => Stage_{{ par.name }}'Access{{ "," if not loop.last }} {% endfor %} - ); + ]; -- Procedure lookup table for dispatching to parameter fetch handler: type Fetch_Function is not null access function (Self : in out Base_Instance; Par : in out Parameter.T) return Parameter_Update_Status.E; type Parameter_Fetch_Table_T is array ({{ parameters.name }}.Local_Parameter_Id_Type) of Fetch_Function; - Parameter_Id_Fetch_Table : constant Parameter_Fetch_Table_T := ( + Parameter_Id_Fetch_Table : constant Parameter_Fetch_Table_T := [ {% for par in parameters %} {{ parameters.name }}.{{ par.name }}_Id => Fetch_{{ par.name }}'Access{{ "," if not loop.last }} {% endfor %} - ); + ]; -- A protected object is used to store the component's staged parameters. This is because -- the staged parameters are accessed by both the execution thread of the component and the diff --git a/gen/templates/data_products/name_data_products.adb b/gen/templates/data_products/name_data_products.adb index cf37e2ef..e83d828a 100644 --- a/gen/templates/data_products/name_data_products.adb +++ b/gen/templates/data_products/name_data_products.adb @@ -49,7 +49,7 @@ package body {{ name }} is {% else %} package Data_Product_Serializer is new Serializer ({{ dp.type }}); {% endif %} - Dp : Data_Product.T := (Header => (Id => Self.Get_{{ dp.name }}_Id, Time => Timestamp, Buffer_Length => Data_Product_Serializer.Serialized_Length), Buffer => (others => 0)); + Dp : Data_Product.T := (Header => (Id => Self.Get_{{ dp.name }}_Id, Time => Timestamp, Buffer_Length => Data_Product_Serializer.Serialized_Length), Buffer => [others => 0]); begin Dp.Buffer (Dp.Buffer'First .. Dp.Buffer'First + Data_Product_Serializer.Serialized_Length - 1) := Data_Product_Serializer.To_Byte_Array (Item); return Dp; diff --git a/gen/templates/events/name_events.adb b/gen/templates/events/name_events.adb index a9a5d20d..eed7e022 100644 --- a/gen/templates/events/name_events.adb +++ b/gen/templates/events/name_events.adb @@ -51,7 +51,7 @@ package body {{ name }} is package Param_Serializer is new Serializer ({{ event.type }}); {% endif %} {% endif %} - Evnt : {% if not event.type %}constant {% endif %}Event.T := (Header => (Id => Self.Get_{{ event.name }}_Id, Time => Timestamp, Param_Buffer_Length => {% if event.type %}Param_Serializer.Serialized_Length{% else %}0{% endif %}), Param_Buffer => (others => 0)); + Evnt : {% if not event.type %}constant {% endif %}Event.T := (Header => (Id => Self.Get_{{ event.name }}_Id, Time => Timestamp, Param_Buffer_Length => {% if event.type %}Param_Serializer.Serialized_Length{% else %}0{% endif %}), Param_Buffer => [others => 0]); begin {% if event.type %} Evnt.Param_Buffer (Evnt.Param_Buffer'First .. Evnt.Param_Buffer'First + Param_Serializer.Serialized_Length - 1) := Param_Serializer.To_Byte_Array (Param); diff --git a/gen/templates/faults/name_faults.adb b/gen/templates/faults/name_faults.adb index 858310cb..5ec4d7d9 100644 --- a/gen/templates/faults/name_faults.adb +++ b/gen/templates/faults/name_faults.adb @@ -63,7 +63,7 @@ package body {{ name }} is package Param_Serializer is new Serializer ({{ fault.type }}); {% endif %} {% endif %} - Flt : {% if not fault.type %}constant {% endif %}Fault.T := (Header => (Id => Self.Get_{{ fault.name }}_Id, Time => Timestamp, Param_Buffer_Length => {% if fault.type %}Param_Serializer.Serialized_Length{% else %}0{% endif %}), Param_Buffer => (others => 0)); + Flt : {% if not fault.type %}constant {% endif %}Fault.T := (Header => (Id => Self.Get_{{ fault.name }}_Id, Time => Timestamp, Param_Buffer_Length => {% if fault.type %}Param_Serializer.Serialized_Length{% else %}0{% endif %}), Param_Buffer => [others => 0]); begin {% if fault.type %} Flt.Param_Buffer (Flt.Param_Buffer'First .. Flt.Param_Buffer'First + Param_Serializer.Serialized_Length - 1) := Param_Serializer.To_Byte_Array (Param); diff --git a/gen/templates/packets/name_packets.adb b/gen/templates/packets/name_packets.adb index 042d9f99..635d1fa7 100644 --- a/gen/templates/packets/name_packets.adb +++ b/gen/templates/packets/name_packets.adb @@ -16,9 +16,7 @@ with Basic_Types; {% endif %} package body {{ name }} is - use Packet_Types; - {% if not ids %} ----------------------------------------------- -- Getter/setter subprograms for packet ID base: @@ -76,7 +74,7 @@ package body {{ name }} is Sequence_Count => Self.{{ p.name }}_Sequence_Count, Buffer_Length => 0 ), - Buffer => (others => 0) + Buffer => [others => 0] ); -- Copy over the data: Stat := Packet_Serializer.To_Byte_Array (Pkt.Buffer, Item, Num_Bytes_Serialized); @@ -99,7 +97,7 @@ package body {{ name }} is Sequence_Count => Self.{{ p.name }}_Sequence_Count, Buffer_Length => 0 ), - Buffer => (others => 0) + Buffer => [others => 0] ); Stat : Serialization_Status; Num_Bytes_Serialized : Natural; @@ -143,7 +141,7 @@ package body {{ name }} is Sequence_Count => Self.{{ p.name }}_Sequence_Count, Buffer_Length => Packet_Serializer.Serialized_Length ), - Buffer => (others => 0) + Buffer => [others => 0] ); begin P.Buffer (P.Buffer'First .. P.Buffer'First + Packet_Serializer.Serialized_Length - 1) := Packet_Serializer.To_Byte_Array (Item); @@ -190,7 +188,7 @@ package body {{ name }} is Sequence_Count => Self.{{ p.name }}_Sequence_Count, Buffer_Length => 0 ), - Buffer => (others => 0) + Buffer => [others => 0] ); begin -- Increment the sequence count: diff --git a/gen/templates/parameters/name_parameters.adb b/gen/templates/parameters/name_parameters.adb index 7b1e711f..9cc93acb 100644 --- a/gen/templates/parameters/name_parameters.adb +++ b/gen/templates/parameters/name_parameters.adb @@ -49,7 +49,7 @@ package body {{ name }} is {% else %} package Arg_Serializer is new Serializer ({{ param.type }}); {% endif %} - Param : Parameter.T := (Header => (Id => Self.Get_{{ param.name }}_Id, Buffer_Length => Arg_Serializer.Serialized_Length), Buffer => (others => 0)); + Param : Parameter.T := (Header => (Id => Self.Get_{{ param.name }}_Id, Buffer_Length => Arg_Serializer.Serialized_Length), Buffer => [others => 0]); begin Param.Buffer (Param.Buffer'First .. (Param.Buffer'First + Arg_Serializer.Serialized_Length - 1)) := Arg_Serializer.To_Byte_Array (Arg); return Param; diff --git a/gen/templates/tests/component-name_reciprocal.ads b/gen/templates/tests/component-name_reciprocal.ads index bf6bca5a..fca5b107 100644 --- a/gen/templates/tests/component-name_reciprocal.ads +++ b/gen/templates/tests/component-name_reciprocal.ads @@ -325,11 +325,11 @@ package Component.{{ name }}_Reciprocal is -- Procedure lookup table for dispatching to correct connector handler: type Dispatch_Event_Procedure is access procedure (Self : in out Base_Instance; Evnt : in Event.T); type Event_Table_T is array ({{ events.name }}.Local_Event_Id_Type) of Dispatch_Event_Procedure; - Event_Id_Table : Event_Table_T := ( + Event_Id_Table : Event_Table_T := [ {% for event in events %} {{ events.name }}.{{ event.name }}_Id => Dispatch_{{ event.name }}'Access{{ "," if not loop.last }} {% endfor %} - ); + ]; {% endif %} {% if data_products %} @@ -361,11 +361,11 @@ package Component.{{ name }}_Reciprocal is -- Procedure lookup table for dispatching to correct connector handler: type Dispatch_Data_Product_Procedure is access procedure (Self : in out Base_Instance; Dp : in Data_Product.T); type Data_Product_Table_T is array ({{ data_products.name }}.Local_Data_Product_Id_Type) of Dispatch_Data_Product_Procedure; - Data_Product_Id_Table : Data_Product_Table_T := ( + Data_Product_Id_Table : Data_Product_Table_T := [ {% for dp in data_products %} {{ data_products.name }}.{{ dp.name }}_Id => Dispatch_{{ dp.name }}'Access{{ "," if not loop.last }} {% endfor %} - ); + ]; {% endif %} {% if packets %} @@ -428,11 +428,11 @@ package Component.{{ name }}_Reciprocal is -- Procedure lookup table for dispatching to correct connector handler: type Dispatch_Fault_Procedure is access procedure (Self : in out Base_Instance; Flt : in Fault.T); type Fault_Table_T is array ({{ faults.name }}.Local_Fault_Id_Type) of Dispatch_Fault_Procedure; - Fault_Id_Table : Fault_Table_T := ( + Fault_Id_Table : Fault_Table_T := [ {% for fault in faults %} {{ faults.name }}.{{ fault.name }}_Id => Dispatch_{{ fault.name }}'Access{{ "," if not loop.last }} {% endfor %} - ); + ]; {% endif %} --------------------------------------- diff --git a/gen/templates/tests/name.ads b/gen/templates/tests/name.ads index 250fbca4..8e34b3e8 100644 --- a/gen/templates/tests/name.ads +++ b/gen/templates/tests/name.ads @@ -47,11 +47,11 @@ package {{ name }} is type Test_Name_List_Type is array (Natural range 0 .. Num_Tests - 1) of Unbounded_String; Test_Name_List : constant Test_Name_List_Type := - ( + [ {% for test in tests.values() %} {{ loop.index0 }} => To_Unbounded_String ("{{ test.name }}"){{ "," if not loop.last }} {% endfor %} - ); + ]; private -- Logging procedures: diff --git a/redo/targets/gpr/a_adamant.gpr b/redo/targets/gpr/a_adamant.gpr index cad23ac7..5c1a1ab1 100644 --- a/redo/targets/gpr/a_adamant.gpr +++ b/redo/targets/gpr/a_adamant.gpr @@ -43,13 +43,11 @@ abstract project a_adamant is -- -gnatwt - deleted conditional code -- -gnatw.X - disable warnings for No_Exception_Propagation mode, since this is usable in Linux -- -gnat2022- add support for gnat2022 features - -- -gnatwJ ignore warnings (for now) like: - -- warning: array aggregate using () is an obsolescent syntax, use [] instead [-gnatwj] -- -- Note: I did not turn on gnatwd, because writing "all" all the time makes things -- less readable. -- - ADA_FLAGS := ("-gnatf", "-gnatwa", "-gnatwl", "-gnatw.o", "-gnatwt", "-gnatw.X", "-gnat2022", "-gnatwJ"); + ADA_FLAGS := ("-gnatf", "-gnatwa", "-gnatwl", "-gnatw.o", "-gnatwt", "-gnatw.X", "-gnat2022"); COMMON_C_FLAGS := ("-Wall", "-Wextra", "-pedantic"); C_FLAGS := COMMON_C_FLAGS & ("-std=gnu99"); CPP_FLAGS := COMMON_C_FLAGS & ("-std=c++0x"); diff --git a/src/components/ccsds_command_depacketizer/test/ccsds_command_depacketizer_tests-implementation.adb b/src/components/ccsds_command_depacketizer/test/ccsds_command_depacketizer_tests-implementation.adb index 544e4e15..dfc2b7c7 100644 --- a/src/components/ccsds_command_depacketizer/test/ccsds_command_depacketizer_tests-implementation.adb +++ b/src/components/ccsds_command_depacketizer/test/ccsds_command_depacketizer_tests-implementation.adb @@ -52,7 +52,7 @@ package body Ccsds_Command_Depacketizer_Tests.Implementation is -- Construct a CCSDS packet with the given variable parameters: function Construct_Packet (Data : Byte_Array; Packet_Type : Ccsds_Packet_Type.E := Ccsds_Packet_Type.Telecommand; Secondary_Header : Ccsds_Secondary_Header_Indicator.E := Ccsds_Secondary_Header_Indicator.Secondary_Header_Present; Apid : Ccsds_Apid_Type := 0; Sequence_Count : Ccsds_Sequence_Count_Type := 0) return Ccsds_Space_Packet.T is -- Define packet: - Packet : Ccsds_Space_Packet.T := (Header => (Version => 0, Packet_Type => Packet_Type, Secondary_Header => Secondary_Header, Apid => Apid, Sequence_Flag => Ccsds_Sequence_Flag.Unsegmented, Sequence_Count => Sequence_Count, Packet_Length => Data'Length - 1), Data => (others => 0)); + Packet : Ccsds_Space_Packet.T := (Header => (Version => 0, Packet_Type => Packet_Type, Secondary_Header => Secondary_Header, Apid => Apid, Sequence_Flag => Ccsds_Sequence_Flag.Unsegmented, Sequence_Count => Sequence_Count, Packet_Length => Data'Length - 1), Data => [others => 0]); begin -- Set data: Packet.Data (Packet.Data'First .. Packet.Data'First + Data'Length - 1) := Data; @@ -60,7 +60,7 @@ package body Ccsds_Command_Depacketizer_Tests.Implementation is end Construct_Packet; -- Construct a CCSDS command packet with the given variable parameters: - function Construct_Command_Packet (Cmd_Id : Command_Types.Command_Id; Data : Byte_Array := (1 .. 0 => 0); Packet_Type : Ccsds_Packet_Type.E := Ccsds_Packet_Type.Telecommand; Secondary_Header : Ccsds_Secondary_Header_Indicator.E := Ccsds_Secondary_Header_Indicator.Secondary_Header_Present; Apid : Ccsds_Apid_Type := 0; Sequence_Count : Ccsds_Sequence_Count_Type := 0; Checksum_Seed : Xor_8.Xor_8_Type := 255; Function_Code : Ccsds_Command_Secondary_Header.Function_Code_Type := 0; Packet_Length_Adjustment : Integer := 0) return Ccsds_Space_Packet.T is + function Construct_Command_Packet (Cmd_Id : Command_Types.Command_Id; Data : Byte_Array := [1 .. 0 => 0]; Packet_Type : Ccsds_Packet_Type.E := Ccsds_Packet_Type.Telecommand; Secondary_Header : Ccsds_Secondary_Header_Indicator.E := Ccsds_Secondary_Header_Indicator.Secondary_Header_Present; Apid : Ccsds_Apid_Type := 0; Sequence_Count : Ccsds_Sequence_Count_Type := 0; Checksum_Seed : Xor_8.Xor_8_Type := 255; Function_Code : Ccsds_Command_Secondary_Header.Function_Code_Type := 0; Packet_Length_Adjustment : Integer := 0) return Ccsds_Space_Packet.T is -- Define secondary header: The_Secondary_Header : Ccsds_Command_Secondary_Header.T := (Reserved => 0, Function_Code => Function_Code, Checksum => 0); -- Construct packet: @@ -86,7 +86,7 @@ package body Ccsds_Command_Depacketizer_Tests.Implementation is function Construct_Command (Id : Command_Types.Command_Id; Arg_Buffer : Byte_Array) return Command.T is -- Construct the command: - Cmd : Command.T := (Header => (Source_Id => 0, Id => Id, Arg_Buffer_Length => Arg_Buffer'Length), Arg_Buffer => (others => 0)); + Cmd : Command.T := (Header => (Source_Id => 0, Id => Id, Arg_Buffer_Length => Arg_Buffer'Length), Arg_Buffer => [others => 0]); begin -- Set the argument buffer: Cmd.Arg_Buffer (Cmd.Arg_Buffer'First .. Cmd.Arg_Buffer'First + Cmd.Header.Arg_Buffer_Length - 1) := Arg_Buffer; @@ -99,10 +99,10 @@ package body Ccsds_Command_Depacketizer_Tests.Implementation is overriding procedure Test_Nominal_Depacketization (Self : in out Instance) is T : Component.Ccsds_Command_Depacketizer.Implementation.Tester.Instance_Access renames Self.Tester; - Packet : constant Ccsds_Space_Packet.T := Construct_Command_Packet (17, (0 => 16)); + Packet : constant Ccsds_Space_Packet.T := Construct_Command_Packet (17, [0 => 16]); Packet2 : constant Ccsds_Space_Packet.T := Construct_Command_Packet (22, Sequence_Count => 1); - Cmd : constant Command.T := Construct_Command (Id => 17, Arg_Buffer => (Command_Types.Command_Arg_Buffer_Type'First => 16)); - Cmd2 : constant Command.T := Construct_Command (Id => 22, Arg_Buffer => (1 .. 0 => 0)); + Cmd : constant Command.T := Construct_Command (Id => 17, Arg_Buffer => [Command_Types.Command_Arg_Buffer_Type'First => 16]); + Cmd2 : constant Command.T := Construct_Command (Id => 22, Arg_Buffer => [1 .. 0 => 0]); begin -- Send the packet: T.Ccsds_Space_Packet_T_Send (Packet); @@ -140,7 +140,7 @@ package body Ccsds_Command_Depacketizer_Tests.Implementation is overriding procedure Test_Invalid_Packet_Checksum (Self : in out Instance) is T : Component.Ccsds_Command_Depacketizer.Implementation.Tester.Instance_Access renames Self.Tester; - Packet : constant Ccsds_Space_Packet.T := Construct_Command_Packet (17, (0 => 16), Checksum_Seed => 0); + Packet : constant Ccsds_Space_Packet.T := Construct_Command_Packet (17, [0 => 16], Checksum_Seed => 0); Invalid_Checksum_Info : constant Invalid_Packet_Xor8_Info.T := (Ccsds_Header => (Packet.Header, (0, 0, 221)), Computed_Checksum => 255, Expected_Checksum => 221); begin -- Send the packet many times: @@ -173,7 +173,7 @@ package body Ccsds_Command_Depacketizer_Tests.Implementation is overriding procedure Test_Invalid_Packet_Type (Self : in out Instance) is T : Component.Ccsds_Command_Depacketizer.Implementation.Tester.Instance_Access renames Self.Tester; - Packet : constant Ccsds_Space_Packet.T := Construct_Command_Packet (17, (0 => 16), Packet_Type => Ccsds_Packet_Type.Telemetry); + Packet : constant Ccsds_Space_Packet.T := Construct_Command_Packet (17, [0 => 16], Packet_Type => Ccsds_Packet_Type.Telemetry); begin -- Send the packet many times: T.Ccsds_Space_Packet_T_Send (Packet); @@ -272,7 +272,7 @@ package body Ccsds_Command_Depacketizer_Tests.Implementation is overriding procedure Test_Packet_Too_Large (Self : in out Instance) is T : Component.Ccsds_Command_Depacketizer.Implementation.Tester.Instance_Access renames Self.Tester; - Bytes : constant Byte_Array := (0 .. 997 => 1); + Bytes : constant Byte_Array := [0 .. 997 => 1]; Packet : Ccsds_Space_Packet.T := Construct_Command_Packet (16#0101#, Bytes); begin -- Send the packet many times: @@ -339,7 +339,7 @@ package body Ccsds_Command_Depacketizer_Tests.Implementation is overriding procedure Test_Packet_Without_Secondary_Header (Self : in out Instance) is T : Component.Ccsds_Command_Depacketizer.Implementation.Tester.Instance_Access renames Self.Tester; - Packet : constant Ccsds_Space_Packet.T := Construct_Command_Packet (17, (0 => 16), Secondary_Header => Ccsds_Secondary_Header_Indicator.Secondary_Header_Not_Present); + Packet : constant Ccsds_Space_Packet.T := Construct_Command_Packet (17, [0 => 16], Secondary_Header => Ccsds_Secondary_Header_Indicator.Secondary_Header_Not_Present); begin -- Send the packet many times: T.Ccsds_Space_Packet_T_Send (Packet); @@ -371,10 +371,10 @@ package body Ccsds_Command_Depacketizer_Tests.Implementation is overriding procedure Test_Pad_Bytes (Self : in out Instance) is T : Component.Ccsds_Command_Depacketizer.Implementation.Tester.Instance_Access renames Self.Tester; - Packet_1 : constant Ccsds_Space_Packet.T := Construct_Command_Packet (17, (0 => 16), Sequence_Count => 0, Function_Code => 5); - Packet_2 : constant Ccsds_Space_Packet.T := Construct_Command_Packet (17, (0 => 16), Sequence_Count => 1, Function_Code => 127); - Packet_3 : constant Ccsds_Space_Packet.T := Construct_Command_Packet (17, (0 => 16), Sequence_Count => 2, Function_Code => 20); - Cmd : constant Command.T := Construct_Command (Id => 17, Arg_Buffer => (Command_Types.Command_Arg_Buffer_Type'First => 16)); + Packet_1 : constant Ccsds_Space_Packet.T := Construct_Command_Packet (17, [0 => 16], Sequence_Count => 0, Function_Code => 5); + Packet_2 : constant Ccsds_Space_Packet.T := Construct_Command_Packet (17, [0 => 16], Sequence_Count => 1, Function_Code => 127); + Packet_3 : constant Ccsds_Space_Packet.T := Construct_Command_Packet (17, [0 => 16], Sequence_Count => 2, Function_Code => 20); + Cmd : constant Command.T := Construct_Command (Id => 17, Arg_Buffer => [Command_Types.Command_Arg_Buffer_Type'First => 16]); begin -- Send the packet: T.Ccsds_Space_Packet_T_Send (Packet_1); @@ -452,7 +452,7 @@ package body Ccsds_Command_Depacketizer_Tests.Implementation is -- Make sure some events were thrown: Natural_Assert.Eq (T.Event_T_Recv_Sync_History.Get_Count, 1); Natural_Assert.Eq (T.Invalid_Command_Received_History.Get_Count, 1); - Invalid_Command_Info_Assert.Eq (T.Invalid_Command_Received_History.Get (1), (Id => T.Commands.Get_Reset_Counts_Id, Errant_Field_Number => Interfaces.Unsigned_32'Last, Errant_Field => (0, 0, 0, 0, 0, 0, 0, 5))); + Invalid_Command_Info_Assert.Eq (T.Invalid_Command_Received_History.Get (1), (Id => T.Commands.Get_Reset_Counts_Id, Errant_Field_Number => Interfaces.Unsigned_32'Last, Errant_Field => [0, 0, 0, 0, 0, 0, 0, 5])); end Test_Invalid_Command; end Ccsds_Command_Depacketizer_Tests.Implementation; diff --git a/src/components/ccsds_downsampler/apid_tree/test/apid_tree_tests-implementation.adb b/src/components/ccsds_downsampler/apid_tree/test/apid_tree_tests-implementation.adb index e3eaba2c..6675c519 100644 --- a/src/components/ccsds_downsampler/apid_tree/test/apid_tree_tests-implementation.adb +++ b/src/components/ccsds_downsampler/apid_tree/test/apid_tree_tests-implementation.adb @@ -40,7 +40,7 @@ package body Apid_Tree_Tests.Implementation is First_Index : Positive; Last_Index : Natural; Tree_Entry : Ccsds_Downsampler_Tree_Entry; - Apid_Start_List : aliased Ccsds_Downsample_Packet_List := ((Apid => 2, Filter_Factor => 0), (Apid => 3, Filter_Factor => 3), (Apid => 4, Filter_Factor => 1)); + Apid_Start_List : aliased Ccsds_Downsample_Packet_List := [(Apid => 2, Filter_Factor => 0), (Apid => 3, Filter_Factor => 3), (Apid => 4, Filter_Factor => 1)]; begin Tree.Init (Apid_Start_List'Unchecked_Access); -- "Filter" each Id and make sure we get the correct values and expected filter pairs @@ -116,7 +116,7 @@ package body Apid_Tree_Tests.Implementation is Set_Status : Filter_Factor_Set_Status; Ignore : Unsigned_16; Tree_Index : Positive; - Apid_Start_List : aliased Ccsds_Downsample_Packet_List := ((Apid => 1, Filter_Factor => 0), (Apid => 3, Filter_Factor => 1), (Apid => 5, Filter_Factor => 7)); + Apid_Start_List : aliased Ccsds_Downsample_Packet_List := [(Apid => 1, Filter_Factor => 0), (Apid => 3, Filter_Factor => 1), (Apid => 5, Filter_Factor => 7)]; begin Tree.Init (Apid_Start_List'Unchecked_Access); @@ -231,7 +231,7 @@ package body Apid_Tree_Tests.Implementation is Tree : Apid_Tree.Instance; Status : Filter_Action_Status; Cnt : Unsigned_16; - Apid_Start_List : aliased Ccsds_Downsample_Packet_List := ((Apid => 0, Filter_Factor => 1), (Apid => 1, Filter_Factor => 0), (Apid => 2, Filter_Factor => 3), (Apid => 5, Filter_Factor => 2)); + Apid_Start_List : aliased Ccsds_Downsample_Packet_List := [(Apid => 0, Filter_Factor => 1), (Apid => 1, Filter_Factor => 0), (Apid => 2, Filter_Factor => 3), (Apid => 5, Filter_Factor => 2)]; begin Tree.Init (Apid_Start_List'Unchecked_Access); diff --git a/src/components/ccsds_downsampler/component-ccsds_downsampler-implementation.adb b/src/components/ccsds_downsampler/component-ccsds_downsampler-implementation.adb index 8f9a6336..65ee0b3e 100644 --- a/src/components/ccsds_downsampler/component-ccsds_downsampler-implementation.adb +++ b/src/components/ccsds_downsampler/component-ccsds_downsampler-implementation.adb @@ -51,7 +51,7 @@ package body Component.Ccsds_Downsampler.Implementation is use Data_Product_Types; Timestamp : constant Sys_Time.T := Self.Sys_Time_T_Get; Dp_Id : constant Data_Product_Id := Self.Data_Products.Get_Id_Base + Data_Product_Id (Tree_Index - 1) + Data_Product_Id (Ccsds_Downsampler_Data_Products.Num_Data_Products); - Dp : Data_Product.T := (Header => (Id => Dp_Id, Time => Timestamp, Buffer_Length => Packed_U16.Serialization.Serialized_Length), Buffer => (others => 0)); + Dp : Data_Product.T := (Header => (Id => Dp_Id, Time => Timestamp, Buffer_Length => Packed_U16.Serialization.Serialized_Length), Buffer => [others => 0]); begin Dp.Buffer (Dp.Buffer'First .. Dp.Buffer'First + Packed_U16.Serialization.Serialized_Length - 1) := Packed_U16.Serialization.To_Byte_Array ((Value => Tree_Entry.Filter_Factor)); Self.Data_Product_T_Send_If_Connected ((Dp)); diff --git a/src/components/ccsds_downsampler/gen/templates/ccsds_downsampler_filters/name.ads b/src/components/ccsds_downsampler/gen/templates/ccsds_downsampler_filters/name.ads index 46b4b7ee..f3797228 100644 --- a/src/components/ccsds_downsampler/gen/templates/ccsds_downsampler_filters/name.ads +++ b/src/components/ccsds_downsampler/gen/templates/ccsds_downsampler_filters/name.ads @@ -8,7 +8,7 @@ package {{ name }} is -- Size of the initial list of the downsampler Downsample_List_Size_In_Bytes : constant Natural := {{ size }}; -- The initial list for the downsampler - Downsample_List : aliased Ccsds_Downsample_Packet_List := ( + Downsample_List : aliased Ccsds_Downsample_Packet_List := [ {% for apid in filter_products.values() %} -- {{ apid.name }} {% if apid.description %} @@ -19,7 +19,7 @@ package {{ name }} is Filter_Factor => {{ apid.filter_factor}} ){{ "," if not loop.last }} {% endfor %} - ); + ]; -- Access for the downsample list Downsample_List_Access : Ccsds_Downsample_Packet_List_Access := Downsample_List'Access; diff --git a/src/components/ccsds_downsampler/test/ccsds_downsampler_tests-implementation.adb b/src/components/ccsds_downsampler/test/ccsds_downsampler_tests-implementation.adb index 2b765bc1..5074ae2b 100644 --- a/src/components/ccsds_downsampler/test/ccsds_downsampler_tests-implementation.adb +++ b/src/components/ccsds_downsampler/test/ccsds_downsampler_tests-implementation.adb @@ -47,7 +47,7 @@ package body Ccsds_Downsampler_Tests.Implementation is -- Helper function to create data product definitions function Test_Dp_Recieved (Id : in Data_Product_Types.Data_Product_Id; Product_Value : in Unsigned_16) return Data_Product.T is - Dp : Data_Product.T := (Header => (Id => Id, Time => (0, 0), Buffer_Length => Packed_U16.Serialization.Serialized_Length), Buffer => (others => 0)); + Dp : Data_Product.T := (Header => (Id => Id, Time => (0, 0), Buffer_Length => Packed_U16.Serialization.Serialized_Length), Buffer => [others => 0]); begin Dp.Buffer (Dp.Buffer'First .. Dp.Buffer'First + Packed_U16.Serialization.Serialized_Length - 1) := Packed_U16.Serialization.To_Byte_Array ((Value => Product_Value)); return Dp; @@ -387,7 +387,7 @@ package body Ccsds_Downsampler_Tests.Implementation is -- Make sure some events were thrown: Natural_Assert.Eq (T.Event_T_Recv_Sync_History.Get_Count, 1); Natural_Assert.Eq (T.Invalid_Command_Received_History.Get_Count, 1); - Invalid_Command_Info_Assert.Eq (T.Invalid_Command_Received_History.Get (1), (Id => T.Commands.Get_Modify_Filter_Factor_Id, Errant_Field_Number => Interfaces.Unsigned_32'Last, Errant_Field => (0, 0, 0, 0, 0, 0, 0, 0))); + Invalid_Command_Info_Assert.Eq (T.Invalid_Command_Received_History.Get (1), (Id => T.Commands.Get_Modify_Filter_Factor_Id, Errant_Field_Number => Interfaces.Unsigned_32'Last, Errant_Field => [0, 0, 0, 0, 0, 0, 0, 0])); end Test_Invalid_Command; end Ccsds_Downsampler_Tests.Implementation; diff --git a/src/components/ccsds_packetizer/component-ccsds_packetizer-implementation.adb b/src/components/ccsds_packetizer/component-ccsds_packetizer-implementation.adb index 418f6b38..e2e4928f 100644 --- a/src/components/ccsds_packetizer/component-ccsds_packetizer-implementation.adb +++ b/src/components/ccsds_packetizer/component-ccsds_packetizer-implementation.adb @@ -43,7 +43,7 @@ package body Component.Ccsds_Packetizer.Implementation is Sequence_Count => Ccsds_Sequence_Count_Type (P.Header.Sequence_Count), Packet_Length => Unsigned_16 (Sys_Time.Serialization.Serialized_Length + P.Header.Buffer_Length + Crc_16_Type'Length - 1) ), - Data => (others => 0) + Data => [others => 0] ); begin -- Copy the timestamp: diff --git a/src/components/ccsds_packetizer/test/ccsds_packetizer_tests-implementation.adb b/src/components/ccsds_packetizer/test/ccsds_packetizer_tests-implementation.adb index 8eb2bfe0..c7d425f6 100644 --- a/src/components/ccsds_packetizer/test/ccsds_packetizer_tests-implementation.adb +++ b/src/components/ccsds_packetizer/test/ccsds_packetizer_tests-implementation.adb @@ -85,7 +85,7 @@ package body Ccsds_Packetizer_Tests.Implementation is overriding procedure Test_Nominal_Packetization (Self : in out Instance) is use Packet_Types; T : Component.Ccsds_Packetizer.Implementation.Tester.Instance_Access renames Self.Tester; - P : Packet.T := (Header => (Time => (10, 55), Id => 77, Sequence_Count => 99, Buffer_Length => 5), Buffer => (1, 2, 3, 4, 5, others => 0)); + P : Packet.T := (Header => (Time => (10, 55), Id => 77, Sequence_Count => 99, Buffer_Length => 5), Buffer => [1, 2, 3, 4, 5, others => 0]); begin -- Send a few packets: P.Header.Sequence_Count := P.Header.Sequence_Count + 1; @@ -117,7 +117,7 @@ package body Ccsds_Packetizer_Tests.Implementation is T : Component.Ccsds_Packetizer.Implementation.Tester.Instance_Access renames Self.Tester; P : Packet.T := (Header => (Time => (10, 55), Id => 77, Sequence_Count => 13, Buffer_Length => Packet_Types.Packet_Buffer_Type'Length), - Buffer => (0 => 1, 1 => 2, 2 => 3, 3 => 4, 4 => 5, 5 .. Packet_Types.Packet_Buffer_Type'Last - 1 => 22, Packet_Types.Packet_Buffer_Type'Last => 9)); + Buffer => [0 => 1, 1 => 2, 2 => 3, 3 => 4, 4 => 5, 5 .. Packet_Types.Packet_Buffer_Type'Last - 1 => 22, Packet_Types.Packet_Buffer_Type'Last => 9]); begin -- Send a few packets: P.Header.Sequence_Count := P.Header.Sequence_Count + 1; @@ -147,7 +147,7 @@ package body Ccsds_Packetizer_Tests.Implementation is overriding procedure Test_Min_Size_Packetization (Self : in out Instance) is use Packet_Types; T : Component.Ccsds_Packetizer.Implementation.Tester.Instance_Access renames Self.Tester; - P : Packet.T := (Header => (Time => (10, 55), Id => 13, Sequence_Count => 77, Buffer_Length => 0), Buffer => (0 => 1, 1 => 2, 2 => 3, 3 => 4, 4 => 5, 5 .. Packet_Types.Packet_Buffer_Type'Last - 1 => 22, Packet_Types.Packet_Buffer_Type'Last => 9)); + P : Packet.T := (Header => (Time => (10, 55), Id => 13, Sequence_Count => 77, Buffer_Length => 0), Buffer => [0 => 1, 1 => 2, 2 => 3, 3 => 4, 4 => 5, 5 .. Packet_Types.Packet_Buffer_Type'Last - 1 => 22, Packet_Types.Packet_Buffer_Type'Last => 9]); begin -- Send a few packets: P.Header.Sequence_Count := P.Header.Sequence_Count + 1; diff --git a/src/components/ccsds_product_extractor/extract_data_product.adb b/src/components/ccsds_product_extractor/extract_data_product.adb index 7cb1cc5d..c90377e7 100644 --- a/src/components/ccsds_product_extractor/extract_data_product.adb +++ b/src/components/ccsds_product_extractor/extract_data_product.adb @@ -11,7 +11,7 @@ package body Extract_Data_Product is Id => Id, Buffer_Length => Length ), - Buffer => (others => 0) + Buffer => [others => 0] ); -- Dont try to read if its going to overflow out of the packet. diff --git a/src/components/ccsds_product_extractor/gen/templates/extracted_products/name.adb b/src/components/ccsds_product_extractor/gen/templates/extracted_products/name.adb index 3633a9ff..1a145241 100644 --- a/src/components/ccsds_product_extractor/gen/templates/extracted_products/name.adb +++ b/src/components/ccsds_product_extractor/gen/templates/extracted_products/name.adb @@ -28,7 +28,7 @@ package body {{ name }} is Invalid_Data_Product := ( Id => Data_Product_Types.Data_Product_Id'First, Errant_Field_Number => 0, - Errant_Field => (others => 0) + Errant_Field => [others => 0] ); -- Use the generic extraction function using the autocoded values from the YAML file to get the information needed from the packet @@ -62,7 +62,7 @@ package body {{ name }} is when False => -- When there is a validation error, fill in a data structure with the relevant information for the component to use to send an event. declare - P_Type : Basic_Types.Poly_Type := (others => 0); + P_Type : Basic_Types.Poly_Type := [others => 0]; begin -- Copy extracted value into poly type Byte_Array_Util.Safe_Right_Copy (P_Type, Pkt.Data ({{data_product.offset}} .. {{data_product.offset}} + {{ data_product.product_type }}.Size_In_Bytes - 1)); diff --git a/src/components/ccsds_product_extractor/gen/templates/extracted_products/name.ads b/src/components/ccsds_product_extractor/gen/templates/extracted_products/name.ads index c0b473d8..3a4e32f5 100644 --- a/src/components/ccsds_product_extractor/gen/templates/extracted_products/name.ads +++ b/src/components/ccsds_product_extractor/gen/templates/extracted_products/name.ads @@ -20,22 +20,22 @@ package {{ name }} is {% endfor %} {% endfor %} {% for apid, products in apids.items() %} - Extract_Products_{{apid}} : aliased Extractor_List := ( + Extract_Products_{{apid}} : aliased Extractor_List := [ {% for data_product in products %} {{ loop.index0 }} => Extract_And_Validate_{{data_product.name}}'Access{{ "," if not loop.last }} {% endfor %} - ); + ]; {% endfor %} -- Initial product extraction list containing the information to extract all the products requested by each apid - Data_Product_Extraction_List : aliased Extracted_Product_List := ( + Data_Product_Extraction_List : aliased Extracted_Product_List := [ {% for apid, products in apids.items() %} {{ loop.index0 }} => ( Apid => {{ apid }}, Extract_List => Extract_Products_{{apid}}'Access ){{ "," if not loop.last }} {% endfor %} - ); + ]; Data_Product_Extraction_List_Access : constant Extracted_Product_List_Access := Data_Product_Extraction_List'Access; end {{ name }}; diff --git a/src/components/ccsds_product_extractor/test/ccsds_product_extractor_tests-implementation.adb b/src/components/ccsds_product_extractor/test/ccsds_product_extractor_tests-implementation.adb index 4b78ccdf..83d3638a 100644 --- a/src/components/ccsds_product_extractor/test/ccsds_product_extractor_tests-implementation.adb +++ b/src/components/ccsds_product_extractor/test/ccsds_product_extractor_tests-implementation.adb @@ -45,35 +45,35 @@ package body Ccsds_Product_Extractor_Tests.Implementation is -- Helper function to create data product definitions function Test_Dp_Recieved_Natural (Id : in Data_Product_Types.Data_Product_Id; Product_Value : in Natural; Timestamp : in Sys_Time.T) return Data_Product.T is - Dp : Data_Product.T := (Header => (Id => Id, Time => Timestamp, Buffer_Length => Packed_Natural.Serialization.Serialized_Length), Buffer => (others => 16#FF#)); + Dp : Data_Product.T := (Header => (Id => Id, Time => Timestamp, Buffer_Length => Packed_Natural.Serialization.Serialized_Length), Buffer => [others => 16#FF#]); begin Dp.Buffer (Dp.Buffer'First .. Dp.Buffer'First + Packed_Natural.Serialization.Serialized_Length - 1) := Packed_Natural.Serialization.To_Byte_Array ((Value => Product_Value)); return Dp; end Test_Dp_Recieved_Natural; function Test_Dp_Recieved_Natural_Le (Id : in Data_Product_Types.Data_Product_Id; Product_Value : in Natural; Timestamp : in Sys_Time.T) return Data_Product.T is - Dp : Data_Product.T := (Header => (Id => Id, Time => Timestamp, Buffer_Length => Packed_Natural.Serialization_Le.Serialized_Length), Buffer => (others => 16#FF#)); + Dp : Data_Product.T := (Header => (Id => Id, Time => Timestamp, Buffer_Length => Packed_Natural.Serialization_Le.Serialized_Length), Buffer => [others => 16#FF#]); begin Dp.Buffer (Dp.Buffer'First .. Dp.Buffer'First + Packed_Natural.Serialization_Le.Serialized_Length - 1) := Packed_Natural.Serialization_Le.To_Byte_Array ((Value => Product_Value)); return Dp; end Test_Dp_Recieved_Natural_Le; function Test_Dp_Recieved_U32 (Id : in Data_Product_Types.Data_Product_Id; Product_Value : in Unsigned_32; Timestamp : in Sys_Time.T) return Data_Product.T is - Dp : Data_Product.T := (Header => (Id => Id, Time => Timestamp, Buffer_Length => Packed_U32.Serialization.Serialized_Length), Buffer => (others => 16#FF#)); + Dp : Data_Product.T := (Header => (Id => Id, Time => Timestamp, Buffer_Length => Packed_U32.Serialization.Serialized_Length), Buffer => [others => 16#FF#]); begin Dp.Buffer (Dp.Buffer'First .. Dp.Buffer'First + Packed_U32.Serialization.Serialized_Length - 1) := Packed_U32.Serialization.To_Byte_Array ((Value => Product_Value)); return Dp; end Test_Dp_Recieved_U32; function Test_Dp_Recieved_U16 (Id : in Data_Product_Types.Data_Product_Id; Product_Value : in Unsigned_16; Timestamp : in Sys_Time.T) return Data_Product.T is - Dp : Data_Product.T := (Header => (Id => Id, Time => Timestamp, Buffer_Length => Packed_U16.Serialization.Serialized_Length), Buffer => (others => 16#FF#)); + Dp : Data_Product.T := (Header => (Id => Id, Time => Timestamp, Buffer_Length => Packed_U16.Serialization.Serialized_Length), Buffer => [others => 16#FF#]); begin Dp.Buffer (Dp.Buffer'First .. Dp.Buffer'First + Packed_U16.Serialization.Serialized_Length - 1) := Packed_U16.Serialization.To_Byte_Array ((Value => Product_Value)); return Dp; end Test_Dp_Recieved_U16; function Test_Dp_Recieved_U8 (Id : in Data_Product_Types.Data_Product_Id; Product_Value : in Unsigned_8; Timestamp : in Sys_Time.T) return Data_Product.T is - Dp : Data_Product.T := (Header => (Id => Id, Time => Timestamp, Buffer_Length => Packed_Byte.Serialization.Serialized_Length), Buffer => (others => 16#FF#)); + Dp : Data_Product.T := (Header => (Id => Id, Time => Timestamp, Buffer_Length => Packed_Byte.Serialization.Serialized_Length), Buffer => [others => 16#FF#]); begin Dp.Buffer (Dp.Buffer'First .. Dp.Buffer'First + Packed_Byte.Serialization.Serialized_Length - 1) := Packed_Byte.Serialization.To_Byte_Array ((Value => Product_Value)); return Dp; @@ -102,19 +102,19 @@ package body Ccsds_Product_Extractor_Tests.Implementation is -- Setup some basic packet info. Start with 0 values just to make sure things are working first. Incoming_Packet_Apid_100.Header.Apid := 100; Incoming_Packet_Apid_100.Header.Packet_Length := 50; - Incoming_Packet_Apid_100.Data := (others => 0); + Incoming_Packet_Apid_100.Data := [others => 0]; Incoming_Packet_Apid_200.Header.Apid := 200; Incoming_Packet_Apid_200.Header.Packet_Length := 30; - Incoming_Packet_Apid_200.Data := (others => 0); + Incoming_Packet_Apid_200.Data := [others => 0]; Incoming_Packet_Apid_300.Header.Apid := 300; Incoming_Packet_Apid_300.Header.Packet_Length := 20; - Incoming_Packet_Apid_300.Data := (others => 0); + Incoming_Packet_Apid_300.Data := [others => 0]; Incoming_Packet_Apid_400.Header.Apid := 400; Incoming_Packet_Apid_400.Header.Packet_Length := 5; - Incoming_Packet_Apid_400.Data := (others => 0); + Incoming_Packet_Apid_400.Data := [others => 0]; -- First time through, make sure the data products are 0 T.Ccsds_Space_Packet_T_Send (Incoming_Packet_Apid_100); diff --git a/src/components/ccsds_router/test/ccsds_router_tests-implementation.adb b/src/components/ccsds_router/test/ccsds_router_tests-implementation.adb index 0e9a63de..ee809e52 100644 --- a/src/components/ccsds_router/test/ccsds_router_tests-implementation.adb +++ b/src/components/ccsds_router/test/ccsds_router_tests-implementation.adb @@ -55,7 +55,7 @@ package body Ccsds_Router_Tests.Implementation is Sequence_Count => Ccsds_Sequence_Count_Type (53), Packet_Length => 0 ), - Data => (others => 0) + Data => [others => 0] ); Packet_1 : Ccsds_Space_Packet.T := ( Header => ( @@ -67,7 +67,7 @@ package body Ccsds_Router_Tests.Implementation is Sequence_Count => Ccsds_Sequence_Count_Type (53), Packet_Length => 6 ), - Data => (1, 2, 3, 4, 5, 6, 7, others => 0) + Data => [1, 2, 3, 4, 5, 6, 7, others => 0] ); Packet_2 : Ccsds_Space_Packet.T := ( Header => ( @@ -79,7 +79,7 @@ package body Ccsds_Router_Tests.Implementation is Sequence_Count => Ccsds_Sequence_Count_Type (12), Packet_Length => Ccsds_Space_Packet.Ccsds_Data_Type'Length - 1 ), - Data => (others => 99) + Data => [others => 99] ); Packet_3 : Ccsds_Space_Packet.T := ( Header => ( @@ -91,7 +91,7 @@ package body Ccsds_Router_Tests.Implementation is Sequence_Count => Ccsds_Sequence_Count_Type (1), Packet_Length => 17 ), - Data => (1, 2, 3, 4, 5, 6, 7, others => 255) + Data => [1, 2, 3, 4, 5, 6, 7, others => 255] ); Packet_4 : Ccsds_Space_Packet.T := ( Header => ( @@ -103,7 +103,7 @@ package body Ccsds_Router_Tests.Implementation is Sequence_Count => Ccsds_Sequence_Count_Type (53), Packet_Length => 4 ), - Data => (others => 4) + Data => [others => 4] ); Packet_5 : Ccsds_Space_Packet.T := ( Header => ( @@ -115,7 +115,7 @@ package body Ccsds_Router_Tests.Implementation is Sequence_Count => Ccsds_Sequence_Count_Type (53), Packet_Length => 5 ), - Data => (others => 5) + Data => [others => 5] ); Packet_6 : Ccsds_Space_Packet.T := ( Header => ( @@ -127,7 +127,7 @@ package body Ccsds_Router_Tests.Implementation is Sequence_Count => Ccsds_Sequence_Count_Type (53), Packet_Length => 6 ), - Data => (others => 6) + Data => [others => 6] ); Packet_7 : Ccsds_Space_Packet.T := ( Header => ( @@ -139,7 +139,7 @@ package body Ccsds_Router_Tests.Implementation is Sequence_Count => Ccsds_Sequence_Count_Type (53), Packet_Length => 7 ), - Data => (others => 7) + Data => [others => 7] ); Packet_8 : Ccsds_Space_Packet.T := ( Header => ( @@ -151,7 +151,7 @@ package body Ccsds_Router_Tests.Implementation is Sequence_Count => Ccsds_Sequence_Count_Type (53), Packet_Length => 8 ), - Data => (others => 8) + Data => [others => 8] ); Packet_9 : Ccsds_Space_Packet.T := ( Header => ( @@ -163,7 +163,7 @@ package body Ccsds_Router_Tests.Implementation is Sequence_Count => Ccsds_Sequence_Count_Type (53), Packet_Length => 9 ), - Data => (others => 9) + Data => [others => 9] ); procedure Check_Routing @@ -189,14 +189,14 @@ package body Ccsds_Router_Tests.Implementation is procedure Init_Nominal is -- Router table entries: - Router_Table : constant Router_Table_Entry_Array := - ( - -- Table entry for APID: 1 - 0 => (Apid => 1, Destinations => null, Sequence_Count_Mode => No_Check), - -- Table entry for APID: 2 - 1 => (Apid => 2, Destinations => null, Sequence_Count_Mode => No_Check), - -- Table entry for APID: 3 - 2 => (Apid => 3, Destinations => null, Sequence_Count_Mode => Warn)); + Router_Table : constant Router_Table_Entry_Array := [ + -- Table entry for APID: 1 + 0 => (Apid => 1, Destinations => null, Sequence_Count_Mode => No_Check), + -- Table entry for APID: 2 + 1 => (Apid => 2, Destinations => null, Sequence_Count_Mode => No_Check), + -- Table entry for APID: 3 + 2 => (Apid => 3, Destinations => null, Sequence_Count_Mode => Warn) + ]; begin T.Component_Instance.Init (Router_Table); exception @@ -206,16 +206,16 @@ package body Ccsds_Router_Tests.Implementation is end Init_Nominal; procedure Init_Index_Out_Of_Range_1 is - Destination_Table_1 : aliased Destination_Table := (0 => 100); + Destination_Table_1 : aliased Destination_Table := [0 => 100]; -- Router table entries: - Router_Table : constant Router_Table_Entry_Array := - ( - -- Table entry for APID: 1 - 0 => (Apid => 1, Destinations => Destination_Table_1'Unchecked_Access, Sequence_Count_Mode => No_Check), - -- Table entry for APID: 2 - 1 => (Apid => 2, Destinations => null, Sequence_Count_Mode => No_Check), - -- Table entry for APID: 3 - 2 => (Apid => 3, Destinations => null, Sequence_Count_Mode => Warn)); + Router_Table : constant Router_Table_Entry_Array := [ + -- Table entry for APID: 1 + 0 => (Apid => 1, Destinations => Destination_Table_1'Unchecked_Access, Sequence_Count_Mode => No_Check), + -- Table entry for APID: 2 + 1 => (Apid => 2, Destinations => null, Sequence_Count_Mode => No_Check), + -- Table entry for APID: 3 + 2 => (Apid => 3, Destinations => null, Sequence_Count_Mode => Warn) + ]; begin T.Component_Instance.Init (Router_Table); -- Should never get here: @@ -227,16 +227,16 @@ package body Ccsds_Router_Tests.Implementation is end Init_Index_Out_Of_Range_1; procedure Init_Index_Out_Of_Range_2 is - Destination_Table_1 : aliased Destination_Table := (0 => 7); + Destination_Table_1 : aliased Destination_Table := [0 => 7]; -- Router table entries: - Router_Table : constant Router_Table_Entry_Array := - ( - -- Table entry for APID: 1 - 0 => (Apid => 1, Destinations => null, Sequence_Count_Mode => No_Check), - -- Table entry for APID: 2 - 1 => (Apid => 2, Destinations => Destination_Table_1'Unchecked_Access, Sequence_Count_Mode => No_Check), - -- Table entry for APID: 3 - 2 => (Apid => 3, Destinations => null, Sequence_Count_Mode => Warn)); + Router_Table : constant Router_Table_Entry_Array := [ + -- Table entry for APID: 1 + 0 => (Apid => 1, Destinations => null, Sequence_Count_Mode => No_Check), + -- Table entry for APID: 2 + 1 => (Apid => 2, Destinations => Destination_Table_1'Unchecked_Access, Sequence_Count_Mode => No_Check), + -- Table entry for APID: 3 + 2 => (Apid => 3, Destinations => null, Sequence_Count_Mode => Warn) + ]; begin T.Component_Instance.Init (Router_Table); -- Should never get here: @@ -249,14 +249,14 @@ package body Ccsds_Router_Tests.Implementation is procedure Init_Duplicate is -- Router table entries: - Router_Table : constant Router_Table_Entry_Array := - ( - -- Table entry for APID: 1 - 0 => (Apid => 1, Destinations => null, Sequence_Count_Mode => No_Check), - -- Table entry for APID: 2 - 1 => (Apid => 2, Destinations => null, Sequence_Count_Mode => No_Check), - -- Table entry for APID: 3 - 2 => (Apid => 2, Destinations => null, Sequence_Count_Mode => Warn)); + Router_Table : constant Router_Table_Entry_Array := [ + -- Table entry for APID: 1 + 0 => (Apid => 1, Destinations => null, Sequence_Count_Mode => No_Check), + -- Table entry for APID: 2 + 1 => (Apid => 2, Destinations => null, Sequence_Count_Mode => No_Check), + -- Table entry for APID: 3 + 2 => (Apid => 2, Destinations => null, Sequence_Count_Mode => Warn) + ]; begin T.Component_Instance.Init (Router_Table); -- Should never get here: diff --git a/src/components/ccsds_router/test_unrecognized_apid/unrecognized_apid_tests-implementation.adb b/src/components/ccsds_router/test_unrecognized_apid/unrecognized_apid_tests-implementation.adb index 23dc5335..24f9e0e0 100644 --- a/src/components/ccsds_router/test_unrecognized_apid/unrecognized_apid_tests-implementation.adb +++ b/src/components/ccsds_router/test_unrecognized_apid/unrecognized_apid_tests-implementation.adb @@ -34,9 +34,9 @@ package body Unrecognized_Apid_Tests.Implementation is Self.Tester.Final_Base; end Tear_Down_Test; - Packet_0 : Ccsds_Space_Packet.T := (Header => (Version => 0, Packet_Type => Ccsds_Packet_Type.Telecommand, Secondary_Header => Ccsds_Secondary_Header_Indicator.Secondary_Header_Not_Present, Apid => Ccsds_Apid_Type (0), Sequence_Flag => Ccsds_Sequence_Flag.Unsegmented, Sequence_Count => Ccsds_Sequence_Count_Type (53), Packet_Length => 0), Data => (others => 0)); + Packet_0 : Ccsds_Space_Packet.T := (Header => (Version => 0, Packet_Type => Ccsds_Packet_Type.Telecommand, Secondary_Header => Ccsds_Secondary_Header_Indicator.Secondary_Header_Not_Present, Apid => Ccsds_Apid_Type (0), Sequence_Flag => Ccsds_Sequence_Flag.Unsegmented, Sequence_Count => Ccsds_Sequence_Count_Type (53), Packet_Length => 0), Data => [others => 0]); - Packet_9 : Ccsds_Space_Packet.T := (Header => (Version => 0, Packet_Type => Ccsds_Packet_Type.Telecommand, Secondary_Header => Ccsds_Secondary_Header_Indicator.Secondary_Header_Not_Present, Apid => Ccsds_Apid_Type (9), Sequence_Flag => Ccsds_Sequence_Flag.Unsegmented, Sequence_Count => Ccsds_Sequence_Count_Type (53), Packet_Length => 9), Data => (others => 9)); + Packet_9 : Ccsds_Space_Packet.T := (Header => (Version => 0, Packet_Type => Ccsds_Packet_Type.Telecommand, Secondary_Header => Ccsds_Secondary_Header_Indicator.Secondary_Header_Not_Present, Apid => Ccsds_Apid_Type (9), Sequence_Flag => Ccsds_Sequence_Flag.Unsegmented, Sequence_Count => Ccsds_Sequence_Count_Type (53), Packet_Length => 9), Data => [others => 9]); procedure Check_Routing (Self : in out Instance; Count_1 : in Natural; Count_2 : in Natural; Count_3 : in Natural; Count_4 : in Natural; Count_5 : in Natural; Count_6 : in Natural; Filename : in String := Smart_Assert.Sinfo.File; Line : in Natural := Smart_Assert.Sinfo.Line) is T : Component.Ccsds_Router.Implementation.Tester.Instance_Access renames Self.Tester; diff --git a/src/components/ccsds_serial_interface/component-ccsds_serial_interface-implementation.ads b/src/components/ccsds_serial_interface/component-ccsds_serial_interface-implementation.ads index 3f866d47..a54da0d2 100644 --- a/src/components/ccsds_serial_interface/component-ccsds_serial_interface-implementation.ads +++ b/src/components/ccsds_serial_interface/component-ccsds_serial_interface-implementation.ads @@ -11,7 +11,7 @@ with Ada.Task_Identification; package Component.Ccsds_Serial_Interface.Implementation is -- Sync pattern for serial. Made public so it can be used elsewhere. - Sync_Pattern : constant Basic_Types.Byte_Array := (0 => 16#FE#, 1 => 16#D4#, 2 => 16#AF#, 3 => 16#EE#); + Sync_Pattern : constant Basic_Types.Byte_Array := [0 => 16#FE#, 1 => 16#D4#, 2 => 16#AF#, 3 => 16#EE#]; -- The component class instance record: type Instance is new Ccsds_Serial_Interface.Base_Instance with private; diff --git a/src/components/ccsds_serial_interface/test_read/ccsds_serial_interface_tests-implementation.adb b/src/components/ccsds_serial_interface/test_read/ccsds_serial_interface_tests-implementation.adb index 89f6ae2f..d64ceffe 100644 --- a/src/components/ccsds_serial_interface/test_read/ccsds_serial_interface_tests-implementation.adb +++ b/src/components/ccsds_serial_interface/test_read/ccsds_serial_interface_tests-implementation.adb @@ -50,7 +50,7 @@ package body Ccsds_Serial_Interface_Tests.Implementation is (Header => (Version => 0, Packet_Type => Ccsds_Packet_Type.Telecommand, Secondary_Header => Ccsds_Secondary_Header_Indicator.Secondary_Header_Not_Present, Apid => Ccsds_Apid_Type (15), Sequence_Flag => Ccsds_Sequence_Flag.Unsegmented, Sequence_Count => Ccsds_Sequence_Count_Type (22), Packet_Length => 8 - 1), - Data => (1, 2, 3, 4, 5, 6, 7, 8, others => 0)); + Data => [1, 2, 3, 4, 5, 6, 7, 8, others => 0]); begin -- Expected to get packet: Put_Line ("Expected to get packet:"); diff --git a/src/components/ccsds_serial_interface/test_write/ccsds_serial_interface_tests-implementation.adb b/src/components/ccsds_serial_interface/test_write/ccsds_serial_interface_tests-implementation.adb index 50e8ba7f..56b2f8a4 100644 --- a/src/components/ccsds_serial_interface/test_write/ccsds_serial_interface_tests-implementation.adb +++ b/src/components/ccsds_serial_interface/test_write/ccsds_serial_interface_tests-implementation.adb @@ -41,7 +41,7 @@ package body Ccsds_Serial_Interface_Tests.Implementation is (Header => (Version => 0, Packet_Type => Ccsds_Packet_Type.Telecommand, Secondary_Header => Ccsds_Secondary_Header_Indicator.Secondary_Header_Not_Present, Apid => Ccsds_Apid_Type (15), Sequence_Flag => Ccsds_Sequence_Flag.Unsegmented, Sequence_Count => Ccsds_Sequence_Count_Type (22), Packet_Length => 10 - 1), - Data => (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, others => 0)); + Data => [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, others => 0]); begin -- Put_Line("Starting test."); diff --git a/src/components/ccsds_serial_interface/uart/test/test.adb b/src/components/ccsds_serial_interface/uart/test/test.adb index a2408fed..babbe39a 100644 --- a/src/components/ccsds_serial_interface/uart/test/test.adb +++ b/src/components/ccsds_serial_interface/uart/test/test.adb @@ -4,6 +4,6 @@ procedure Test is begin -- Hello, world! - Diagnostic_Uart.Put ((72, 101, 108, 108, 111, 44, 32, 119, 111, 114, 108, 100, 33)); + Diagnostic_Uart.Put ([72, 101, 108, 108, 111, 44, 32, 119, 111, 114, 108, 100, 33]); end Test; diff --git a/src/components/ccsds_socket_interface/component-ccsds_socket_interface-implementation.adb b/src/components/ccsds_socket_interface/component-ccsds_socket_interface-implementation.adb index c29d2d2c..917808b9 100644 --- a/src/components/ccsds_socket_interface/component-ccsds_socket_interface-implementation.adb +++ b/src/components/ccsds_socket_interface/component-ccsds_socket_interface-implementation.adb @@ -40,7 +40,7 @@ package body Component.Ccsds_Socket_Interface.Implementation is begin -- Set object variables: pragma Assert (Addr'Length <= Self.Addr'Length, "Address string is too long."); - Self.Addr := (others => ' '); -- clear the string + Self.Addr := [others => ' ']; -- clear the string Self.Addr (Self.Addr'First .. Self.Addr'First + Addr'Length - 1) := Addr; -- copy addr over Self.Port := Port; diff --git a/src/components/ccsds_socket_interface/test_read/tests-implementation.adb b/src/components/ccsds_socket_interface/test_read/tests-implementation.adb index 4066790a..2363357e 100644 --- a/src/components/ccsds_socket_interface/test_read/tests-implementation.adb +++ b/src/components/ccsds_socket_interface/test_read/tests-implementation.adb @@ -52,7 +52,7 @@ package body Tests.Implementation is use Ccsds_Primary_Header; use Interfaces; T : Component.Ccsds_Socket_Interface.Implementation.Tester.Instance_Access renames Self.Tester; - Address : constant Socket_Address.T := (Ip_Address => (127, 0, 0, 1), Port => Self.Port); + Address : constant Socket_Address.T := (Ip_Address => [127, 0, 0, 1], Port => Self.Port); -- Start the socket internal listener thread: Socket_Listener_Task_Signal : aliased Ada.Synchronous_Task_Control.Suspension_Object; Socket_Listener_Task_Info : aliased Task_Types.Task_Info; @@ -62,7 +62,7 @@ package body Tests.Implementation is (Header => (Version => 0, Packet_Type => Ccsds_Packet_Type.Telecommand, Secondary_Header => Ccsds_Secondary_Header_Indicator.Secondary_Header_Not_Present, Apid => Ccsds_Apid_Type (15), Sequence_Flag => Ccsds_Sequence_Flag.Unsegmented, Sequence_Count => Ccsds_Sequence_Count_Type (22), Packet_Length => 8 - 1), - Data => (1, 2, 3, 4, 5, 6, 7, 8, others => 0)); + Data => [1, 2, 3, 4, 5, 6, 7, 8, others => 0]); begin -- Expected to get packet: Put_Line ("Expected to get packet:"); diff --git a/src/components/ccsds_socket_interface/test_write/tests-implementation.adb b/src/components/ccsds_socket_interface/test_write/tests-implementation.adb index b3d2275c..96758b20 100644 --- a/src/components/ccsds_socket_interface/test_write/tests-implementation.adb +++ b/src/components/ccsds_socket_interface/test_write/tests-implementation.adb @@ -49,10 +49,10 @@ package body Tests.Implementation is use Interfaces; use GNAT.Sockets; T : Component.Ccsds_Socket_Interface.Implementation.Tester.Instance_Access renames Self.Tester; - Packet_Good : constant Ccsds_Space_Packet.T := (Header => (Version => 0, Packet_Type => Ccsds_Packet_Type.Telecommand, Secondary_Header => Ccsds_Secondary_Header_Indicator.Secondary_Header_Not_Present, Apid => Ccsds_Apid_Type (15), Sequence_Flag => Ccsds_Sequence_Flag.Unsegmented, Sequence_Count => Ccsds_Sequence_Count_Type (22), Packet_Length => 10 - 1), Data => (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, others => 0)); - Packet_Bad : constant Ccsds_Space_Packet.T := (Header => (Version => 0, Packet_Type => Ccsds_Packet_Type.Telecommand, Secondary_Header => Ccsds_Secondary_Header_Indicator.Secondary_Header_Not_Present, Apid => Ccsds_Apid_Type (12), Sequence_Flag => Ccsds_Sequence_Flag.Unsegmented, Sequence_Count => Ccsds_Sequence_Count_Type (17), Packet_Length => 50), Data => (99, 98, 97, 96, 95, 94, others => 17)); - Bad_Addr : constant Socket_Address.T := (Ip_Address => (127, 0, 0, 1), Port => Self.Port - 1); - Address : constant Socket_Address.T := (Ip_Address => (127, 0, 0, 1), Port => Self.Port); + Packet_Good : constant Ccsds_Space_Packet.T := (Header => (Version => 0, Packet_Type => Ccsds_Packet_Type.Telecommand, Secondary_Header => Ccsds_Secondary_Header_Indicator.Secondary_Header_Not_Present, Apid => Ccsds_Apid_Type (15), Sequence_Flag => Ccsds_Sequence_Flag.Unsegmented, Sequence_Count => Ccsds_Sequence_Count_Type (22), Packet_Length => 10 - 1), Data => [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, others => 0]); + Packet_Bad : constant Ccsds_Space_Packet.T := (Header => (Version => 0, Packet_Type => Ccsds_Packet_Type.Telecommand, Secondary_Header => Ccsds_Secondary_Header_Indicator.Secondary_Header_Not_Present, Apid => Ccsds_Apid_Type (12), Sequence_Flag => Ccsds_Sequence_Flag.Unsegmented, Sequence_Count => Ccsds_Sequence_Count_Type (17), Packet_Length => 50), Data => [99, 98, 97, 96, 95, 94, others => 17]); + Bad_Addr : constant Socket_Address.T := (Ip_Address => [127, 0, 0, 1], Port => Self.Port - 1); + Address : constant Socket_Address.T := (Ip_Address => [127, 0, 0, 1], Port => Self.Port); begin Put_Line ("Starting test."); diff --git a/src/components/ccsds_subpacket_extractor/test/ccsds_subpacket_extractor_tests-implementation.adb b/src/components/ccsds_subpacket_extractor/test/ccsds_subpacket_extractor_tests-implementation.adb index 67dfb0c7..ab2f999e 100644 --- a/src/components/ccsds_subpacket_extractor/test/ccsds_subpacket_extractor_tests-implementation.adb +++ b/src/components/ccsds_subpacket_extractor/test/ccsds_subpacket_extractor_tests-implementation.adb @@ -61,25 +61,25 @@ package body Ccsds_Subpacket_Extractor_Tests.Implementation is (Header => (Version => 0, Packet_Type => Ccsds_Packet_Type.Telecommand, Secondary_Header => Ccsds_Secondary_Header_Indicator.Secondary_Header_Not_Present, Apid => Ccsds_Apid_Type (17), Sequence_Flag => Ccsds_Sequence_Flag.Unsegmented, Sequence_Count => Ccsds_Sequence_Count_Type (53), Packet_Length => 6), - Data => (1, 2, 3, 4, 5, 6, 7, others => 0)); + Data => [1, 2, 3, 4, 5, 6, 7, others => 0]); -- Max size packet: Packet_2 : constant Ccsds_Space_Packet.T := (Header => (Version => 0, Packet_Type => Ccsds_Packet_Type.Telecommand, Secondary_Header => Ccsds_Secondary_Header_Indicator.Secondary_Header_Not_Present, Apid => Ccsds_Apid_Type (22), Sequence_Flag => Ccsds_Sequence_Flag.Unsegmented, Sequence_Count => Ccsds_Sequence_Count_Type (12), Packet_Length => Unsigned_16 (Ccsds_Space_Packet.Ccsds_Data_Type'Length) - Unsigned_16 (Ccsds_Primary_Header.Size_In_Bytes) - 1), - Data => (others => 99)); + Data => [others => 99]); -- Another normal small packet: Packet_3 : constant Ccsds_Space_Packet.T := (Header => (Version => 0, Packet_Type => Ccsds_Packet_Type.Telecommand, Secondary_Header => Ccsds_Secondary_Header_Indicator.Secondary_Header_Not_Present, Apid => Ccsds_Apid_Type (13), Sequence_Flag => Ccsds_Sequence_Flag.Unsegmented, Sequence_Count => Ccsds_Sequence_Count_Type (1), Packet_Length => 17), - Data => (1, 2, 3, 4, 5, 6, 7, others => 255)); + Data => [1, 2, 3, 4, 5, 6, 7, others => 255]); overriding procedure Nominal_Extraction (Self : in out Instance) is T : Component.Ccsds_Subpacket_Extractor.Implementation.Tester.Instance_Access renames Self.Tester; begin -- Send over the sync connector first: - T.Ccsds_Space_Packet_T_Send (Create_Packet ((0 => Packet_1))); + T.Ccsds_Space_Packet_T_Send (Create_Packet ([0 => Packet_1])); -- Expect no events to be thrown and one packet to be received: Natural_Assert.Eq (T.Ccsds_Space_Packet_T_Recv_Sync_History.Get_Count, 1); @@ -90,7 +90,7 @@ package body Ccsds_Subpacket_Extractor_Tests.Implementation is Ccsds_Space_Packet_Assert.Eq (T.Ccsds_Space_Packet_T_Recv_Sync_History.Get (1), Packet_1); -- Now try the async connector: - T.Ccsds_Space_Packet_T_Send_2 (Create_Packet ((0 => Packet_1))); + T.Ccsds_Space_Packet_T_Send_2 (Create_Packet ([0 => Packet_1])); -- Expect no change, since we have not drained the queue: Natural_Assert.Eq (T.Ccsds_Space_Packet_T_Recv_Sync_History.Get_Count, 1); @@ -109,7 +109,7 @@ package body Ccsds_Subpacket_Extractor_Tests.Implementation is Ccsds_Space_Packet_Assert.Eq (T.Ccsds_Space_Packet_T_Recv_Sync_History.Get (2), Packet_1); -- Send over the sync connector first: - T.Ccsds_Space_Packet_T_Send (Create_Packet ((0 => Packet_2))); + T.Ccsds_Space_Packet_T_Send (Create_Packet ([0 => Packet_2])); -- Expect no events to be thrown and one packet to be received: Natural_Assert.Eq (T.Ccsds_Space_Packet_T_Recv_Sync_History.Get_Count, 3); @@ -120,7 +120,7 @@ package body Ccsds_Subpacket_Extractor_Tests.Implementation is Ccsds_Space_Packet_Assert.Eq (T.Ccsds_Space_Packet_T_Recv_Sync_History.Get (3), Packet_2); -- Now try the async connector: - T.Ccsds_Space_Packet_T_Send_2 (Create_Packet ((0 => Packet_2))); + T.Ccsds_Space_Packet_T_Send_2 (Create_Packet ([0 => Packet_2])); -- Expect no change, since we have not drained the queue: Natural_Assert.Eq (T.Ccsds_Space_Packet_T_Recv_Sync_History.Get_Count, 3); @@ -139,7 +139,7 @@ package body Ccsds_Subpacket_Extractor_Tests.Implementation is Ccsds_Space_Packet_Assert.Eq (T.Ccsds_Space_Packet_T_Recv_Sync_History.Get (4), Packet_2); -- Send over the sync connector first: - T.Ccsds_Space_Packet_T_Send (Create_Packet ((0 => Packet_1, 1 => Packet_3, 2 => Packet_1, 3 => Packet_3))); + T.Ccsds_Space_Packet_T_Send (Create_Packet ([0 => Packet_1, 1 => Packet_3, 2 => Packet_1, 3 => Packet_3])); -- Expect no events to be thrown and one packet to be received: Natural_Assert.Eq (T.Ccsds_Space_Packet_T_Recv_Sync_History.Get_Count, 8); @@ -153,7 +153,7 @@ package body Ccsds_Subpacket_Extractor_Tests.Implementation is Ccsds_Space_Packet_Assert.Eq (T.Ccsds_Space_Packet_T_Recv_Sync_History.Get (8), Packet_3); -- Now try the async connector: - T.Ccsds_Space_Packet_T_Send_2 (Create_Packet ((0 => Packet_3, 1 => Packet_1, 2 => Packet_3, 3 => Packet_1))); + T.Ccsds_Space_Packet_T_Send_2 (Create_Packet ([0 => Packet_3, 1 => Packet_1, 2 => Packet_3, 3 => Packet_1])); -- Expect no events to be thrown and one packet to be received: Natural_Assert.Eq (T.Ccsds_Space_Packet_T_Recv_Sync_History.Get_Count, 8); @@ -184,7 +184,7 @@ package body Ccsds_Subpacket_Extractor_Tests.Implementation is -- -- Send over the sync connector first: - Packet := Create_Packet ((0 => Packet_1)); + Packet := Create_Packet ([0 => Packet_1]); -- Override packet header to make it too small: Packet.Header.Packet_Length := Unsigned_16 (Ccsds_Primary_Header.Size_In_Bytes) - 2; T.Ccsds_Space_Packet_T_Send (Packet); @@ -199,7 +199,7 @@ package body Ccsds_Subpacket_Extractor_Tests.Implementation is Ccsds_Space_Packet_Assert.Eq (T.Error_Packet_History.Get (1), Packet); -- Send over the sync connector first: - Packet := Create_Packet ((0 => Packet_2)); + Packet := Create_Packet ([0 => Packet_2]); -- Override packet header to make it too small: Packet.Header.Packet_Length := 0; T.Ccsds_Space_Packet_T_Send_2 (Packet); @@ -224,7 +224,7 @@ package body Ccsds_Subpacket_Extractor_Tests.Implementation is -- -- Send over the sync connector first: - Packet := Create_Packet ((0 => Packet_2)); + Packet := Create_Packet ([0 => Packet_2]); -- Override packet header to make it too large: Packet.Header.Packet_Length := Packet.Data'Length * 8; T.Ccsds_Space_Packet_T_Send (Packet); @@ -239,7 +239,7 @@ package body Ccsds_Subpacket_Extractor_Tests.Implementation is Ccsds_Primary_Header_Assert.Eq (T.Error_Packet_History.Get (3).Header, Packet.Header); -- Send over the sync connector first: - Packet := Create_Packet ((0 => Packet_2)); + Packet := Create_Packet ([0 => Packet_2]); -- Override packet header to make it too large: Packet.Header.Packet_Length := Packet.Data'Length; T.Ccsds_Space_Packet_T_Send (Packet); @@ -254,7 +254,7 @@ package body Ccsds_Subpacket_Extractor_Tests.Implementation is Ccsds_Primary_Header_Assert.Eq (T.Error_Packet_History.Get (4).Header, Packet.Header); -- Send over the async connector: - Packet := Create_Packet ((0 => Packet_3)); + Packet := Create_Packet ([0 => Packet_3]); -- Override packet header to make it too large: Packet.Header.Packet_Length := Packet.Data'Length; @@ -282,7 +282,7 @@ package body Ccsds_Subpacket_Extractor_Tests.Implementation is Packet : Ccsds_Space_Packet.T; begin -- Send over the sync connector first: - Packet := Create_Packet ((0 => Packet_1, 1 => Packet_3)); + Packet := Create_Packet ([0 => Packet_1, 1 => Packet_3]); -- Override packet header to make it too small: Packet.Header.Packet_Length := Packet.Header.Packet_Length - 1; T.Ccsds_Space_Packet_T_Send (Packet); @@ -305,7 +305,7 @@ package body Ccsds_Subpacket_Extractor_Tests.Implementation is Ccsds_Space_Packet_Assert.Eq (T.Error_Packet_History.Get (1), Packet); -- Send over the sync connector first: - Packet := Create_Packet ((0 => Packet_2)); + Packet := Create_Packet ([0 => Packet_2]); -- Override packet header to make it way too small: Packet.Header.Packet_Length := Packet.Header.Packet_Length - Unsigned_16 (Ccsds_Primary_Header.Size_In_Bytes); T.Ccsds_Space_Packet_T_Send_2 (Packet); @@ -333,7 +333,7 @@ package body Ccsds_Subpacket_Extractor_Tests.Implementation is Packet : Ccsds_Space_Packet.T; begin -- Send over the sync connector first: - Packet := Create_Packet ((0 => Packet_1, 1 => Packet_3)); + Packet := Create_Packet ([0 => Packet_1, 1 => Packet_3]); -- Override packet header to make it too large by a little: Packet.Header.Packet_Length := Packet.Header.Packet_Length + 1; T.Ccsds_Space_Packet_T_Send (Packet); @@ -352,9 +352,9 @@ package body Ccsds_Subpacket_Extractor_Tests.Implementation is Ccsds_Space_Packet_Assert.Eq (T.Error_Packet_History.Get (1), Packet); -- Send over the async connector: - Packet := Create_Packet ((0 => Packet_3)); + Packet := Create_Packet ([0 => Packet_3]); -- Override packet header to make it too large by a lot: - Packet.Data (Natural (Packet.Header.Packet_Length) + 1 .. Packet.Data'Last) := (others => 99); + Packet.Data (Natural (Packet.Header.Packet_Length) + 1 .. Packet.Data'Last) := [others => 99]; Packet.Header.Packet_Length := Packet.Header.Packet_Length + Unsigned_16 (Ccsds_Primary_Header.Size_In_Bytes); T.Ccsds_Space_Packet_T_Send_2 (Packet); Natural_Assert.Eq (Self.Tester.Dispatch_All, 1); @@ -367,7 +367,7 @@ package body Ccsds_Subpacket_Extractor_Tests.Implementation is Natural_Assert.Eq (T.Event_T_Recv_Sync_History.Get_Count, 2); Natural_Assert.Eq (T.Dropped_Trailing_Bytes_History.Get_Count, 1); Natural_Assert.Eq (T.Invalid_Extracted_Packet_Length_History.Get_Count, 1); - Invalid_Packet_Length_Assert.Eq (T.Invalid_Extracted_Packet_Length_History.Get (1), (Ccsds_Primary_Header.Serialization.From_Byte_Array ((others => 16#63#)), 16#6363#, Ccsds_Primary_Header.Size_In_Bytes)); + Invalid_Packet_Length_Assert.Eq (T.Invalid_Extracted_Packet_Length_History.Get (1), (Ccsds_Primary_Header.Serialization.From_Byte_Array ([others => 16#63#]), 16#6363#, Ccsds_Primary_Header.Size_In_Bytes)); Natural_Assert.Eq (T.Packet_T_Recv_Sync_History.Get_Count, 2); Natural_Assert.Eq (T.Error_Packet_History.Get_Count, 2); Ccsds_Space_Packet_Assert.Eq (T.Error_Packet_History.Get (2), Packet); @@ -378,13 +378,13 @@ package body Ccsds_Subpacket_Extractor_Tests.Implementation is Packet : Ccsds_Space_Packet.T; begin -- Send packets out of the async connector: - T.Ccsds_Space_Packet_T_Send_2 (Create_Packet ((0 => Packet_2))); - T.Ccsds_Space_Packet_T_Send_2 (Create_Packet ((0 => Packet_2))); - T.Ccsds_Space_Packet_T_Send_2 (Create_Packet ((0 => Packet_2))); - T.Ccsds_Space_Packet_T_Send (Create_Packet ((0 => Packet_3))); + T.Ccsds_Space_Packet_T_Send_2 (Create_Packet ([0 => Packet_2])); + T.Ccsds_Space_Packet_T_Send_2 (Create_Packet ([0 => Packet_2])); + T.Ccsds_Space_Packet_T_Send_2 (Create_Packet ([0 => Packet_2])); + T.Ccsds_Space_Packet_T_Send (Create_Packet ([0 => Packet_3])); -- We should overflow here: T.Expect_Ccsds_Space_Packet_T_Send_2_Dropped := True; - Packet := Create_Packet ((0 => Packet_1)); + Packet := Create_Packet ([0 => Packet_1]); T.Ccsds_Space_Packet_T_Send_2 (Packet); -- Expect event to be thrown and no packet extracted. @@ -418,7 +418,7 @@ package body Ccsds_Subpacket_Extractor_Tests.Implementation is T.Component_Instance.Init (Start_Offset => 4, Stop_Offset => 6); -- Send over the sync connector first: - T.Ccsds_Space_Packet_T_Send (Create_Packet ((0 => Packet_1), Start_Offset => 4, Stop_Offset => 6)); + T.Ccsds_Space_Packet_T_Send (Create_Packet ([0 => Packet_1], Start_Offset => 4, Stop_Offset => 6)); -- Expect no events to be thrown and one packet to be received: Natural_Assert.Eq (T.Ccsds_Space_Packet_T_Recv_Sync_History.Get_Count, 1); @@ -429,7 +429,7 @@ package body Ccsds_Subpacket_Extractor_Tests.Implementation is Ccsds_Space_Packet_Assert.Eq (T.Ccsds_Space_Packet_T_Recv_Sync_History.Get (1), Packet_1); -- Send over the sync connector first: - T.Ccsds_Space_Packet_T_Send (Create_Packet ((0 => Packet_1, 1 => Packet_3, 2 => Packet_1, 3 => Packet_3), Start_Offset => 4, Stop_Offset => 6)); + T.Ccsds_Space_Packet_T_Send (Create_Packet ([0 => Packet_1, 1 => Packet_3, 2 => Packet_1, 3 => Packet_3], Start_Offset => 4, Stop_Offset => 6)); -- Expect no events to be thrown and one packet to be received: Natural_Assert.Eq (T.Ccsds_Space_Packet_T_Recv_Sync_History.Get_Count, 5); @@ -443,7 +443,7 @@ package body Ccsds_Subpacket_Extractor_Tests.Implementation is Ccsds_Space_Packet_Assert.Eq (T.Ccsds_Space_Packet_T_Recv_Sync_History.Get (5), Packet_3); -- Send over the sync connector first: - Packet := Create_Packet ((0 => Packet_1, 1 => Packet_3), Start_Offset => 4, Stop_Offset => 6); + Packet := Create_Packet ([0 => Packet_1, 1 => Packet_3], Start_Offset => 4, Stop_Offset => 6); -- Override packet header to make it too large by a little: Packet.Header.Packet_Length := Packet.Header.Packet_Length + 1; T.Ccsds_Space_Packet_T_Send (Packet); @@ -462,7 +462,7 @@ package body Ccsds_Subpacket_Extractor_Tests.Implementation is Ccsds_Space_Packet_Assert.Eq (T.Error_Packet_History.Get (1), Packet); -- Send over the sync connector first: - Packet := Create_Packet ((0 => Packet_1), Start_Offset => 4, Stop_Offset => 6); + Packet := Create_Packet ([0 => Packet_1], Start_Offset => 4, Stop_Offset => 6); -- Override packet header to make it too small: Packet.Header.Packet_Length := Unsigned_16 (Ccsds_Primary_Header.Size_In_Bytes) - 2; T.Ccsds_Space_Packet_T_Send (Packet); @@ -477,7 +477,7 @@ package body Ccsds_Subpacket_Extractor_Tests.Implementation is Ccsds_Space_Packet_Assert.Eq (T.Error_Packet_History.Get (2), Packet); -- Send over the sync connector first: - Packet := Create_Packet ((0 => Packet_1), Start_Offset => 4, Stop_Offset => 6); + Packet := Create_Packet ([0 => Packet_1], Start_Offset => 4, Stop_Offset => 6); -- Override packet header to make it too large: Packet.Header.Packet_Length := Packet.Data'Length * 8; T.Ccsds_Space_Packet_T_Send (Packet); @@ -492,7 +492,7 @@ package body Ccsds_Subpacket_Extractor_Tests.Implementation is Ccsds_Primary_Header_Assert.Eq (T.Error_Packet_History.Get (3).Header, Packet.Header); -- Send over the sync connector first, make offsets so big nothing can be extracted: - Packet := Create_Packet ((0 => Packet_1)); + Packet := Create_Packet ([0 => Packet_1]); -- Override packet header to make it too small: Packet.Header.Packet_Length := 1; T.Ccsds_Space_Packet_T_Send (Packet); @@ -515,7 +515,7 @@ package body Ccsds_Subpacket_Extractor_Tests.Implementation is T.Component_Instance.Init (Max_Subpackets_To_Extract => 0); -- Send large packet: - T.Ccsds_Space_Packet_T_Send (Create_Packet ((0 => Packet_1, 1 => Packet_3, 2 => Packet_1, 3 => Packet_3))); + T.Ccsds_Space_Packet_T_Send (Create_Packet ([0 => Packet_1, 1 => Packet_3, 2 => Packet_1, 3 => Packet_3])); -- Expect no events to be thrown and no packets to be received: Natural_Assert.Eq (T.Ccsds_Space_Packet_T_Recv_Sync_History.Get_Count, 0); @@ -526,7 +526,7 @@ package body Ccsds_Subpacket_Extractor_Tests.Implementation is T.Component_Instance.Init (Max_Subpackets_To_Extract => 2); -- Send large packet containing 4 subpackets: - T.Ccsds_Space_Packet_T_Send (Create_Packet ((0 => Packet_1, 1 => Packet_3, 2 => Packet_1, 3 => Packet_3))); + T.Ccsds_Space_Packet_T_Send (Create_Packet ([0 => Packet_1, 1 => Packet_3, 2 => Packet_1, 3 => Packet_3])); -- Expect no events to be thrown and two packets to be received: Natural_Assert.Eq (T.Ccsds_Space_Packet_T_Recv_Sync_History.Get_Count, 2); @@ -541,7 +541,7 @@ package body Ccsds_Subpacket_Extractor_Tests.Implementation is T.Component_Instance.Init (Max_Subpackets_To_Extract => 1); -- Send large packet containing 4 subpackets: - T.Ccsds_Space_Packet_T_Send (Create_Packet ((0 => Packet_3, 1 => Packet_1, 2 => Packet_3))); + T.Ccsds_Space_Packet_T_Send (Create_Packet ([0 => Packet_3, 1 => Packet_1, 2 => Packet_3])); -- Expect no events to be thrown and two packets to be received: Natural_Assert.Eq (T.Ccsds_Space_Packet_T_Recv_Sync_History.Get_Count, 3); @@ -555,7 +555,7 @@ package body Ccsds_Subpacket_Extractor_Tests.Implementation is T.Component_Instance.Init (Max_Subpackets_To_Extract => 3); -- Send large packet containing 3 subpackets: - T.Ccsds_Space_Packet_T_Send (Create_Packet ((0 => Packet_3, 1 => Packet_1, 2 => Packet_3))); + T.Ccsds_Space_Packet_T_Send (Create_Packet ([0 => Packet_3, 1 => Packet_1, 2 => Packet_3])); -- Expect no events to be thrown and two packets to be received: Natural_Assert.Eq (T.Ccsds_Space_Packet_T_Recv_Sync_History.Get_Count, 6); @@ -571,7 +571,7 @@ package body Ccsds_Subpacket_Extractor_Tests.Implementation is T.Component_Instance.Init (Max_Subpackets_To_Extract => 18); -- Send large packet containing 3 subpackets: - T.Ccsds_Space_Packet_T_Send (Create_Packet ((0 => Packet_3, 1 => Packet_1, 2 => Packet_3))); + T.Ccsds_Space_Packet_T_Send (Create_Packet ([0 => Packet_3, 1 => Packet_1, 2 => Packet_3])); -- Expect no events to be thrown and two packets to be received: Natural_Assert.Eq (T.Ccsds_Space_Packet_T_Recv_Sync_History.Get_Count, 9); diff --git a/src/components/command_protector/test/command_protector_tests-implementation.adb b/src/components/command_protector/test/command_protector_tests-implementation.adb index b1e7372f..5a45c9fa 100644 --- a/src/components/command_protector/test/command_protector_tests-implementation.adb +++ b/src/components/command_protector/test/command_protector_tests-implementation.adb @@ -21,7 +21,7 @@ package body Command_Protector_Tests.Implementation is ------------------------------------------------------------------------- -- Globals: ------------------------------------------------------------------------- - Protected_Command_Id_List : constant Component.Command_Protector.Command_Id_List := (4, 19, 77, 78); + Protected_Command_Id_List : constant Component.Command_Protector.Command_Id_List := [4, 19, 77, 78]; ------------------------------------------------------------------------- -- Fixtures: @@ -57,7 +57,7 @@ package body Command_Protector_Tests.Implementation is procedure Init_Nominal is begin - T.Component_Instance.Init (Protected_Command_Id_List => (1, 2, 3, 4)); + T.Component_Instance.Init (Protected_Command_Id_List => [1, 2, 3, 4]); exception -- Not expecting exception to be thrown: when others => @@ -67,7 +67,7 @@ package body Command_Protector_Tests.Implementation is procedure Init_None is begin -- Empty list not ok. - T.Component_Instance.Init (Protected_Command_Id_List => (1 .. 0 => 0)); + T.Component_Instance.Init (Protected_Command_Id_List => [1 .. 0 => 0]); -- Should never get here: Assert (False, "Index out of range did not produce exception!"); exception @@ -78,7 +78,7 @@ package body Command_Protector_Tests.Implementation is procedure Init_Duplicate is begin - T.Component_Instance.Init (Protected_Command_Id_List => (1, 2, 3, 2)); + T.Component_Instance.Init (Protected_Command_Id_List => [1, 2, 3, 2]); -- Should never get here: Assert (False, "Duplicate ID did not produce exception!"); exception @@ -120,7 +120,7 @@ package body Command_Protector_Tests.Implementation is overriding procedure Test_Unprotected_Command_Accept (Self : in out Instance) is T : Component.Command_Protector.Implementation.Tester.Instance_Access renames Self.Tester; - Cmd : Command.T := (Header => (Source_Id => 0, Id => 2, Arg_Buffer_Length => 19), Arg_Buffer => (others => 88)); + Cmd : Command.T := (Header => (Source_Id => 0, Id => 2, Arg_Buffer_Length => 19), Arg_Buffer => [others => 88]); begin -- Send a command not in the proteced list: T.Command_T_To_Forward_Send (Cmd); @@ -224,7 +224,7 @@ package body Command_Protector_Tests.Implementation is overriding procedure Test_Protected_Command_Accept (Self : in out Instance) is T : Component.Command_Protector.Implementation.Tester.Instance_Access renames Self.Tester; - Cmd : Command.T := (Header => (Source_Id => 0, Id => 2, Arg_Buffer_Length => 19), Arg_Buffer => (others => 88)); + Cmd : Command.T := (Header => (Source_Id => 0, Id => 2, Arg_Buffer_Length => 19), Arg_Buffer => [others => 88]); begin -- OK now arm the component: T.Command_T_Send (T.Commands.Arm ((Timeout => 55))); @@ -309,7 +309,7 @@ package body Command_Protector_Tests.Implementation is overriding procedure Test_Protected_Command_Reject (Self : in out Instance) is T : Component.Command_Protector.Implementation.Tester.Instance_Access renames Self.Tester; - Cmd : Command.T := (Header => (Source_Id => 0, Id => 2, Arg_Buffer_Length => 19), Arg_Buffer => (others => 88)); + Cmd : Command.T := (Header => (Source_Id => 0, Id => 2, Arg_Buffer_Length => 19), Arg_Buffer => [others => 88]); begin -- OK dont arm the component: Cmd.Header.Id := 4; @@ -356,7 +356,7 @@ package body Command_Protector_Tests.Implementation is overriding procedure Test_Protected_Command_Reject_Timeout (Self : in out Instance) is T : Component.Command_Protector.Implementation.Tester.Instance_Access renames Self.Tester; - Cmd : Command.T := (Header => (Source_Id => 0, Id => 2, Arg_Buffer_Length => 19), Arg_Buffer => (others => 88)); + Cmd : Command.T := (Header => (Source_Id => 0, Id => 2, Arg_Buffer_Length => 19), Arg_Buffer => [others => 88]); begin -- OK now arm the component: T.Command_T_Send (T.Commands.Arm ((Timeout => 3))); @@ -531,7 +531,7 @@ package body Command_Protector_Tests.Implementation is -- Make sure some events were thrown: Natural_Assert.Eq (T.Event_T_Recv_Sync_History.Get_Count, 1); Natural_Assert.Eq (T.Invalid_Command_Received_History.Get_Count, 1); - Invalid_Command_Info_Assert.Eq (T.Invalid_Command_Received_History.Get (1), (Id => T.Commands.Get_Arm_Id, Errant_Field_Number => Interfaces.Unsigned_32'Last, Errant_Field => (0, 0, 0, 0, 0, 0, 0, 0))); + Invalid_Command_Info_Assert.Eq (T.Invalid_Command_Received_History.Get (1), (Id => T.Commands.Get_Arm_Id, Errant_Field_Number => Interfaces.Unsigned_32'Last, Errant_Field => [0, 0, 0, 0, 0, 0, 0, 0])); end Test_Invalid_Command; end Command_Protector_Tests.Implementation; diff --git a/src/components/command_rejector/test/command_rejector_tests-implementation.adb b/src/components/command_rejector/test/command_rejector_tests-implementation.adb index 51d72706..17c3f790 100644 --- a/src/components/command_rejector/test/command_rejector_tests-implementation.adb +++ b/src/components/command_rejector/test/command_rejector_tests-implementation.adb @@ -15,7 +15,7 @@ package body Command_Rejector_Tests.Implementation is ------------------------------------------------------------------------- -- Globals: ------------------------------------------------------------------------- - Reject_Command_Id_List : constant Component.Command_Rejector.Command_Id_List := (4, 19, 77, 78); + Reject_Command_Id_List : constant Component.Command_Rejector.Command_Id_List := [4, 19, 77, 78]; ------------------------------------------------------------------------- -- Fixtures: @@ -51,7 +51,7 @@ package body Command_Rejector_Tests.Implementation is procedure Init_Nominal is begin - T.Component_Instance.Init (Command_Id_Reject_List => (1, 2, 3, 4)); + T.Component_Instance.Init (Command_Id_Reject_List => [1, 2, 3, 4]); exception -- Not expecting exception to be thrown: when others => @@ -61,7 +61,7 @@ package body Command_Rejector_Tests.Implementation is procedure Init_None is begin -- Empty list not ok. - T.Component_Instance.Init (Command_Id_Reject_List => (1 .. 0 => 0)); + T.Component_Instance.Init (Command_Id_Reject_List => [1 .. 0 => 0]); -- Should never get here: Assert (False, "Index out of range did not produce exception!"); exception @@ -72,7 +72,7 @@ package body Command_Rejector_Tests.Implementation is procedure Init_Duplicate is begin - T.Component_Instance.Init (Command_Id_Reject_List => (1, 2, 3, 2)); + T.Component_Instance.Init (Command_Id_Reject_List => [1, 2, 3, 2]); -- Should never get here: Assert (False, "Duplicate ID did not produce exception!"); exception @@ -108,7 +108,7 @@ package body Command_Rejector_Tests.Implementation is overriding procedure Test_Command_Accept (Self : in out Instance) is T : Component.Command_Rejector.Implementation.Tester.Instance_Access renames Self.Tester; - Cmd : Command.T := (Header => (Source_Id => 0, Id => 2, Arg_Buffer_Length => 19), Arg_Buffer => (others => 88)); + Cmd : Command.T := (Header => (Source_Id => 0, Id => 2, Arg_Buffer_Length => 19), Arg_Buffer => [others => 88]); begin -- Send a command not in the proteced list: T.Command_T_To_Forward_Send (Cmd); @@ -140,7 +140,7 @@ package body Command_Rejector_Tests.Implementation is overriding procedure Test_Command_Reject (Self : in out Instance) is T : Component.Command_Rejector.Implementation.Tester.Instance_Access renames Self.Tester; - Cmd : Command.T := (Header => (Source_Id => 0, Id => 2, Arg_Buffer_Length => 19), Arg_Buffer => (others => 88)); + Cmd : Command.T := (Header => (Source_Id => 0, Id => 2, Arg_Buffer_Length => 19), Arg_Buffer => [others => 88]); begin -- OK send command in list: Cmd.Header.Id := 4; diff --git a/src/components/command_router/test/command_router_tests-implementation.adb b/src/components/command_router/test/command_router_tests-implementation.adb index 90a78e88..f478cbe6 100644 --- a/src/components/command_router/test/command_router_tests-implementation.adb +++ b/src/components/command_router/test/command_router_tests-implementation.adb @@ -180,8 +180,8 @@ package body Command_Router_Tests.Implementation is overriding procedure Test_Nominal_Registration (Self : in out Instance) is use Command_Response_Status; T : Component.Command_Router.Implementation.Tester.Instance_Access renames Self.Tester; - Buffer1 : constant Command_Types.Command_Arg_Buffer_Type := (0 => 56, 1 => 57, others => 0); - Buffer2 : constant Command_Types.Command_Arg_Buffer_Type := (0 => 13, 1 => 14, others => 0); + Buffer1 : constant Command_Types.Command_Arg_Buffer_Type := [0 => 56, 1 => 57, others => 0]; + Buffer2 : constant Command_Types.Command_Arg_Buffer_Type := [0 => 13, 1 => 14, others => 0]; A_Command : Command.T; Reg_Cmds : Registration_Commands.Instance; Ignore : Natural; @@ -238,13 +238,13 @@ package body Command_Router_Tests.Implementation is use Command_Response_Status; T : Component.Command_Router.Implementation.Tester.Instance_Access renames Self.Tester; Ignore : Natural; - Buffer1 : constant Command_Types.Command_Arg_Buffer_Type := (0 => 56, 1 => 57, others => 0); + Buffer1 : constant Command_Types.Command_Arg_Buffer_Type := [0 => 56, 1 => 57, others => 0]; A_Command : Command.T; begin T.Command_T_Recv_Sync_History.Clear; -- clear registration commands from history -- Test sending a command that is not registered. - T.Command_T_To_Route_Send (((Source_Id => 0, Id => 99, Arg_Buffer_Length => 19), Arg_Buffer => (others => 0))); + T.Command_T_To_Route_Send (((Source_Id => 0, Id => 99, Arg_Buffer_Length => 19), Arg_Buffer => [others => 0])); Ignore := Self.Tester.Dispatch_All; Natural_Assert.Eq (T.Command_Received_History.Get_Count, 1); Command_Header_Assert.Eq (T.Command_Received_History.Get (1), (Source_Id => 0, Id => 99, Arg_Buffer_Length => 19)); @@ -295,7 +295,7 @@ package body Command_Router_Tests.Implementation is -- Execute component and make sure command was executed: Natural_Assert.Eq (Self.Tester.Dispatch_All, 1); Natural_Assert.Eq (T.Invalid_Command_Received_History.Get_Count, 1); - Invalid_Command_Info_Assert.Eq (T.Invalid_Command_Received_History.Get (1), (Id => 27, Errant_Field_Number => Unsigned_32'Last - 1, Errant_Field => (0, 0, 0, 0, 0, 0, 0, 27))); + Invalid_Command_Info_Assert.Eq (T.Invalid_Command_Received_History.Get (1), (Id => 27, Errant_Field_Number => Unsigned_32'Last - 1, Errant_Field => [0, 0, 0, 0, 0, 0, 0, 27])); -- Execute component and make sure response was sent: Natural_Assert.Eq (Self.Tester.Dispatch_All, 1); @@ -353,7 +353,7 @@ package body Command_Router_Tests.Implementation is overriding procedure Test_Full_Queue_Errors (Self : in out Instance) is use Command_Response_Status; T : Component.Command_Router.Implementation.Tester.Instance_Access renames Self.Tester; - Buffer : constant Command_Types.Command_Arg_Buffer_Type := (0 => 56, 1 => 57, others => 92); + Buffer : constant Command_Types.Command_Arg_Buffer_Type := [0 => 56, 1 => 57, others => 92]; A_Command : constant Command.T := ((Source_Id => 2, Id => 15, Arg_Buffer_Length => Buffer'Length), Arg_Buffer => Buffer); procedure Fill_Queue (N : Natural := 10) is @@ -464,7 +464,7 @@ package body Command_Router_Tests.Implementation is Natural_Assert.Eq (T.Noop_Received_History.Get_Count, 0); -- Make sure an invalid command event was sent. Natural_Assert.Eq (T.Invalid_Command_Received_History.Get_Count, 1); - Invalid_Command_Info_Assert.Eq (T.Invalid_Command_Received_History.Get (1), (Id => T.Commands.Get_Noop_Id, Errant_Field_Number => Unsigned_32'Last, Errant_Field => (0, 0, 0, 0, 0, 0, 0, 5))); + Invalid_Command_Info_Assert.Eq (T.Invalid_Command_Received_History.Get (1), (Id => T.Commands.Get_Noop_Id, Errant_Field_Number => Unsigned_32'Last, Errant_Field => [0, 0, 0, 0, 0, 0, 0, 5])); -- Execute component and make sure response was sent: Natural_Assert.Eq (Self.Tester.Dispatch_All, 1); @@ -500,7 +500,7 @@ package body Command_Router_Tests.Implementation is Natural_Assert.Eq (T.Noop_Arg_Received_History.Get_Count, 0); -- Make sure an invalid command event was sent. Natural_Assert.Eq (T.Invalid_Command_Received_History.Get_Count, 2); - Invalid_Command_Info_Assert.Eq (T.Invalid_Command_Received_History.Get (2), (Id => T.Commands.Get_Noop_Arg_Id, Errant_Field_Number => Unsigned_32'Last, Errant_Field => (0, 0, 0, 0, 0, 0, 0, 0))); + Invalid_Command_Info_Assert.Eq (T.Invalid_Command_Received_History.Get (2), (Id => T.Commands.Get_Noop_Arg_Id, Errant_Field_Number => Unsigned_32'Last, Errant_Field => [0, 0, 0, 0, 0, 0, 0, 0])); -- Execute component and make sure response was sent: Natural_Assert.Eq (Self.Tester.Dispatch_All, 1); @@ -546,7 +546,7 @@ package body Command_Router_Tests.Implementation is Natural_Assert.Eq (T.Noop_Arg_Received_History.Get_Count, 0); -- Make sure an invalid command event was sent. Natural_Assert.Eq (T.Invalid_Command_Received_History.Get_Count, 1); - Invalid_Command_Info_Assert.Eq (T.Invalid_Command_Received_History.Get (1), (Id => T.Commands.Get_Noop_Arg_Id, Errant_Field_Number => 1, Errant_Field => (0, 0, 0, 0, 16#e8#, 16#3#, 0, 0))); + Invalid_Command_Info_Assert.Eq (T.Invalid_Command_Received_History.Get (1), (Id => T.Commands.Get_Noop_Arg_Id, Errant_Field_Number => 1, Errant_Field => [0, 0, 0, 0, 16#e8#, 16#3#, 0, 0])); -- Execute component and make sure response was sent: Natural_Assert.Eq (Self.Tester.Dispatch_All, 1); @@ -828,8 +828,8 @@ package body Command_Router_Tests.Implementation is T : Component.Command_Router.Implementation.Tester.Instance_Access renames Self.Tester; Ignore : Natural; A_Command : Command.T; - Buffer1 : constant Command_Types.Command_Arg_Buffer_Type := (0 => 56, 1 => 57, others => 0); - Buffer2 : constant Command_Types.Command_Arg_Buffer_Type := (0 => 13, 1 => 14, others => 0); + Buffer1 : constant Command_Types.Command_Arg_Buffer_Type := [0 => 56, 1 => 57, others => 0]; + Buffer2 : constant Command_Types.Command_Arg_Buffer_Type := [0 => 13, 1 => 14, others => 0]; begin -- Register two new commands: T.Command_Response_T_Send ((Source_Id => 0, Registration_Id => 2, Command_Id => 27, Status => Register)); diff --git a/src/components/command_sequencer/component-command_sequencer-implementation.adb b/src/components/command_sequencer/component-command_sequencer-implementation.adb index 85c7943d..897e8840 100644 --- a/src/components/command_sequencer/component-command_sequencer-implementation.adb +++ b/src/components/command_sequencer/component-command_sequencer-implementation.adb @@ -611,7 +611,7 @@ package body Component.Command_Sequencer.Implementation is Sequence_Id => Engine.Get_Lowest_Child_Id, Print_Type => Print_From_Engine.Print_Type ), - Print_String => (others => 0) + Print_String => [others => 0] ); begin -- Safe copy print from engine to event. This truncates the string if necessary: @@ -1323,7 +1323,7 @@ package body Component.Command_Sequencer.Implementation is -- OK, now we are good to load arguments into the engine. declare -- Initialize the arguments as zero. - Args : Variable_Array := (others => (Value => (others => 0))); + Args : Variable_Array := [others => (Value => [others => 0])]; begin -- This implementation assumes that the variable array is of length 16 and the number -- of arguments provided in Packed_Variable_Array.T is also 16. If this is not true, then diff --git a/src/components/command_sequencer/seq/decode/seq_config.adb b/src/components/command_sequencer/seq/decode/seq_config.adb index 28b8bb04..3b96112d 100644 --- a/src/components/command_sequencer/seq/decode/seq_config.adb +++ b/src/components/command_sequencer/seq/decode/seq_config.adb @@ -25,7 +25,7 @@ package body Seq_Config is L : Natural := 0; I : Natural := 1; Whitespace : constant Character_Set := To_Set (' '); - To_Return : String_Array := (others => (others => ASCII.NUL)); + To_Return : String_Array := [others => [others => ASCII.NUL]]; End_Idx : Natural := S'Last; begin Words_Parsed := Natural'First; @@ -117,7 +117,7 @@ package body Seq_Config is Name : constant Seq_String := Parsed_Line (1); Pattern_Str : constant Seq_String := Parsed_Line (3); Pattern_Idx : Natural := Pattern_Str'First; - Command_Bytes : Command.Serialization.Byte_Array := (others => 0); + Command_Bytes : Command.Serialization.Byte_Array := [others => 0]; Command_Bytes_Idx : Natural := Command_Bytes'First; The_Command : Command.T := ( Header => ( @@ -125,7 +125,7 @@ package body Seq_Config is Id => 0, Arg_Buffer_Length => 0 ), - Arg_Buffer => (others => 0) + Arg_Buffer => [others => 0] ); Stat : Serialization_Status; begin diff --git a/src/components/command_sequencer/seq/decode/seq_config.ads b/src/components/command_sequencer/seq/decode/seq_config.ads index d6ddc3f9..7d2f9d01 100644 --- a/src/components/command_sequencer/seq/decode/seq_config.ads +++ b/src/components/command_sequencer/seq/decode/seq_config.ads @@ -19,7 +19,7 @@ package Seq_Config is -- Command parameter definitions: type Seq_Cmd_Param_Def is record - Name : Seq_String := (others => ASCII.NUL); + Name : Seq_String := [others => ASCII.NUL]; Offset : Natural := 0; Size : Positive := 1; Data_Type : Seq_Param_Type; @@ -29,14 +29,14 @@ package Seq_Config is -- Command definition: type Seq_Cmd_Def is record - Name : Seq_String := (others => ASCII.NUL); + Name : Seq_String := [others => ASCII.NUL]; Parameters : Seq_Cmd_Param_Array_Access := null; Command_Def : Command.T; end record; -- Telemetry definition: type Seq_Tlm_Def is record - Name : Seq_String := (others => ASCII.NUL); + Name : Seq_String := [others => ASCII.NUL]; Id : Data_Product_Types.Data_Product_Id; end record; diff --git a/src/components/command_sequencer/seq/engine/seq.adb b/src/components/command_sequencer/seq/engine/seq.adb index 46ad5233..c56305bc 100644 --- a/src/components/command_sequencer/seq/engine/seq.adb +++ b/src/components/command_sequencer/seq/engine/seq.adb @@ -188,7 +188,7 @@ package body Seq is -- Reset some important state: Self.Current := Max_Seq_Num'First; - Self.Arguments := (others => (Value => (others => 0))); + Self.Arguments := [others => (Value => [others => 0])]; Self.Last_Command_Id := 0; Self.Reserved_Sequence_Id := Sequence_Types.Sequence_Id'First; Self.Last_Execute_State := Seq_Execute_State.Unloaded; @@ -221,7 +221,7 @@ package body Seq is -- Load the new sequence Self.Stack.all (Self.Current).Give_Arguments (Self.Arguments); - Self.Arguments := (others => (Value => (others => 0))); -- Reset engine argument buffer + Self.Arguments := [others => (Value => [others => 0])]; -- Reset engine argument buffer -- Load the sequence Load_State := Self.Stack.all (Self.Current).Load_New_Sequence (Sequence_Region); diff --git a/src/components/command_sequencer/seq/engine/seq.ads b/src/components/command_sequencer/seq/engine/seq.ads index f5e78a3f..7ecde110 100644 --- a/src/components/command_sequencer/seq/engine/seq.ads +++ b/src/components/command_sequencer/seq/engine/seq.ads @@ -226,7 +226,7 @@ private Current : Max_Seq_Num := Max_Seq_Num'First; Source_Id : Command_Source_Id := Command_Source_Id'First; Engine_To_Load : Sequence_Engine_Id := Sequence_Engine_Id'First; - Arguments : Variable_Array := (others => (Value => (others => 0))); + Arguments : Variable_Array := [others => (Value => [others => 0])]; Engine_Id : Sequence_Engine_Id := Sequence_Engine_Id'First; Commands_Sent : Interfaces.Unsigned_16 := 0; Last_Command_Id : Command_Id := 0; diff --git a/src/components/command_sequencer/seq/runtime/seq_runtime.adb b/src/components/command_sequencer/seq/runtime/seq_runtime.adb index 36981e8d..14312189 100644 --- a/src/components/command_sequencer/seq/runtime/seq_runtime.adb +++ b/src/components/command_sequencer/seq/runtime/seq_runtime.adb @@ -149,9 +149,9 @@ package body Seq_Runtime is -- Reset all important state for the runtime except for internal variables. Self.Sequence_Region := (Length => 0, Address => System.Null_Address); Self.Position := 0; - Self.Seq_Header := (Crc => (0, 0), Version => 0, Category => 0, Id => 0, Length => 0); - Self.Internals := (others => (Value => (0, 0, 0, 0))); - Self.Out_Arguments := (others => (Value => (0, 0, 0, 0))); + Self.Seq_Header := (Crc => [0, 0], Version => 0, Category => 0, Id => 0, Length => 0); + Self.Internals := [others => (Value => [0, 0, 0, 0])]; + Self.Out_Arguments := [others => (Value => [0, 0, 0, 0])]; Self.Telemetry_Timeout := (0, 0); Self.Timeout_Set := False; Self.Wake_Time := (0, 0); @@ -163,7 +163,7 @@ package body Seq_Runtime is Self.Errant_Field := 0; Self.State := Unloaded; Self.Next_Position := 0; - Self.Bit_Pattern := (Header => (Source_Id => 0, Id => 0, Arg_Buffer_Length => 0), Arg_Buffer => (others => 0)); + Self.Bit_Pattern := (Header => (Source_Id => 0, Id => 0, Arg_Buffer_Length => 0), Arg_Buffer => [others => 0]); Self.Telemetry_Request := (Id => 0, Offset => 0, Size => 1, Tlm_Type => Seq_Data_Format.Unsigned_Byte, New_Value_Required => False); Self.Telemetry_Destination := Seq_Internal.Timeout; Self.Kill_Engine_Start := Sequence_Engine_Id'First; @@ -262,7 +262,7 @@ package body Seq_Runtime is Temp : constant Variable_Array := Self.Out_Arguments; begin -- Reset arguments, - Self.Out_Arguments := (others => (Value => (0, 0, 0, 0))); + Self.Out_Arguments := [others => (Value => [0, 0, 0, 0])]; -- Return the copy. return Temp; end Get_And_Reset_Arguments; @@ -737,7 +737,7 @@ package body Seq_Runtime is Ignore : Seq_Position; begin -- Initialize out parameter: - Var := (Value => (others => 0)); + Var := (Value => [others => 0]); -- Set the source to either in sequence data or local var data case Var_Info.Var_Type is @@ -1583,7 +1583,7 @@ package body Seq_Runtime is -- can the be fetched by the caller. Self.String_To_Print := ( Print_Type => Instruction.Print_Type, - Encoded_String => (others => 0) -- Clear this with zeros. + Encoded_String => [others => 0] -- Clear this with zeros. ); -- Perform copy of string. Safe_Left_Copy ( @@ -1617,7 +1617,7 @@ package body Seq_Runtime is -- can the be fetched by the caller. Self.String_To_Print := ( Print_Type => Instruction.Print_Type, - Encoded_String => (others => 0) -- Clear this with zeros. + Encoded_String => [others => 0] -- Clear this with zeros. ); -- Get the variable: diff --git a/src/components/command_sequencer/seq/runtime/seq_runtime.ads b/src/components/command_sequencer/seq/runtime/seq_runtime.ads index c61bb11d..e7eb80b3 100644 --- a/src/components/command_sequencer/seq/runtime/seq_runtime.ads +++ b/src/components/command_sequencer/seq/runtime/seq_runtime.ads @@ -255,12 +255,12 @@ private Position : Seq_Position := 0; Next_Position : Seq_Position := 0; Bit_Pattern : Command.T; - Seq_Header : Sequence_Header.T := (Crc => (0, 0), Version => 0, Category => 0, Id => 0, Length => 0); - Internals : Internal_Array := (others => (Value => (0, 0, 0, 0))); - Local_Variable_Array : Variable_Array := (others => (Value => (0, 0, 0, 0))); + Seq_Header : Sequence_Header.T := (Crc => [0, 0], Version => 0, Category => 0, Id => 0, Length => 0); + Internals : Internal_Array := [others => (Value => [0, 0, 0, 0])]; + Local_Variable_Array : Variable_Array := [others => (Value => [0, 0, 0, 0])]; -- We are not supporting strings yet... - -- Local_String_Pool : String_Pool := (others => (others => Character'Val (0))); -- This is a null initialization - Out_Arguments : Variable_Array := (others => (Value => (0, 0, 0, 0))); + -- Local_String_Pool : String_Pool := [others => (others => Character'Val (0])); -- This is a null initialization + Out_Arguments : Variable_Array := [others => (Value => [0, 0, 0, 0])]; Telemetry_Request : Telemetry_Record.T := (Id => 0, Offset => 0, Size => 1, Tlm_Type => Seq_Data_Format.Unsigned_Byte, New_Value_Required => False); Telemetry_Destination : Seq_Internal.E := Seq_Internal.Timeout; Telemetry_Timeout : Sys_Time.T := (0, 0); @@ -278,7 +278,7 @@ private Seq_Id_To_Load : Sequence_Types.Sequence_Id := Sequence_Types.Sequence_Id'First; Spawn_Destination : Sequence_Engine_Id := Sequence_Engine_Id'First; Errant_Field : Interfaces.Unsigned_32 := 0; - String_To_Print : Seq_Print.T := (Print_Type => Print_Type.Debug, Encoded_String => (others => 0)); + String_To_Print : Seq_Print.T := (Print_Type => Print_Type.Debug, Encoded_String => [others => 0]); end record; end Seq_Runtime; diff --git a/src/components/command_sequencer/seq/test/seq_runtime-tester.adb b/src/components/command_sequencer/seq/test/seq_runtime-tester.adb index 0bcfa981..f40efcad 100644 --- a/src/components/command_sequencer/seq/test/seq_runtime-tester.adb +++ b/src/components/command_sequencer/seq/test/seq_runtime-tester.adb @@ -3,7 +3,7 @@ with Packed_U32.Validation; package body Seq_Runtime.Tester is procedure Reset_Instance (Self : in out Instance) is - Header : constant Sequence_Header.T := (Crc => (0, 0), Version => 0, Category => 0, Id => 0, Length => 99); + Header : constant Sequence_Header.T := (Crc => [0, 0], Version => 0, Category => 0, Id => 0, Length => 99); begin Self.Unload; Self.Seq_Header := Header; diff --git a/src/components/command_sequencer/seq/test/seq_tests-implementation.adb b/src/components/command_sequencer/seq/test/seq_tests-implementation.adb index 08032969..1a914bdc 100644 --- a/src/components/command_sequencer/seq/test/seq_tests-implementation.adb +++ b/src/components/command_sequencer/seq/test/seq_tests-implementation.adb @@ -457,7 +457,7 @@ package body Seq_Tests.Implementation is Exec_State_Assert.Eq (Engine.Execute (1_000, Time), Seq_Execute_State.Wait_Telemetry); Exec_State_Assert.Eq (Engine.Execute (1_000, Time), Seq_Execute_State.Wait_Telemetry); Sys_Time_Assert.Eq (Engine.Get_Telemetry_Timeout, (1_000, 0)); - Engine.Set_Telemetry ((0, 0, 0, 0)); + Engine.Set_Telemetry ([0, 0, 0, 0]); Exec_State_Assert.Eq (Engine.Execute (1_000, Time), Seq_Execute_State.Wait_Telemetry_Relative); Exec_State_Assert.Eq (Engine.Execute (1_000, Time), Seq_Execute_State.Wait_Telemetry_Relative); Sys_Time_Assert.Eq (Engine.Get_Telemetry_Timeout, (5, 0)); @@ -465,11 +465,11 @@ package body Seq_Tests.Implementation is Exec_State_Assert.Eq (Engine.Execute (1_000, Time), Seq_Execute_State.Wait_Telemetry); Exec_State_Assert.Eq (Engine.Execute (1_000, Time), Seq_Execute_State.Wait_Telemetry); Sys_Time_Assert.Eq (Engine.Get_Telemetry_Timeout, (5, 0)); - Engine.Set_Telemetry ((0, 0, 0, 0)); + Engine.Set_Telemetry ([0, 0, 0, 0]); Exec_State_Assert.Eq (Engine.Execute (1_000, Time), Seq_Execute_State.Wait_Telemetry); Exec_State_Assert.Eq (Engine.Execute (1_000, Time), Seq_Execute_State.Wait_Telemetry); Sys_Time_Assert.Eq (Engine.Get_Telemetry_Timeout, (2_000, 0)); - Engine.Set_Telemetry ((0, 0, 0, 1)); + Engine.Set_Telemetry ([0, 0, 0, 1]); Exec_State_Assert.Eq (Engine.Execute (1_000, Time), Seq_Execute_State.Wait_Telemetry_Relative); Exec_State_Assert.Eq (Engine.Execute (1_000, Time), Seq_Execute_State.Wait_Telemetry_Relative); Sys_Time_Assert.Eq (Engine.Get_Telemetry_Timeout, (10, 0)); @@ -477,7 +477,7 @@ package body Seq_Tests.Implementation is Exec_State_Assert.Eq (Engine.Execute (1_000, Time), Seq_Execute_State.Wait_Telemetry); Exec_State_Assert.Eq (Engine.Execute (1_000, Time), Seq_Execute_State.Wait_Telemetry); Sys_Time_Assert.Eq (Engine.Get_Telemetry_Timeout, (10, 0)); - Engine.Set_Telemetry ((0, 0, 0, 1)); + Engine.Set_Telemetry ([0, 0, 0, 1]); Exec_State_Assert.Eq (Engine.Execute (1_000, Time), Seq_Execute_State.Wait_Telemetry_Relative); Exec_State_Assert.Eq (Engine.Execute (1_000, Time), Seq_Execute_State.Wait_Telemetry_Relative); Sys_Time_Assert.Eq (Engine.Get_Telemetry_Timeout, (5, 0)); @@ -485,7 +485,7 @@ package body Seq_Tests.Implementation is Exec_State_Assert.Eq (Engine.Execute (1_000, Time), Seq_Execute_State.Wait_Telemetry); Exec_State_Assert.Eq (Engine.Execute (1_000, Time), Seq_Execute_State.Wait_Telemetry); Sys_Time_Assert.Eq (Engine.Get_Telemetry_Timeout, (5, 0)); - Engine.Set_Telemetry ((0, 0, 0, 3)); + Engine.Set_Telemetry ([0, 0, 0, 3]); Exec_State_Assert.Eq (Engine.Execute (1_000, Time), Seq_Execute_State.Wait_Telemetry_Relative); Exec_State_Assert.Eq (Engine.Execute (1_000, Time), Seq_Execute_State.Wait_Telemetry_Relative); Engine.Change_Relative_Timeout_To_Absolute (Time); @@ -494,7 +494,7 @@ package body Seq_Tests.Implementation is Engine.Change_Relative_Timeout_To_Absolute (Time); Exec_State_Assert.Eq (Engine.Execute (1_000, Time), Seq_Execute_State.Wait_Telemetry); Exec_State_Assert.Eq (Engine.Execute (1_000, Time), Seq_Execute_State.Wait_Telemetry); - Engine.Set_Telemetry ((0, 0, 0, 10)); + Engine.Set_Telemetry ([0, 0, 0, 10]); Exec_State_Assert.Eq (Engine.Execute (1_000, Time), Seq_Execute_State.Unloaded); Engine.Destroy; pragma Unreferenced (Engine); @@ -520,17 +520,17 @@ package body Seq_Tests.Implementation is Exec_State_Assert.Eq (Engine.Execute (1_000, Time), Seq_Execute_State.Wait_Telemetry); Exec_State_Assert.Eq (Engine.Execute (1_000, Time), Seq_Execute_State.Wait_Telemetry); -- wrong value and then timeout: - Engine.Set_Telemetry ((0, 0, 0, 18)); + Engine.Set_Telemetry ([0, 0, 0, 18]); Time := (1_000, 0); Exec_State_Assert.Eq (Engine.Execute (1_000, Time), Seq_Execute_State.Wait_Telemetry_Relative); Exec_State_Assert.Eq (Engine.Execute (1_000, Time), Seq_Execute_State.Wait_Telemetry_Relative); Engine.Change_Relative_Timeout_To_Absolute (Time); Exec_State_Assert.Eq (Engine.Execute (1_000, Time), Seq_Execute_State.Wait_Telemetry); Exec_State_Assert.Eq (Engine.Execute (1_000, Time), Seq_Execute_State.Wait_Telemetry); - Engine.Set_Telemetry ((0, 0, 0, 2)); + Engine.Set_Telemetry ([0, 0, 0, 2]); Exec_State_Assert.Eq (Engine.Execute (1_000, Time), Seq_Execute_State.Wait_Telemetry); Exec_State_Assert.Eq (Engine.Execute (1_000, Time), Seq_Execute_State.Wait_Telemetry); - Engine.Set_Telemetry ((0, 0, 0, 1)); + Engine.Set_Telemetry ([0, 0, 0, 1]); Exec_State_Assert.Eq (Engine.Execute (1_000, Time), Seq_Execute_State.Wait_Telemetry_Relative); Exec_State_Assert.Eq (Engine.Execute (1_000, Time), Seq_Execute_State.Wait_Telemetry_Relative); Engine.Change_Relative_Timeout_To_Absolute (Time); @@ -543,7 +543,7 @@ package body Seq_Tests.Implementation is Engine.Change_Relative_Timeout_To_Absolute (Time); Exec_State_Assert.Eq (Engine.Execute (1_000, Time), Seq_Execute_State.Wait_Telemetry); Exec_State_Assert.Eq (Engine.Execute (1_000, Time), Seq_Execute_State.Wait_Telemetry); - Engine.Set_Telemetry ((0, 0, 0, 4)); + Engine.Set_Telemetry ([0, 0, 0, 4]); Exec_State_Assert.Eq (Engine.Execute (1_000, Time), Seq_Execute_State.Wait_Telemetry_Relative); Exec_State_Assert.Eq (Engine.Execute (1_000, Time), Seq_Execute_State.Wait_Telemetry_Relative); Engine.Change_Relative_Timeout_To_Absolute (Time); @@ -552,7 +552,7 @@ package body Seq_Tests.Implementation is Engine.Change_Relative_Timeout_To_Absolute (Time); Exec_State_Assert.Eq (Engine.Execute (1_000, Time), Seq_Execute_State.Wait_Telemetry); Exec_State_Assert.Eq (Engine.Execute (1_000, Time), Seq_Execute_State.Wait_Telemetry); - Engine.Set_Telemetry ((0, 0, 0, 10)); + Engine.Set_Telemetry ([0, 0, 0, 10]); Exec_State_Assert.Eq (Engine.Execute (1_000, Time), Seq_Execute_State.Unloaded); Engine.Destroy; pragma Unreferenced (Engine); @@ -602,7 +602,7 @@ package body Seq_Tests.Implementation is Exec_State_Assert.Eq (Engine.Execute (1_000, Time), Seq_Execute_State.Set_Telemetry); Exec_State_Assert.Eq (Engine.Execute (1_000, Time), Seq_Execute_State.Set_Telemetry); Exec_State_Assert.Eq (Engine.Execute (1_000, Time), Seq_Execute_State.Set_Telemetry); - Engine.Set_Telemetry ((0, 0, 0, 0)); + Engine.Set_Telemetry ([0, 0, 0, 0]); Exec_State_Assert.Eq (Engine.Execute (1_000, Time), Seq_Execute_State.Unloaded); Engine.Destroy; pragma Unreferenced (Engine); @@ -773,7 +773,7 @@ package body Seq_Tests.Implementation is Time : constant Sys_Time.T := (0, 0); function Create_Print_String (Str : in String) return Seq_Types.Seq_String is - To_Return : Seq_Types.Seq_String := (others => 0); + To_Return : Seq_Types.Seq_String := [others => 0]; pragma Warnings (Off, "overlay changes scalar storage order"); Overlay : Basic_Types.Byte_Array (1 .. Str'Length) with Import, Convention => Ada, Address => Str'Address; @@ -886,14 +886,14 @@ package body Seq_Tests.Implementation is end Instruction_Overflow; overriding procedure Set_Bit_Pattern (Self : in out Instance) is - Header : constant Sequence_Header.T := (Crc => (0, 0), Version => 0, Category => 0, Id => 0, Length => 30); + Header : constant Sequence_Header.T := (Crc => [0, 0], Version => 0, Category => 0, Id => 0, Length => 30); Sbp_Record : constant Set_Bit_Record.T := (Opcode => 0, Pad => 0, Length => 0); Instruction : constant Basic_Types.Byte_Array := Set_Bit_Record.Serialization.To_Byte_Array (Sbp_Record); - Instruction_With_Long_Command : constant Basic_Types.Byte_Array (0 .. 35) := (0, 0, 0, 33, 0, 1, 0, 2, 28, others => 0); - Instruction_With_Wrong_Size : constant Basic_Types.Byte_Array (0 .. 35) := (0, 0, 0, 33, 0, 1, 0, 2, 20, others => 0); + Instruction_With_Long_Command : constant Basic_Types.Byte_Array (0 .. 35) := [0, 0, 0, 33, 0, 1, 0, 2, 28, others => 0]; + Instruction_With_Wrong_Size : constant Basic_Types.Byte_Array (0 .. 35) := [0, 0, 0, 33, 0, 1, 0, 2, 20, others => 0]; - Instruction_Valid : constant Basic_Types.Byte_Array (0 .. 35) := (0, 0, 0, 20, 0, 1, 0, 2, 15, others => 0); + Instruction_Valid : constant Basic_Types.Byte_Array (0 .. 35) := [0, 0, 0, 20, 0, 1, 0, 2, 15, others => 0]; begin -- Cause a command serialization failure (zero value) Seq_Position_Assert.Eq (Seq_Runtime.Tester.Call_Set_Bit_Pattern (Self.Wb_Runner, Header, Instruction), 0); @@ -925,9 +925,9 @@ package body Seq_Tests.Implementation is overriding procedure Update_Bit_Pattern (Self : in out Instance) is -- U8 - U8 - U16 - U32 | Opcode - Pad - Offset - Length -- cannot offset of zero, that would overwrite command header. - Bad_Offset_Bit_Pattern : constant Basic_Types.Byte_Array := (2, 0, 0, 0, 0, 0, 0, 0); - Bad_Length_Bit_Pattern : constant Basic_Types.Byte_Array := (2, 0, 250, 0, 255, 255, 255, 255); - Bad_Combined_Bit_Pattern : constant Basic_Types.Byte_Array := (2, 0, 250, 0, 0, 0, 0, 33); + Bad_Offset_Bit_Pattern : constant Basic_Types.Byte_Array := [2, 0, 0, 0, 0, 0, 0, 0]; + Bad_Length_Bit_Pattern : constant Basic_Types.Byte_Array := [2, 0, 250, 0, 255, 255, 255, 255]; + Bad_Combined_Bit_Pattern : constant Basic_Types.Byte_Array := [2, 0, 250, 0, 0, 0, 0, 33]; begin -- Bad offset test Seq_Position_Assert.Eq (Seq_Runtime.Tester.Call_Update_Bit_Pattern (Self.Wb_Runner, Bad_Offset_Bit_Pattern), 0); @@ -1021,7 +1021,7 @@ package body Seq_Tests.Implementation is Add_Instruction : constant Basic_Types.Byte_Array := Eval_Record.Serialization.To_Byte_Array (Add_Record); Sub_Instruction : constant Basic_Types.Byte_Array := Eval_Record.Serialization.To_Byte_Array (Sub_Record); - Invalid_Instruction : constant Basic_Types.Byte_Array := (7, 0, 0, 0); + Invalid_Instruction : constant Basic_Types.Byte_Array := [7, 0, 0, 0]; begin -- Instruction parse error Seq_Position_Assert.Eq (Seq_Runtime.Tester.Call_Eval (Self.Wb_Runner, Invalid_Instruction), 0); @@ -1062,8 +1062,8 @@ package body Seq_Tests.Implementation is Id1 : constant Packed_U32.T := (Value => 2); Id2 : constant Packed_U32.T := (Value => 3); Badid : constant Packed_U32.T := (Value => 30); - Test_Seq_Vara : constant Packed_Poly_32_Type.T := (Value => (0, 0, 0, 22)); - Test_Seq_Varb : constant Packed_Poly_32_Type.T := (Value => (255, 255, 255, 255)); + Test_Seq_Vara : constant Packed_Poly_32_Type.T := (Value => [0, 0, 0, 22]); + Test_Seq_Varb : constant Packed_Poly_32_Type.T := (Value => [255, 255, 255, 255]); Constantvarrecorda : constant Var_Record.T := (Id => Value1.Value, Var_Type => In_Sequence, Pad => 0); Constantvarrecordb : constant Var_Record.T := (Id => Value2.Value, Var_Type => In_Sequence, Pad => 0); Localvarrecorda : constant Var_Record.T := (Id => Id1.Value, Var_Type => Local, Pad => 0); @@ -1277,7 +1277,7 @@ package body Seq_Tests.Implementation is end Wait; overriding procedure Seq_Goto (Self : in out Instance) is - Header : constant Sequence_Header.T := (Crc => (0, 0), Version => 0, Category => 0, Id => 0, Length => 10); + Header : constant Sequence_Header.T := (Crc => [0, 0], Version => 0, Category => 0, Id => 0, Length => 10); Position_Valid : constant Packed_U16.T := (Value => 6); Position_Invalid_High : constant Packed_U16.T := (Value => 15); @@ -1302,7 +1302,7 @@ package body Seq_Tests.Implementation is overriding procedure Jump_If_Zero (Self : in out Instance) is Zero : constant Packed_U32.T := (Value => 0); Nonzero : constant Packed_U32.T := (Value => 123); - Header : constant Sequence_Header.T := (Crc => (0, 0), Version => 0, Category => 0, Id => 0, Length => 99); + Header : constant Sequence_Header.T := (Crc => [0, 0], Version => 0, Category => 0, Id => 0, Length => 99); Zerovar : constant Var_Record.T := (Id => Zero.Value, Var_Type => In_Sequence, Pad => 0); Nonzerovar : constant Var_Record.T := (Id => Nonzero.Value, Var_Type => In_Sequence, Pad => 0); Fetchzero : constant Fetch_Var_Record.T := (Opcode => 8, Pad1 => 0, Pad2 => 0, Pad3 => 0, Var_Info => Zerovar); @@ -1337,7 +1337,7 @@ package body Seq_Tests.Implementation is overriding procedure Jump_Not_Zero (Self : in out Instance) is Zero : constant Packed_U32.T := (Value => 0); Nonzero : constant Packed_U32.T := (Value => 123); - Header : constant Sequence_Header.T := (Crc => (0, 0), Version => 0, Category => 0, Id => 0, Length => 99); + Header : constant Sequence_Header.T := (Crc => [0, 0], Version => 0, Category => 0, Id => 0, Length => 99); Zerovar : constant Var_Record.T := (Id => Zero.Value, Var_Type => In_Sequence, Pad => 0); Nonzerovar : constant Var_Record.T := (Id => Nonzero.Value, Var_Type => In_Sequence, Pad => 0); Fetchzero : constant Fetch_Var_Record.T := (Opcode => 8, Pad1 => 0, Pad2 => 0, Pad3 => 0, Var_Info => Zerovar); @@ -1370,7 +1370,7 @@ package body Seq_Tests.Implementation is end Jump_Not_Zero; overriding procedure Jump_If_Equal (Self : in out Instance) is - Header : constant Sequence_Header.T := (Crc => (0, 0), Version => 0, Category => 0, Id => 0, Length => 99); + Header : constant Sequence_Header.T := (Crc => [0, 0], Version => 0, Category => 0, Id => 0, Length => 99); Val1 : constant Packed_U32.T := (Value => 12); Val2 : constant Packed_U32.T := (Value => 32_432); Var1 : constant Var_Record.T := (Id => Val1.Value, Var_Type => In_Sequence, Pad => 0); @@ -1405,7 +1405,7 @@ package body Seq_Tests.Implementation is end Jump_If_Equal; overriding procedure Jump_Not_Equal (Self : in out Instance) is - Header : constant Sequence_Header.T := (Crc => (0, 0), Version => 0, Category => 0, Id => 0, Length => 99); + Header : constant Sequence_Header.T := (Crc => [0, 0], Version => 0, Category => 0, Id => 0, Length => 99); Val1 : constant Packed_U32.T := (Value => 12); Val2 : constant Packed_U32.T := (Value => 32_432); Var1 : constant Var_Record.T := (Id => Val1.Value, Var_Type => In_Sequence, Pad => 0); @@ -1446,11 +1446,11 @@ package body Seq_Tests.Implementation is end Seq_Return; overriding procedure Wait_If_Zero (Self : in out Instance) is - Header : constant Sequence_Header.T := (Crc => (0, 0), Version => 0, Category => 0, Id => 0, Length => 20); + Header : constant Sequence_Header.T := (Crc => [0, 0], Version => 0, Category => 0, Id => 0, Length => 20); -- U8 - E8 - U16 - U32 | Opcode - waitType - Position - Timeout - Parseerror : constant Basic_Types.Byte_Array := (21, 0, 0, 0, 0, 0, 0, 0); - Waiterror : constant Basic_Types.Byte_Array := (21, 1, 0, 0, 0, 0, 0, 0); - Jumperror : constant Basic_Types.Byte_Array := (21, 2, 0, 40, 0, 0, 0, 0); + Parseerror : constant Basic_Types.Byte_Array := [21, 0, 0, 0, 0, 0, 0, 0]; + Waiterror : constant Basic_Types.Byte_Array := [21, 1, 0, 0, 0, 0, 0, 0]; + Jumperror : constant Basic_Types.Byte_Array := [21, 2, 0, 40, 0, 0, 0, 0]; begin -- Parse Error Seq_Position_Assert.Eq (Seq_Runtime.Tester.Call_Wait_If_Zero (Self.Wb_Runner, Header, Parseerror), 0); @@ -1473,9 +1473,9 @@ package body Seq_Tests.Implementation is end Wait_If_Zero; overriding procedure Eval_Flt (Self : in out Instance) is - Add_Instruction : constant Basic_Types.Byte_Array := (27, 43, 0, 0); - Invalid_Instruction : constant Basic_Types.Byte_Array := (27, 0, 0, 0); - Invalid_Op_Instruction : constant Basic_Types.Byte_Array := (27, 124, 0, 0); + Add_Instruction : constant Basic_Types.Byte_Array := [27, 43, 0, 0]; + Invalid_Instruction : constant Basic_Types.Byte_Array := [27, 0, 0, 0]; + Invalid_Op_Instruction : constant Basic_Types.Byte_Array := [27, 124, 0, 0]; begin -- Instruction parse error @@ -1533,9 +1533,9 @@ package body Seq_Tests.Implementation is end Eval_Flt; overriding procedure Cast_F_To_U (Self : in out Instance) is - Negative : constant Packed_U32.T := Packed_U32.Serialization.From_Byte_Array ((191, 153, 153, 154)); -- -1.2 other values that would cause are (255,255,255,255) - Positive : constant Packed_U32.T := Packed_U32.Serialization.From_Byte_Array ((67, 106, 87, 10)); -- 234.34 - Neg_Inf : constant Packed_U32.T := Packed_U32.Serialization.From_Byte_Array ((255, 16#80#, 0, 0)); -- negative infinity + Negative : constant Packed_U32.T := Packed_U32.Serialization.From_Byte_Array ([191, 153, 153, 154]); -- -1.2 other values that would cause are (255,255,255,255) + Positive : constant Packed_U32.T := Packed_U32.Serialization.From_Byte_Array ([67, 106, 87, 10]); -- 234.34 + Neg_Inf : constant Packed_U32.T := Packed_U32.Serialization.From_Byte_Array ([255, 16#80#, 0, 0]); -- negative infinity Neg_Var : constant Var_Record.T := (Id => Negative.Value, Var_Type => In_Sequence, Pad => 0); Pos_Var : constant Var_Record.T := (Id => Positive.Value, Var_Type => In_Sequence, Pad => 0); Neg_Inf_Var : constant Var_Record.T := (Id => Neg_Inf.Value, Var_Type => In_Sequence, Pad => 0); @@ -1647,10 +1647,10 @@ package body Seq_Tests.Implementation is end Cast_U_To_F; overriding procedure Eval_S (Self : in out Instance) is - Add_Instruction : constant Basic_Types.Byte_Array := (27, 43, 0, 0); - Sub_Instruction : constant Basic_Types.Byte_Array := (30, 45, 0, 0); + Add_Instruction : constant Basic_Types.Byte_Array := [27, 43, 0, 0]; + Sub_Instruction : constant Basic_Types.Byte_Array := [30, 45, 0, 0]; -- sub_instruction : Basic_Types.Byte_Array := Eval_Record.Serialization.To_Byte_Array (sub_record); - Parseerror : constant Basic_Types.Byte_Array := (27, 0, 0, 0); + Parseerror : constant Basic_Types.Byte_Array := [27, 0, 0, 0]; begin -- Parse Error Seq_Position_Assert.Eq (Seq_Runtime.Tester.Call_Eval_S (Self.Wb_Runner, Parseerror), 0); @@ -1679,8 +1679,8 @@ package body Seq_Tests.Implementation is end Eval_S; overriding procedure Cast_S_To_U (Self : in out Instance) is - Negative : constant Packed_U32.T := Packed_U32.Serialization.From_Byte_Array ((255, 255, 255, 255)); -- -1 so will cause a casting error - Positive : constant Packed_U32.T := Packed_U32.Serialization.From_Byte_Array ((0, 0, 0, 100)); -- 100, will not cause any issues + Negative : constant Packed_U32.T := Packed_U32.Serialization.From_Byte_Array ([255, 255, 255, 255]); -- -1 so will cause a casting error + Positive : constant Packed_U32.T := Packed_U32.Serialization.From_Byte_Array ([0, 0, 0, 100]); -- 100, will not cause any issues Neg_Var : constant Var_Record.T := (Id => Negative.Value, Var_Type => In_Sequence, Pad => 0); Pos_Var : constant Var_Record.T := (Id => Positive.Value, Var_Type => In_Sequence, Pad => 0); Neg_Fetch : constant Fetch_Var_Record.T := (Opcode => 8, Pad1 => 0, Pad2 => 0, Pad3 => 0, Var_Info => Neg_Var); @@ -1734,8 +1734,8 @@ package body Seq_Tests.Implementation is end Cast_S_To_U; overriding procedure Cast_U_To_S (Self : in out Instance) is - Negative : constant Packed_U32.T := Packed_U32.Serialization.From_Byte_Array ((255, 255, 255, 255)); -- u32 max, will cause an error - Positive : constant Packed_U32.T := Packed_U32.Serialization.From_Byte_Array ((0, 0, 0, 100)); -- 100, will not cause any issues + Negative : constant Packed_U32.T := Packed_U32.Serialization.From_Byte_Array ([255, 255, 255, 255]); -- u32 max, will cause an error + Positive : constant Packed_U32.T := Packed_U32.Serialization.From_Byte_Array ([0, 0, 0, 100]); -- 100, will not cause any issues Neg_Var : constant Var_Record.T := (Id => Negative.Value, Var_Type => In_Sequence, Pad => 0); Pos_Var : constant Var_Record.T := (Id => Positive.Value, Var_Type => In_Sequence, Pad => 0); Neg_Fetch : constant Fetch_Var_Record.T := (Opcode => 8, Pad1 => 0, Pad2 => 0, Pad3 => 0, Var_Info => Neg_Var); @@ -1791,9 +1791,9 @@ package body Seq_Tests.Implementation is overriding procedure Cast_F_To_S (Self : in out Instance) is -- nifty float converter: https://www.h-schmidt.net/FloatConverter/IEEE754.html - Negative : constant Packed_U32.T := Packed_U32.Serialization.From_Byte_Array ((16#cf#, 16#9d#, 16#cd#, 16#65#)); -- -5294967296 float - Positive : constant Packed_U32.T := Packed_U32.Serialization.From_Byte_Array ((67, 106, 87, 10)); -- 234.34 - Nan : constant Packed_U32.T := Packed_U32.Serialization.From_Byte_Array ((255, 255, 255, 255)); -- nan + Negative : constant Packed_U32.T := Packed_U32.Serialization.From_Byte_Array ([16#cf#, 16#9d#, 16#cd#, 16#65#]); -- -5294967296 float + Positive : constant Packed_U32.T := Packed_U32.Serialization.From_Byte_Array ([67, 106, 87, 10]); -- 234.34 + Nan : constant Packed_U32.T := Packed_U32.Serialization.From_Byte_Array ([255, 255, 255, 255]); -- nan Neg_Var : constant Var_Record.T := (Id => Negative.Value, Var_Type => In_Sequence, Pad => 0); Pos_Var : constant Var_Record.T := (Id => Positive.Value, Var_Type => In_Sequence, Pad => 0); Nan_Var : constant Var_Record.T := (Id => Nan.Value, Var_Type => In_Sequence, Pad => 0); @@ -1861,7 +1861,7 @@ package body Seq_Tests.Implementation is end Cast_F_To_S; overriding procedure Cast_S_To_F (Self : in out Instance) is - Val : constant Packed_U32.T := Packed_U32.Serialization.From_Byte_Array ((255, 255, 255, 255)); -- -1 signed + Val : constant Packed_U32.T := Packed_U32.Serialization.From_Byte_Array ([255, 255, 255, 255]); -- -1 signed Var : constant Var_Record.T := (Id => Val.Value, Var_Type => In_Sequence, Pad => 0); Fetch : constant Fetch_Var_Record.T := (Opcode => 8, Pad1 => 0, Pad2 => 0, Pad3 => 0, Var_Info => Var); Cast_Record_A : constant Cast_Record.T := (Opcode => 28, Id => Seq_Internal.A, Pad1 => 0, Pad2 => 0); @@ -1911,24 +1911,24 @@ package body Seq_Tests.Implementation is Seq_Runtime.Tester.Reset_Instance (Self.Wb_Runner); -- Can be relative - Seq_Runtime.Tester.Update_Internal (Self.Wb_Runner, Seq_Internal.B, Packed_U32.Serialization.From_Byte_Array ((0, 0, 0, 10))); + Seq_Runtime.Tester.Update_Internal (Self.Wb_Runner, Seq_Internal.B, Packed_U32.Serialization.From_Byte_Array ([0, 0, 0, 10])); Seq_Position_Assert.Eq (Seq_Runtime.Tester.Call_Wait_On_B (Self.Wb_Runner, Relativeinstruction), 4); State_Assert.Eq (Self.Wb_Runner.Get_State, Wait_Relative); Seq_Runtime.Tester.Reset_Instance (Self.Wb_Runner); -- Can be absolute - Seq_Runtime.Tester.Update_Internal (Self.Wb_Runner, Seq_Internal.B, Packed_U32.Serialization.From_Byte_Array ((0, 0, 0, 10))); + Seq_Runtime.Tester.Update_Internal (Self.Wb_Runner, Seq_Internal.B, Packed_U32.Serialization.From_Byte_Array ([0, 0, 0, 10])); Seq_Position_Assert.Eq (Seq_Runtime.Tester.Call_Wait_On_B (Self.Wb_Runner, Absoluteinstruction), 4); State_Assert.Eq (Self.Wb_Runner.Get_State, Wait_Absolute); Seq_Runtime.Tester.Reset_Instance (Self.Wb_Runner); end Wait_On_B; overriding procedure Wait_If_Zero_On_B (Self : in out Instance) is - Header : constant Sequence_Header.T := (Crc => (0, 0), Version => 0, Category => 0, Id => 0, Length => 20); + Header : constant Sequence_Header.T := (Crc => [0, 0], Version => 0, Category => 0, Id => 0, Length => 20); -- U8 - E8 - U16 | Opcode - Wait Type - Position - Parseerror : constant Basic_Types.Byte_Array := (21, 0, 0, 0); - Waiterror : constant Basic_Types.Byte_Array := (21, 1, 0, 0); - Jumperror : constant Basic_Types.Byte_Array := (21, 1, 0, 40); + Parseerror : constant Basic_Types.Byte_Array := [21, 0, 0, 0]; + Waiterror : constant Basic_Types.Byte_Array := [21, 1, 0, 0]; + Jumperror : constant Basic_Types.Byte_Array := [21, 1, 0, 40]; begin -- Parse Error Seq_Position_Assert.Eq (Seq_Runtime.Tester.Call_Wait_If_Zero_On_B (Self.Wb_Runner, Header, Parseerror), 0); @@ -1953,10 +1953,10 @@ package body Seq_Tests.Implementation is -- A test for the Cmd Print instruction overriding procedure Cmd_Print (Self : in out Instance) is use Basic_Types; - The_String : constant Basic_Types.Byte_Array (0 .. 64) := (0 => 72, 1 => 73, others => 0); + The_String : constant Basic_Types.Byte_Array (0 .. 64) := [0 => 72, 1 => 73, others => 0]; -- U8 - E8 - U8 - U8 - U8xN - Good_Instruction : constant Basic_Types.Byte_Array := (0, 1, 0, 0) & The_String; - The_Bad_Instruction : constant Basic_Types.Byte_Array := (0, 254, 0, 0) & The_String; + Good_Instruction : constant Basic_Types.Byte_Array := [0, 1, 0, 0] & The_String; + The_Bad_Instruction : constant Basic_Types.Byte_Array := [0, 254, 0, 0] & The_String; begin -- Bad parse Seq_Position_Assert.Eq (Seq_Runtime.Tester.Call_Print (Self.Wb_Runner, The_Bad_Instruction), 0); @@ -1975,14 +1975,14 @@ package body Seq_Tests.Implementation is use Seq_Enums.Seq_Data_Type; -- U8 - E8 - E8 - U8 - var record - Bad_Instruction1 : constant Basic_Types.Byte_Array := (0, 254, 0, 0); - Bad_Instruction2 : constant Basic_Types.Byte_Array := (0, 0, 254, 0); + Bad_Instruction1 : constant Basic_Types.Byte_Array := [0, 254, 0, 0]; + Bad_Instruction2 : constant Basic_Types.Byte_Array := [0, 0, 254, 0]; Max_Var : constant Var_Record.T := (Id => 4_294_967_295, Var_Type => Local, Pad => 0); Max_Fetch : constant Print_Var_Record.T := (Opcode => 8, Print_Type => Debug, Data_Type => Unsigned, Pad => 0, Var_Info => Max_Var); Max_Fetch_Instruction : constant Basic_Types.Byte_Array := Print_Var_Record.Serialization.To_Byte_Array (Max_Fetch); - Nan : constant Packed_U32.T := Packed_U32.Serialization.From_Byte_Array ((255, 255, 255, 255)); -- nan + Nan : constant Packed_U32.T := Packed_U32.Serialization.From_Byte_Array ([255, 255, 255, 255]); -- nan Nan_Var : constant Var_Record.T := (Id => Nan.Value, Var_Type => In_Sequence, Pad => 0); Nan_Fetch : constant Fetch_Var_Record.T := (Opcode => 8, Pad1 => 0, Pad2 => 0, Pad3 => 0, Var_Info => Nan_Var); Instructionnan : constant Basic_Types.Byte_Array := Fetch_Var_Record.Serialization.To_Byte_Array (Nan_Fetch); @@ -2022,7 +2022,7 @@ package body Seq_Tests.Implementation is -- A test for the Cmd Str Alloc instruction. This is essentially a noop for Adamant, and is tested as such. overriding procedure Cmd_Str_Alloc (Self : in out Instance) is - Doesnt_Matter : constant Basic_Types.Byte_Array := (0, 0, 0, 0); + Doesnt_Matter : constant Basic_Types.Byte_Array := [0, 0, 0, 0]; begin -- This is just a noop. Adamant does not implement allocation Seq_Position_Assert.Eq (Seq_Runtime.Tester.Call_Str_Alloc (Self.Wb_Runner, Doesnt_Matter), 4); diff --git a/src/components/command_sequencer/test/command_sequencer_tests-implementation.adb b/src/components/command_sequencer/test/command_sequencer_tests-implementation.adb index 95181a77..28405e30 100644 --- a/src/components/command_sequencer/test/command_sequencer_tests-implementation.adb +++ b/src/components/command_sequencer/test/command_sequencer_tests-implementation.adb @@ -74,7 +74,7 @@ package body Command_Sequencer_Tests.Implementation is Id => 59, Arg_Buffer_Length => Unit_Test_Sequence_Load_Type.Size_In_Bytes ), - Arg_Buffer => (others => 0) + Arg_Buffer => [others => 0] ); begin -- Serialize the data into the buffer: @@ -1976,7 +1976,7 @@ package body Command_Sequencer_Tests.Implementation is Natural_Assert.Eq (T.Invalid_Sequence_Length_History.Get_Count, 2); Sequence_Length_Error_Assert.Eq (T.Invalid_Sequence_Length_History.Get (2), ( Load => (Engine_Request => Specific_Engine, Engine_Id => 0, Sequence_Region => Sequence_Region), - Header => ((0, 0), 0, 0, 0, 0) -- Header cannot be extracted, too small, so zeros. + Header => ([0, 0], 0, 0, 0, 0) -- Header cannot be extracted, too small, so zeros. )); -- Make the length field in header smaller than a sequence header; @@ -2004,7 +2004,7 @@ package body Command_Sequencer_Tests.Implementation is -- Make the CRC bad. Header.Length := Sequence_Size; - Header.Crc := (1, 1); + Header.Crc := [1, 1]; -- Load a simple sequence: T.Sequence_Load_T_Send ((Engine_Request => Specific_Engine, Engine_Id => 0, Sequence_Region => Sequence_Region)); @@ -2635,7 +2635,7 @@ package body Command_Sequencer_Tests.Implementation is overriding procedure Test_Issue_Details_Packet (Self : in out Instance) is T : Component.Command_Sequencer.Implementation.Tester.Instance_Access renames Self.Tester; - Buffer : Packet_Types.Packet_Buffer_Type := (others => 0); + Buffer : Packet_Types.Packet_Buffer_Type := [others => 0]; begin -- Send the command to issue the details. T.Command_T_Send (T.Commands.Issue_Details_Packet ((Engine_Id => 0))); @@ -2667,7 +2667,7 @@ package body Command_Sequencer_Tests.Implementation is )) & Sequence_Details_Type.Serialization.To_Byte_Array (( Header => ( - Crc => (0, 0), + Crc => [0, 0], Version => 0, Category => 0, Id => 0, @@ -2681,7 +2681,7 @@ package body Command_Sequencer_Tests.Implementation is )) & Sequence_Details_Type.Serialization.To_Byte_Array (( Header => ( - Crc => (0, 0), + Crc => [0, 0], Version => 0, Category => 0, Id => 0, @@ -2695,7 +2695,7 @@ package body Command_Sequencer_Tests.Implementation is )) & Sequence_Details_Type.Serialization.To_Byte_Array (( Header => ( - Crc => (0, 0), + Crc => [0, 0], Version => 0, Category => 0, Id => 0, @@ -2841,7 +2841,7 @@ package body Command_Sequencer_Tests.Implementation is )) & Sequence_Details_Type.Serialization.To_Byte_Array (( Header => ( - Crc => (0, 0), + Crc => [0, 0], Version => 0, Category => 0, Id => 0, @@ -2921,7 +2921,7 @@ package body Command_Sequencer_Tests.Implementation is overriding procedure Test_Set_Summary_Packet_Period (Self : in out Instance) is T : Component.Command_Sequencer.Implementation.Tester.Instance_Access renames Self.Tester; - Buffer : Packet_Types.Packet_Buffer_Type := (others => 0); + Buffer : Packet_Types.Packet_Buffer_Type := [others => 0]; begin -- Only setup data products: Natural_Assert.Eq (T.Data_Product_T_Recv_Sync_History.Get_Count, 1); @@ -3136,7 +3136,7 @@ package body Command_Sequencer_Tests.Implementation is -- Make sure some events were thrown: Natural_Assert.Eq (T.Event_T_Recv_Sync_History.Get_Count, 1); Natural_Assert.Eq (T.Invalid_Command_Received_History.Get_Count, 1); - Invalid_Command_Info_Assert.Eq (T.Invalid_Command_Received_History.Get (1), (Id => T.Commands.Get_Set_Summary_Packet_Period_Id, Errant_Field_Number => Interfaces.Unsigned_32'Last, Errant_Field => (0, 0, 0, 0, 0, 0, 0, 0))); + Invalid_Command_Info_Assert.Eq (T.Invalid_Command_Received_History.Get (1), (Id => T.Commands.Get_Set_Summary_Packet_Period_Id, Errant_Field_Number => Interfaces.Unsigned_32'Last, Errant_Field => [0, 0, 0, 0, 0, 0, 0, 0])); end Test_Invalid_Command; overriding procedure Test_Queue_Overflow (Self : in out Instance) is @@ -3244,7 +3244,7 @@ package body Command_Sequencer_Tests.Implementation is Command_Assert.Eq (T.Command_T_Recv_Sync_History.Get (1), Component_A_Commands.Command_1); -- OK, now corrupt the sequence to that it errors internally. - Sequence_Buffer (12 .. 99999) := (others => 255); + Sequence_Buffer (12 .. 99999) := [others => 255]; -- Send the command response to the sequencer: T.Command_Response_T_Send ((Source_Id => 0, Registration_Id => 0, Command_Id => Component_A_Commands.Get_Command_1_Id, Status => Success)); @@ -3679,7 +3679,7 @@ package body Command_Sequencer_Tests.Implementation is Component_B_Commands : Test_Component_Commands.Instance; function Create_Print_String (Str : in String) return Seq_Print_Event_Record.Print_String_Type is - To_Return : Seq_Print_Event_Record.Print_String_Type := (others => 0); + To_Return : Seq_Print_Event_Record.Print_String_Type := [others => 0]; pragma Warnings (Off, "overlay changes scalar storage order"); Overlay : Basic_Types.Byte_Array (1 .. Str'Length) with Import, Convention => Ada, Address => Str'Address; pragma Warnings (On, "overlay changes scalar storage order"); diff --git a/src/components/command_sequencer/test/component-command_sequencer-implementation-tester.adb b/src/components/command_sequencer/test/component-command_sequencer-implementation-tester.adb index c83845ff..1cb8601b 100644 --- a/src/components/command_sequencer/test/component-command_sequencer-implementation-tester.adb +++ b/src/components/command_sequencer/test/component-command_sequencer-implementation-tester.adb @@ -177,7 +177,7 @@ package body Component.Command_Sequencer.Implementation.Tester is Id => Arg.Id, Buffer_Length => 0 ), - Buffer => (others => 0) + Buffer => [others => 0] ) ); begin diff --git a/src/components/cpu_monitor/component-cpu_monitor-implementation.adb b/src/components/cpu_monitor/component-cpu_monitor-implementation.adb index b720f824..560af2b5 100644 --- a/src/components/cpu_monitor/component-cpu_monitor-implementation.adb +++ b/src/components/cpu_monitor/component-cpu_monitor-implementation.adb @@ -24,7 +24,7 @@ package body Component.Cpu_Monitor.Implementation is -- packet_Period : Interfaces.Unsigned_16 - The period (in ticks) of how often to send out the cpu execution packet. A value of zero disable sending of the packet. -- overriding procedure Init - (Self : in out Instance; Task_List : in not null Task_Types.Task_Info_List_Access; Interrupt_List : in not null Interrupt_Types.Interrupt_Id_List_Access; Execution_Periods : in Execution_Periods_Type := (1, 6, 30); Packet_Period : in Interfaces.Unsigned_16 := 1) + (Self : in out Instance; Task_List : in not null Task_Types.Task_Info_List_Access; Interrupt_List : in not null Interrupt_Types.Interrupt_Id_List_Access; Execution_Periods : in Execution_Periods_Type := [1, 6, 30]; Packet_Period : in Interfaces.Unsigned_16 := 1) is use Task_Types; use Interrupt_Types; @@ -41,13 +41,13 @@ package body Component.Cpu_Monitor.Implementation is -- Allocate space on the heap to store the last measured CPU time for all of -- the tasks and interrupts. Self.Task_Cpu_Time_List := new Last_Cpu_Time_Array (Self.Tasks'Range); - Self.Task_Cpu_Time_List.all := (others => (others => Time_Of (0))); + Self.Task_Cpu_Time_List.all := [others => [others => Time_Of (0)]]; Self.Task_Up_Time_List := new Last_Time_Array (Self.Tasks'Range); - Self.Task_Up_Time_List.all := (others => (others => Current_Up_Time)); + Self.Task_Up_Time_List.all := [others => [others => Current_Up_Time]]; Self.Interrupt_Cpu_Time_List := new Last_Cpu_Time_Array (Self.Interrupts'Range); - Self.Interrupt_Cpu_Time_List.all := (others => (others => Time_Of (0))); + Self.Interrupt_Cpu_Time_List.all := [others => [others => Time_Of (0)]]; Self.Interrupt_Up_Time_List := new Last_Time_Array (Self.Interrupts'Range); - Self.Interrupt_Up_Time_List.all := (others => (others => Current_Up_Time)); + Self.Interrupt_Up_Time_List.all := [others => [others => Current_Up_Time]]; -- Set the packet length. Each data point for -- cpu usage is a percentage that is 1 byte large. We store 3 of these per @@ -59,7 +59,7 @@ package body Component.Cpu_Monitor.Implementation is Sequence_Count => 0, Buffer_Length => Self.Execution_Periods'Length * (Self.Task_Cpu_Time_List'Length + Self.Interrupt_Cpu_Time_List'Length) ), - Buffer => (others => 0) + Buffer => [others => 0] ); -- Calculate the max_Count. This is the rollover value for count. To make sure diff --git a/src/components/cpu_monitor/component-cpu_monitor-implementation.ads b/src/components/cpu_monitor/component-cpu_monitor-implementation.ads index 44df22fa..a5476b05 100644 --- a/src/components/cpu_monitor/component-cpu_monitor-implementation.ads +++ b/src/components/cpu_monitor/component-cpu_monitor-implementation.ads @@ -26,7 +26,7 @@ package Component.Cpu_Monitor.Implementation is -- execution_Periods : Execution_Periods_Type - The period (in ticks) that specify the duration of time that each CPU measurement is taken over. -- packet_Period : Interfaces.Unsigned_16 - The period (in ticks) of how often to send out the cpu execution packet. A value of zero disable sending of the packet. -- - overriding procedure Init (Self : in out Instance; Task_List : in not null Task_Types.Task_Info_List_Access; Interrupt_List : in not null Interrupt_Types.Interrupt_Id_List_Access; Execution_Periods : in Execution_Periods_Type := (1, 6, 30); Packet_Period : in Interfaces.Unsigned_16 := 1); + overriding procedure Init (Self : in out Instance; Task_List : in not null Task_Types.Task_Info_List_Access; Interrupt_List : in not null Interrupt_Types.Interrupt_Id_List_Access; Execution_Periods : in Execution_Periods_Type := [1, 6, 30]; Packet_Period : in Interfaces.Unsigned_16 := 1); private @@ -52,7 +52,7 @@ private Task_Cpu_Time_List : Last_Cpu_Time_Array_Access := null; Interrupt_Up_Time_List : Last_Time_Array_Access := null; Interrupt_Cpu_Time_List : Last_Cpu_Time_Array_Access := null; - Execution_Periods : Execution_Periods_Type := (1, 6, 30); + Execution_Periods : Execution_Periods_Type := [1, 6, 30]; Count : Natural := 0; Max_Count : Natural := 0; Packet_Counter : Protected_Unsigned_16_Counter.Counter; diff --git a/src/components/cpu_monitor/cpu_monitor.component.yaml b/src/components/cpu_monitor/cpu_monitor.component.yaml index 969cc872..0331abcd 100644 --- a/src/components/cpu_monitor/cpu_monitor.component.yaml +++ b/src/components/cpu_monitor/cpu_monitor.component.yaml @@ -23,7 +23,7 @@ init: type: Execution_Periods_Type description: The period (in ticks) that specify the duration of time that each CPU measurement is taken over. # If the primary tick is at 10 seconds this would produce a cpu time measured over 10s, 1 minute, and 5 minutes - default: "(1, 6, 30)" + default: "[1, 6, 30]" - name: packet_Period type: Interfaces.Unsigned_16 description: The period (in ticks) of how often to send out the cpu execution packet. A value of zero disable sending of the packet. diff --git a/src/components/cpu_monitor/test/cpu_monitor_tests-implementation.adb b/src/components/cpu_monitor/test/cpu_monitor_tests-implementation.adb index 0030a97d..46afe568 100644 --- a/src/components/cpu_monitor/test/cpu_monitor_tests-implementation.adb +++ b/src/components/cpu_monitor/test/cpu_monitor_tests-implementation.adb @@ -32,10 +32,10 @@ package body Cpu_Monitor_Tests.Implementation is Priority => 0, Stack_Address => System.Null_Address, Stack_Size => 0, Secondary_Stack_Address => System.Null_Address, Secondary_Stack_Size => 0, Secondary_Stack_Max_Usage => 0); -- List of task infos for all tasks: - Task_List : aliased Task_Types.Task_Info_List := (0 => Task_Info_1'Access, 1 => Task_Info_2'Access); + Task_List : aliased Task_Types.Task_Info_List := [0 => Task_Info_1'Access, 1 => Task_Info_2'Access]; -- List of all interrupts used in the system: - Interrupt_List : aliased Interrupt_Types.Interrupt_Id_List := (0 => Ada.Interrupts.Names.SIGUSR1, 1 => Ada.Interrupts.Names.SIGUSR2); + Interrupt_List : aliased Interrupt_Types.Interrupt_Id_List := [0 => Ada.Interrupts.Names.SIGUSR1, 1 => Ada.Interrupts.Names.SIGUSR2]; ------------------------------------------------------------------------- -- Fixtures: @@ -50,7 +50,7 @@ package body Cpu_Monitor_Tests.Implementation is Self.Tester.Connect; -- Call component init here. - Self.Tester.Component_Instance.Init (Task_List => Task_List'Access, Interrupt_List => Interrupt_List'Access, Execution_Periods => (1, 5, 10), Packet_Period => 1); + Self.Tester.Component_Instance.Init (Task_List => Task_List'Access, Interrupt_List => Interrupt_List'Access, Execution_Periods => [1, 5, 10], Packet_Period => 1); end Set_Up_Test; overriding procedure Tear_Down_Test (Self : in out Instance) is @@ -160,7 +160,7 @@ package body Cpu_Monitor_Tests.Implementation is Natural_Assert.Eq (T.Event_T_Recv_Sync_History.Get_Count, 1); Natural_Assert.Eq (T.Packet_Period_Set_History.Get_Count, 0); Natural_Assert.Eq (T.Invalid_Command_Received_History.Get_Count, 1); - Invalid_Command_Info_Assert.Eq (T.Invalid_Command_Received_History.Get (1), (Id => T.Commands.Get_Set_Packet_Period_Id, Errant_Field_Number => Interfaces.Unsigned_32'Last, Errant_Field => (0, 0, 0, 0, 0, 0, 0, 0))); + Invalid_Command_Info_Assert.Eq (T.Invalid_Command_Received_History.Get (1), (Id => T.Commands.Get_Set_Packet_Period_Id, Errant_Field_Number => Interfaces.Unsigned_32'Last, Errant_Field => [0, 0, 0, 0, 0, 0, 0, 0])); end Test_Invalid_Command; end Cpu_Monitor_Tests.Implementation; diff --git a/src/components/event_filter/component-event_filter-implementation.adb b/src/components/event_filter/component-event_filter-implementation.adb index 1c8914ec..f032dc08 100644 --- a/src/components/event_filter/component-event_filter-implementation.adb +++ b/src/components/event_filter/component-event_filter-implementation.adb @@ -87,7 +87,7 @@ package body Component.Event_Filter.Implementation is -- event_Id_End_Range : Event_Types.Event_Id - The event ID that ends the range of ids that the component will include for filtering of events. -- event_Filter_List : Event_Filter_Entry.Event_Id_List - A list of event IDs that are filtered by default -- - overriding procedure Init (Self : in out Instance; Event_Id_Start_Range : in Event_Types.Event_Id; Event_Id_End_Range : in Event_Types.Event_Id; Event_Filter_List : in Event_Filter_Entry.Event_Id_List := (1 .. 0 => 0)) is + overriding procedure Init (Self : in out Instance; Event_Id_Start_Range : in Event_Types.Event_Id; Event_Id_End_Range : in Event_Types.Event_Id; Event_Filter_List : in Event_Filter_Entry.Event_Id_List := [1 .. 0 => 0]) is Event_Entry_Array : Basic_Types.Byte_Array_Access; begin -- This is asserted in the package as well but added here for extra clarity diff --git a/src/components/event_filter/component-event_filter-implementation.ads b/src/components/event_filter/component-event_filter-implementation.ads index 8bdc4dfc..807b7734 100644 --- a/src/components/event_filter/component-event_filter-implementation.ads +++ b/src/components/event_filter/component-event_filter-implementation.ads @@ -24,7 +24,7 @@ package Component.Event_Filter.Implementation is -- event_Id_End_Range : Event_Types.Event_Id - The event ID that ends the range of ids that the component will include for filtering of events. -- event_Filter_List : Event_Filter_Entry.Event_Id_List - A list of event IDs that are filtered by default -- - overriding procedure Init (Self : in out Instance; Event_Id_Start_Range : in Event_Types.Event_Id; Event_Id_End_Range : in Event_Types.Event_Id; Event_Filter_List : in Event_Filter_Entry.Event_Id_List := (1 .. 0 => 0)); + overriding procedure Init (Self : in out Instance; Event_Id_Start_Range : in Event_Types.Event_Id; Event_Id_End_Range : in Event_Types.Event_Id; Event_Filter_List : in Event_Filter_Entry.Event_Id_List := [1 .. 0 => 0]); private diff --git a/src/components/event_filter/event_filter.component.yaml b/src/components/event_filter/event_filter.component.yaml index 7666d246..55823086 100644 --- a/src/components/event_filter/event_filter.component.yaml +++ b/src/components/event_filter/event_filter.component.yaml @@ -19,7 +19,7 @@ init: - name: event_Filter_List type: Event_Filter_Entry.Event_Id_List description: A list of event IDs that are filtered by default - default: "(1 .. 0 => 0)" + default: "[1 .. 0 => 0]" connectors: - description: This is the base tick for the component. Upon reception the component will record the number of events that have been filtered and send the state packet if it was requested. type: Tick.T diff --git a/src/components/event_filter/event_filter_entry/event_filter_entry.adb b/src/components/event_filter/event_filter_entry/event_filter_entry.adb index 9dc67b0b..c29c5f06 100644 --- a/src/components/event_filter/event_filter_entry/event_filter_entry.adb +++ b/src/components/event_filter/event_filter_entry/event_filter_entry.adb @@ -17,7 +17,7 @@ package body Event_Filter_Entry is Self.Events := new Basic_Types.Byte_Array (0 .. Num_Event_Bytes - 1); -- Init the array so that all events are enabled by default and the counts are set to 0. - Self.Events.all := (others => Event_Filter_Entry_Type.Serialization.To_Byte_Array (( + Self.Events.all := [others => Event_Filter_Entry_Type.Serialization.To_Byte_Array (( State_0 => Event_Filter_State.Unfiltered, State_1 => Event_Filter_State.Unfiltered, State_2 => Event_Filter_State.Unfiltered, @@ -26,7 +26,7 @@ package body Event_Filter_Entry is State_5 => Event_Filter_State.Unfiltered, State_6 => Event_Filter_State.Unfiltered, State_7 => Event_Filter_State.Unfiltered - )) (0)); + )) (0)]; -- Then disable the event based on our disable list for Event_Id_To_Filter of Event_Filter_List loop diff --git a/src/components/event_filter/event_filter_entry/test/event_filter_entry_tests-implementation.adb b/src/components/event_filter/event_filter_entry/test/event_filter_entry_tests-implementation.adb index a066bda3..8050c97a 100644 --- a/src/components/event_filter/event_filter_entry/test/event_filter_entry_tests-implementation.adb +++ b/src/components/event_filter/event_filter_entry/test/event_filter_entry_tests-implementation.adb @@ -45,7 +45,7 @@ package body Event_Filter_Entry_Tests.Implementation is begin Num_Events := (Natural (Stop_Id - Start_Id) + 8) / 8; Event_Array := new Basic_Types.Byte_Array (0 .. Num_Events - 1); - Event_Array.all := (others => Event_Filter_Entry_Type.Serialization.To_Byte_Array (( + Event_Array.all := [others => Event_Filter_Entry_Type.Serialization.To_Byte_Array (( State_0 => Event_Filter_State.Unfiltered, State_1 => Event_Filter_State.Unfiltered, State_2 => Event_Filter_State.Unfiltered, @@ -54,7 +54,7 @@ package body Event_Filter_Entry_Tests.Implementation is State_5 => Event_Filter_State.Unfiltered, State_6 => Event_Filter_State.Unfiltered, State_7 => Event_Filter_State.Unfiltered - )) (0)); + )) (0)]; for Event_Id_State_Change of Event_Filter_List loop declare Event_Id_In : constant Natural := Natural (Event_Id_State_Change - Start_Id) / 8; @@ -94,13 +94,13 @@ package body Event_Filter_Entry_Tests.Implementation is overriding procedure Test_Init_List (Self : in out Instance) is Ignore_Self : Instance renames Self; Event_Filter : Event_Filter_Entry.Instance; - Event_Start_List : constant Event_Id_List := (3, 4); - Event_Start_Empty_List : constant Event_Id_List := (1 .. 0 => 0); + Event_Start_List : constant Event_Id_List := [3, 4]; + Event_Start_Empty_List : constant Event_Id_List := [1 .. 0 => 0]; State_Return_Status : Filter_Status; -- Test setup for catching an invalid input range procedure Invalid_Init_Range is - Start_List : constant Event_Id_List := (2, 5); + Start_List : constant Event_Id_List := [2, 5]; begin Event_Filter.Init (Event_Id_Start => 7, Event_Id_Stop => 2, Event_Filter_List => Start_List); exception @@ -218,7 +218,7 @@ package body Event_Filter_Entry_Tests.Implementation is overriding procedure Test_Set_Event_State (Self : in out Instance) is Ignore_Self : Instance renames Self; Event_Filter : Event_Filter_Entry.Instance; - Event_Start_List : constant Event_Id_List := (3, 4); + Event_Start_List : constant Event_Id_List := [3, 4]; Entry_State : Event_Entry_Status; State_Filter_Status : Filter_Status; begin @@ -283,7 +283,7 @@ package body Event_Filter_Entry_Tests.Implementation is overriding procedure Test_Event_Filtered_Count (Self : in out Instance) is Ignore_Self : Instance renames Self; Event_Filter : Event_Filter_Entry.Instance; - Event_Start_List : constant Event_Id_List := (3, 5); + Event_Start_List : constant Event_Id_List := [3, 5]; State_Filter_Status : Filter_Status; Filter_Count : Interfaces.Unsigned_32; begin @@ -427,7 +427,7 @@ package body Event_Filter_Entry_Tests.Implementation is overriding procedure Test_Event_Unfiltered_Count (Self : in out Instance) is Ignore_Self : Instance renames Self; Event_Filter : Event_Filter_Entry.Instance; - Event_Start_List : constant Event_Id_List := (6, 7, 9, 10); + Event_Start_List : constant Event_Id_List := [6, 7, 9, 10]; State_Filter_Status : Filter_Status; Unfiltered_Count : Interfaces.Unsigned_32; begin @@ -574,7 +574,7 @@ package body Event_Filter_Entry_Tests.Implementation is Ignore_Self : Instance renames Self; use Event_Types; Event_Filter : Event_Filter_Entry.Instance; - Event_Start_List : constant Event_Id_List := (3, 5); + Event_Start_List : constant Event_Id_List := [3, 5]; Start_Id : Event_Id; Stop_Id : Event_Id; begin @@ -599,7 +599,7 @@ package body Event_Filter_Entry_Tests.Implementation is overriding procedure Test_Global_Enable_Switch (Self : in out Instance) is Ignore_Self : Instance renames Self; Event_Filter : Event_Filter_Entry.Instance; - Event_Start_List : constant Event_Id_List := (4, 7); + Event_Start_List : constant Event_Id_List := [4, 7]; Global_State : Global_Filter_State.E; State_Filter_Status : Filter_Status; begin @@ -635,8 +635,8 @@ package body Event_Filter_Entry_Tests.Implementation is use Event_Types; Event_Filter : Event_Filter_Entry.Instance; Entry_State : Event_Entry_Status; - Event_Start_List : constant Event_Id_List := (3, 5); - Event_End_List : constant Event_Id_List := (0, 3, 5, 10); + Event_Start_List : constant Event_Id_List := [3, 5]; + Event_End_List : constant Event_Id_List := [0, 3, 5, 10]; Start_Id : constant Event_Id := 0; Stop_Id : constant Event_Id := 10; Event_Array : Basic_Types.Byte_Array_Access := null; diff --git a/src/components/event_filter/test/event_filter_tests-implementation.adb b/src/components/event_filter/test/event_filter_tests-implementation.adb index 18622f88..af2b115b 100644 --- a/src/components/event_filter/test/event_filter_tests-implementation.adb +++ b/src/components/event_filter/test/event_filter_tests-implementation.adb @@ -58,7 +58,7 @@ package body Event_Filter_Tests.Implementation is overriding procedure Test_Received_Event (Self : in out Instance) is T : Component.Event_Filter.Implementation.Tester.Instance_Access renames Self.Tester; - Event_Filter_Init_List : constant Event_Id_List := (3, 6); + Event_Filter_Init_List : constant Event_Id_List := [3, 6]; Incoming_Event : Event.T; begin Put_Line (""); @@ -124,7 +124,7 @@ package body Event_Filter_Tests.Implementation is overriding procedure Test_Data_Products (Self : in out Instance) is T : Component.Event_Filter.Implementation.Tester.Instance_Access renames Self.Tester; - Event_Filter_Init_List : constant Event_Id_List := (2, 5); + Event_Filter_Init_List : constant Event_Id_List := [2, 5]; Incoming_Event : Event.T; Input_Tick : constant Tick.T := ((0, 0), 0); begin @@ -237,7 +237,7 @@ package body Event_Filter_Tests.Implementation is overriding procedure Test_Issue_State_Packet (Self : in out Instance) is T : Component.Event_Filter.Implementation.Tester.Instance_Access renames Self.Tester; - Event_Filter_Init_List : constant Event_Id_List := (2, 5, 9, 16, 20); + Event_Filter_Init_List : constant Event_Id_List := [2, 5, 9, 16, 20]; Input_Tick : constant Tick.T := ((0, 0), 0); begin Put_Line (""); @@ -262,7 +262,7 @@ package body Event_Filter_Tests.Implementation is T.Tick_T_Send (Input_Tick); Natural_Assert.Eq (T.Event_Filter_State_Packet_History.Get_Count, 1); - Packet_Assert.Eq (T.Event_Filter_State_Packet_History.Get (1), (Header => (Time => (0, 0), Id => T.Packets.Get_Event_Filter_State_Packet_Id, Sequence_Count => 0, Buffer_Length => 3), Buffer => (0 => 36, 1 => 64, 2 => 136, others => 0))); + Packet_Assert.Eq (T.Event_Filter_State_Packet_History.Get (1), (Header => (Time => (0, 0), Id => T.Packets.Get_Event_Filter_State_Packet_Id, Sequence_Count => 0, Buffer_Length => 3), Buffer => [0 => 36, 1 => 64, 2 => 136, others => 0])); -- Now change some of the states and issue the packet again T.Command_T_Send (T.Commands.Filter_Event ((Event_To_Update => (Id => 4), Issue_State_Packet => Issue_Packet_Type.No_Issue))); @@ -298,7 +298,7 @@ package body Event_Filter_Tests.Implementation is T.Tick_T_Send (Input_Tick); Natural_Assert.Eq (T.Event_Filter_State_Packet_History.Get_Count, 2); - Packet_Assert.Eq (T.Event_Filter_State_Packet_History.Get (2), (Header => (Time => (0, 0), Id => T.Packets.Get_Event_Filter_State_Packet_Id, Sequence_Count => 1, Buffer_Length => 3), Buffer => (0 => 16#2C#, 1 => 16#68#, 2 => 16#88#, others => 0))); + Packet_Assert.Eq (T.Event_Filter_State_Packet_History.Get (2), (Header => (Time => (0, 0), Id => T.Packets.Get_Event_Filter_State_Packet_Id, Sequence_Count => 1, Buffer_Length => 3), Buffer => [0 => 16#2C#, 1 => 16#68#, 2 => 16#88#, others => 0])); -- Now unfilter a range and check the packet one more time. Issue the packet with the command for this one. T.Command_T_Send (T.Commands.Unfilter_Event_Range ((Start_Event_Id => (Id => 2), Stop_Event_Id => (Id => 12), Issue_State_Packet => Issue_Packet_Type.Issue))); @@ -314,13 +314,13 @@ package body Event_Filter_Tests.Implementation is T.Tick_T_Send (Input_Tick); Natural_Assert.Eq (T.Event_Filter_State_Packet_History.Get_Count, 3); - Packet_Assert.Eq (T.Event_Filter_State_Packet_History.Get (3), (Header => (Time => (0, 0), Id => T.Packets.Get_Event_Filter_State_Packet_Id, Sequence_Count => 2, Buffer_Length => 3), Buffer => (0 => 0, 1 => 0, 2 => 16#88#, others => 0))); + Packet_Assert.Eq (T.Event_Filter_State_Packet_History.Get (3), (Header => (Time => (0, 0), Id => T.Packets.Get_Event_Filter_State_Packet_Id, Sequence_Count => 2, Buffer_Length => 3), Buffer => [0 => 0, 1 => 0, 2 => 16#88#, others => 0])); end Test_Issue_State_Packet; overriding procedure Test_Command_Single_State_Change (Self : in out Instance) is T : Component.Event_Filter.Implementation.Tester.Instance_Access renames Self.Tester; - Event_Filter_Init_List : constant Event_Id_List := (5, 8); + Event_Filter_Init_List : constant Event_Id_List := [5, 8]; Incoming_Event : Event.T; Input_Tick : constant Tick.T := ((0, 0), 0); begin @@ -362,7 +362,7 @@ package body Event_Filter_Tests.Implementation is -- Issue the packet through a tick T.Tick_T_Send (Input_Tick); Natural_Assert.Eq (T.Event_Filter_State_Packet_History.Get_Count, 1); - Packet_Assert.Eq (T.Event_Filter_State_Packet_History.Get (1), (Header => (Time => (0, 0), Id => T.Packets.Get_Event_Filter_State_Packet_Id, Sequence_Count => 0, Buffer_Length => 2), Buffer => (0 => 228, others => 0))); + Packet_Assert.Eq (T.Event_Filter_State_Packet_History.Get (1), (Header => (Time => (0, 0), Id => T.Packets.Get_Event_Filter_State_Packet_Id, Sequence_Count => 0, Buffer_Length => 2), Buffer => [0 => 228, others => 0])); -- Enable event filtering for a range of the events that are not filtered right now T.Command_T_Send (T.Commands.Unfilter_Event ((Event_To_Update => (Id => 4), Issue_State_Packet => Issue_Packet_Type.No_Issue))); @@ -392,7 +392,7 @@ package body Event_Filter_Tests.Implementation is -- Issue the packet through a tick T.Tick_T_Send (Input_Tick); Natural_Assert.Eq (T.Event_Filter_State_Packet_History.Get_Count, 2); - Packet_Assert.Eq (T.Event_Filter_State_Packet_History.Get (2), (Header => (Time => (0, 0), Id => T.Packets.Get_Event_Filter_State_Packet_Id, Sequence_Count => 1, Buffer_Length => 2), Buffer => (0 => 36, others => 0))); + Packet_Assert.Eq (T.Event_Filter_State_Packet_History.Get (2), (Header => (Time => (0, 0), Id => T.Packets.Get_Event_Filter_State_Packet_Id, Sequence_Count => 1, Buffer_Length => 2), Buffer => [0 => 36, others => 0])); -- Finally send invalid events T.Command_T_Send (T.Commands.Filter_Event ((Event_To_Update => (Id => 2), Issue_State_Packet => Issue_Packet_Type.No_Issue))); @@ -413,7 +413,7 @@ package body Event_Filter_Tests.Implementation is overriding procedure Test_Command_Range_State_Change (Self : in out Instance) is T : Component.Event_Filter.Implementation.Tester.Instance_Access renames Self.Tester; - Event_Filter_Init_List : constant Event_Id_List := (1, 9); + Event_Filter_Init_List : constant Event_Id_List := [1, 9]; Incoming_Event : Event.T; Input_Tick : constant Tick.T := ((0, 0), 0); begin @@ -540,7 +540,7 @@ package body Event_Filter_Tests.Implementation is -- Issue the packet through a tick T.Tick_T_Send (Input_Tick); Natural_Assert.Eq (T.Event_Filter_State_Packet_History.Get_Count, 1); - Packet_Assert.Eq (T.Event_Filter_State_Packet_History.Get (1), (Header => (Time => (0, 0), Id => T.Packets.Get_Event_Filter_State_Packet_Id, Sequence_Count => 0, Buffer_Length => 2), Buffer => (0 => 158, 1 => 128, others => 0))); + Packet_Assert.Eq (T.Event_Filter_State_Packet_History.Get (1), (Header => (Time => (0, 0), Id => T.Packets.Get_Event_Filter_State_Packet_Id, Sequence_Count => 0, Buffer_Length => 2), Buffer => [0 => 158, 1 => 128, others => 0])); -- Back to the start with a packet issue this time T.Command_T_Send (T.Commands.Unfilter_Event_Range ((Start_Event_Id => (Id => 4), Stop_Event_Id => (Id => 7), Issue_State_Packet => Issue_Packet_Type.Issue))); @@ -553,7 +553,7 @@ package body Event_Filter_Tests.Implementation is T.Tick_T_Send (Input_Tick); Natural_Assert.Eq (T.Event_Filter_State_Packet_History.Get_Count, 2); - Packet_Assert.Eq (T.Event_Filter_State_Packet_History.Get (2), (Header => (Time => (0, 0), Id => T.Packets.Get_Event_Filter_State_Packet_Id, Sequence_Count => 1, Buffer_Length => 2), Buffer => (0 => 128, 1 => 128, others => 0))); + Packet_Assert.Eq (T.Event_Filter_State_Packet_History.Get (2), (Header => (Time => (0, 0), Id => T.Packets.Get_Event_Filter_State_Packet_Id, Sequence_Count => 1, Buffer_Length => 2), Buffer => [0 => 128, 1 => 128, others => 0])); -- Finally give some invalid ranges for both commands. T.Command_T_Send (T.Commands.Filter_Event_Range ((Start_Event_Id => (Id => 0), Stop_Event_Id => (Id => 7), Issue_State_Packet => Issue_Packet_Type.Issue))); @@ -603,7 +603,7 @@ package body Event_Filter_Tests.Implementation is overriding procedure Test_Command_Component_State_Change (Self : in out Instance) is T : Component.Event_Filter.Implementation.Tester.Instance_Access renames Self.Tester; - Event_Filter_Init_List : constant Event_Id_List := (4, 9); + Event_Filter_Init_List : constant Event_Id_List := [4, 9]; Incoming_Event : Event.T; begin Put_Line (""); @@ -734,7 +734,7 @@ package body Event_Filter_Tests.Implementation is -- Make sure some events were thrown: Natural_Assert.Eq (T.Event_T_Recv_Sync_History.Get_Count, 1); Natural_Assert.Eq (T.Invalid_Command_Received_History.Get_Count, 1); - Invalid_Command_Info_Assert.Eq (T.Invalid_Command_Received_History.Get (1), (Id => T.Commands.Get_Unfilter_Event_Id, Errant_Field_Number => Interfaces.Unsigned_32'Last, Errant_Field => (0, 0, 0, 0, 0, 0, 0, 0))); + Invalid_Command_Info_Assert.Eq (T.Invalid_Command_Received_History.Get (1), (Id => T.Commands.Get_Unfilter_Event_Id, Errant_Field_Number => Interfaces.Unsigned_32'Last, Errant_Field => [0, 0, 0, 0, 0, 0, 0, 0])); end Test_Invalid_Command; end Event_Filter_Tests.Implementation; diff --git a/src/components/event_limiter/component-event_limiter-implementation.adb b/src/components/event_limiter/component-event_limiter-implementation.adb index a067dc24..afeda614 100644 --- a/src/components/event_limiter/component-event_limiter-implementation.adb +++ b/src/components/event_limiter/component-event_limiter-implementation.adb @@ -105,7 +105,7 @@ package body Component.Event_Limiter.Implementation is -- event_Limit_Persistence : Two_Counter_Entry.Persistence_Type - The initial persistence of the number of events to allow before limiting them between ticks (1 to 7) -- overriding procedure Init - (Self : in out Instance; Event_Id_Start : in Event_Types.Event_Id; Event_Id_Stop : in Event_Types.Event_Id; Event_Disable_List : in Two_Counter_Entry.Event_Id_List := (1 .. 0 => 0); Event_Limit_Persistence : in Two_Counter_Entry.Persistence_Type) + (Self : in out Instance; Event_Id_Start : in Event_Types.Event_Id; Event_Id_Stop : in Event_Types.Event_Id; Event_Disable_List : in Two_Counter_Entry.Event_Id_List := [1 .. 0 => 0]; Event_Limit_Persistence : in Two_Counter_Entry.Persistence_Type) is begin Self.Event_Array.Init (Event_Id_Start, Event_Id_Stop, Event_Disable_List, Event_Limit_Persistence); @@ -135,7 +135,7 @@ package body Component.Event_Limiter.Implementation is Send_Packet : constant Boolean := Self.Send_Event_State_Packet.Get_Var; Component_State : constant Event_State_Type.E := Self.Event_Array.Get_Master_Enable_State; -- Event to indicate the number of events limited and a set of ID's - Num_Event_Limited_Event : Event_Limiter_Num_Events_Type.T := (Num_Event_Ids => 0, Num_Events_Limited => 0, Event_Id_Limited_Array => (others => 0)); + Num_Event_Limited_Event : Event_Limiter_Num_Events_Type.T := (Num_Event_Ids => 0, Num_Events_Limited => 0, Event_Id_Limited_Array => [others => 0]); Id_Stop : Event_Types.Event_Id; Id_Start : constant Event_Types.Event_Id := Self.Event_Array.Get_Event_Start_Stop_Range (Id_Stop); begin @@ -166,7 +166,7 @@ package body Component.Event_Limiter.Implementation is use Serializer_Types; use Packet; -- Byte array for the packet - Event_State_Array : Basic_Types.Byte_Array (0 .. Self.State_Packet_Size - 1) := (others => 16#FF#); + Event_State_Array : Basic_Types.Byte_Array (0 .. Self.State_Packet_Size - 1) := [others => 16#FF#]; State_Packet : Packet.T; State_Packet_Status : Serialization_Status; Byte_Num : Natural := 0; diff --git a/src/components/event_limiter/component-event_limiter-implementation.ads b/src/components/event_limiter/component-event_limiter-implementation.ads index 75a1425d..0772d02b 100644 --- a/src/components/event_limiter/component-event_limiter-implementation.ads +++ b/src/components/event_limiter/component-event_limiter-implementation.ads @@ -27,7 +27,7 @@ package Component.Event_Limiter.Implementation is -- event_Limit_Persistence : Two_Counter_Entry.Persistence_Type - The initial persistence of the number of events to allow before limiting them between ticks (1 to 7) -- overriding procedure Init - (Self : in out Instance; Event_Id_Start : in Event_Types.Event_Id; Event_Id_Stop : in Event_Types.Event_Id; Event_Disable_List : in Two_Counter_Entry.Event_Id_List := (1 .. 0 => 0); Event_Limit_Persistence : in Two_Counter_Entry.Persistence_Type); + (Self : in out Instance; Event_Id_Start : in Event_Types.Event_Id; Event_Id_Stop : in Event_Types.Event_Id; Event_Disable_List : in Two_Counter_Entry.Event_Id_List := [1 .. 0 => 0]; Event_Limit_Persistence : in Two_Counter_Entry.Persistence_Type); private diff --git a/src/components/event_limiter/event_limiter.component.yaml b/src/components/event_limiter/event_limiter.component.yaml index eaf858e9..14f691fd 100644 --- a/src/components/event_limiter/event_limiter.component.yaml +++ b/src/components/event_limiter/event_limiter.component.yaml @@ -22,7 +22,7 @@ init: - name: Event_Disable_List type: Two_Counter_Entry.Event_Id_List description: A list of event IDs that are enabled by default - default: "(1 .. 0 => 0)" + default: "[1 .. 0 => 0]" - name: Event_Limit_Persistence type: Two_Counter_Entry.Persistence_Type description: The initial persistence of the number of events to allow before limiting them between ticks (1 to 7) diff --git a/src/components/event_limiter/test/event_limiter_tests-implementation.adb b/src/components/event_limiter/test/event_limiter_tests-implementation.adb index 1e3bf09d..57329ff6 100644 --- a/src/components/event_limiter/test/event_limiter_tests-implementation.adb +++ b/src/components/event_limiter/test/event_limiter_tests-implementation.adb @@ -67,7 +67,7 @@ package body Event_Limiter_Tests.Implementation is -- One bit per a status so mod to find which bit in the byte it is Bit_Location := Bit_Num (Natural (Event_Num - Start_Id) mod 8); - Event_Bitmap := Event_Id_Limiter_State_Type.Serialization.From_Byte_Array ((0 => State_Packet.Buffer (Byte_Num))); + Event_Bitmap := Event_Id_Limiter_State_Type.Serialization.From_Byte_Array ([0 => State_Packet.Buffer (Byte_Num)]); case Bit_Location is when 0 => @@ -99,7 +99,7 @@ package body Event_Limiter_Tests.Implementation is -- One bit per a status so mod to find which bit in the byte it is Bit_Location := Bit_Num (Natural (Event_Num - Start_Id) mod 8); - Event_Bitmap := Event_Id_Limiter_State_Type.Serialization.From_Byte_Array ((0 => State_Packet.Buffer (Byte_Num))); + Event_Bitmap := Event_Id_Limiter_State_Type.Serialization.From_Byte_Array ([0 => State_Packet.Buffer (Byte_Num)]); case Bit_Location is when 0 => @@ -132,7 +132,7 @@ package body Event_Limiter_Tests.Implementation is T : Component.Event_Limiter.Implementation.Tester.Instance_Access renames Self.Tester; Incoming_Event : Event.T; Input_Tick : constant Tick.T := ((0, 0), 0); - Event_Start_List : constant Event_Id_List := (3, 6); + Event_Start_List : constant Event_Id_List := [3, 6]; begin Put_Line (""); Put_Line ("----------------------------------"); @@ -187,7 +187,7 @@ package body Event_Limiter_Tests.Implementation is Natural_Assert.Eq (T.Event_T_Recv_Sync_History.Get_Count, 1); Event_Assert.Eq (T.Event_T_Recv_Sync_History.Get (1), - (Header => (Time => (0, 0), Id => T.Events.Get_Events_Limited_Since_Last_Tick_Id, Param_Buffer_Length => 23), Param_Buffer => (0, 3, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0))); + (Header => (Time => (0, 0), Id => T.Events.Get_Events_Limited_Since_Last_Tick_Id, Param_Buffer_Length => 23), Param_Buffer => [0, 3, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0])); -- Now do it again at the top of the range T.Event_Forward_T_Recv_Sync_History.Clear; @@ -228,7 +228,7 @@ package body Event_Limiter_Tests.Implementation is Natural_Assert.Eq (T.Event_T_Recv_Sync_History.Get_Count, 2); Event_Assert.Eq (T.Event_T_Recv_Sync_History.Get (2), - (Header => (Time => (0, 0), Id => T.Events.Get_Events_Limited_Since_Last_Tick_Id, Param_Buffer_Length => 23), Param_Buffer => (0, 5, 1, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0))); + (Header => (Time => (0, 0), Id => T.Events.Get_Events_Limited_Since_Last_Tick_Id, Param_Buffer_Length => 23), Param_Buffer => [0, 5, 1, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0])); -- Now perform the operation on a disabled event. Should be no limiting and no data product with it T.Event_Forward_T_Recv_Sync_History.Clear; @@ -266,7 +266,7 @@ package body Event_Limiter_Tests.Implementation is overriding procedure Test_Decrement_Event_Count (Self : in out Instance) is T : Component.Event_Limiter.Implementation.Tester.Instance_Access renames Self.Tester; Input_Tick : constant Tick.T := ((0, 0), 0); - Event_Start_List : constant Event_Id_List := (2, 8); + Event_Start_List : constant Event_Id_List := [2, 8]; Incoming_Event : Event.T; begin Put_Line (""); @@ -396,7 +396,7 @@ package body Event_Limiter_Tests.Implementation is Natural_Assert.Eq (T.Events_Limited_Since_Last_Tick_History.Get_Count, 4); Event_Assert.Eq (T.Event_T_Recv_Sync_History.Get (1), - (Header => (Time => (0, 0), Id => T.Events.Get_Events_Limited_Since_Last_Tick_Id, Param_Buffer_Length => 23), Param_Buffer => (0, 6, 4, 0, 1, 0, 7, 0, 10, 0, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0))); + (Header => (Time => (0, 0), Id => T.Events.Get_Events_Limited_Since_Last_Tick_Id, Param_Buffer_Length => 23), Param_Buffer => [0, 6, 4, 0, 1, 0, 7, 0, 10, 0, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0])); -- Now test if there is an event being limited, that each tick there is one event that we get between each tick T.Event_Forward_T_Recv_Sync_History.Clear; @@ -423,7 +423,7 @@ package body Event_Limiter_Tests.Implementation is Natural_Assert.Eq (T.Events_Limited_Since_Last_Tick_History.Get_Count, 5); Event_Assert.Eq (T.Event_T_Recv_Sync_History.Get (2), - (Header => (Time => (0, 0), Id => T.Events.Get_Events_Limited_Since_Last_Tick_Id, Param_Buffer_Length => 23), Param_Buffer => (0, 1, 1, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0))); + (Header => (Time => (0, 0), Id => T.Events.Get_Events_Limited_Since_Last_Tick_Id, Param_Buffer_Length => 23), Param_Buffer => [0, 1, 1, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0])); -- Now make sure we get only one more event T.Event_T_Send (Incoming_Event); Natural_Assert.Eq (T.Event_Forward_T_Recv_Sync_History.Get_Count, 4); @@ -443,7 +443,7 @@ package body Event_Limiter_Tests.Implementation is Natural_Assert.Eq (T.Events_Limited_Since_Last_Tick_History.Get_Count, 6); Event_Assert.Eq (T.Event_T_Recv_Sync_History.Get (3), - (Header => (Time => (0, 0), Id => T.Events.Get_Events_Limited_Since_Last_Tick_Id, Param_Buffer_Length => 23), Param_Buffer => (0, 2, 1, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0))); + (Header => (Time => (0, 0), Id => T.Events.Get_Events_Limited_Since_Last_Tick_Id, Param_Buffer_Length => 23), Param_Buffer => [0, 2, 1, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0])); T.Event_T_Send (Incoming_Event); Natural_Assert.Eq (T.Event_Forward_T_Recv_Sync_History.Get_Count, 5); @@ -457,13 +457,13 @@ package body Event_Limiter_Tests.Implementation is overriding procedure Test_Issue_State_Packet (Self : in out Instance) is T : Component.Event_Limiter.Implementation.Tester.Instance_Access renames Self.Tester; Input_Tick : constant Tick.T := ((0, 0), 0); - Event_Start_List : constant Event_Id_List := (2, 4, 6, 8, 10); - Event_Final_Disable_Range_List : constant Event_Id_List := (2, 4, 6, 8, 10, 14, 15, 16); - Event_Final_Enable_Range_List : constant Event_Id_List := (0, 1, 3, 5, 7, 9, 11, 12, 13); - Event_Disable_List_2 : constant Event_Id_List := (2, 4, 6); - Event_Enable_List_2 : constant Event_Id_List := (0, 1, 3, 5, 7); - Event_Disable_List_3 : constant Event_Id_List := (5, 9, 13); - Event_Enable_List_3 : constant Event_Id_List := (6, 7, 8, 10, 11, 12); + Event_Start_List : constant Event_Id_List := [2, 4, 6, 8, 10]; + Event_Final_Disable_Range_List : constant Event_Id_List := [2, 4, 6, 8, 10, 14, 15, 16]; + Event_Final_Enable_Range_List : constant Event_Id_List := [0, 1, 3, 5, 7, 9, 11, 12, 13]; + Event_Disable_List_2 : constant Event_Id_List := [2, 4, 6]; + Event_Enable_List_2 : constant Event_Id_List := [0, 1, 3, 5, 7]; + Event_Disable_List_3 : constant Event_Id_List := [5, 9, 13]; + Event_Enable_List_3 : constant Event_Id_List := [6, 7, 8, 10, 11, 12]; -- Test starting the id at a non-zero value Start_Id : Event_Types.Event_Id := 0; begin @@ -522,8 +522,8 @@ package body Event_Limiter_Tests.Implementation is T : Component.Event_Limiter.Implementation.Tester.Instance_Access renames Self.Tester; Incoming_Event : Event.T; Input_Tick : constant Tick.T := ((0, 0), 0); - Event_Start_List : constant Event_Id_List := (3, 6); - Event_Empty_List : constant Event_Id_List := (1 .. 0 => 0); + Event_Start_List : constant Event_Id_List := [3, 6]; + Event_Empty_List : constant Event_Id_List := [1 .. 0 => 0]; Start_Id : constant Event_Types.Event_Id := 0; begin Put_Line (""); @@ -633,10 +633,10 @@ package body Event_Limiter_Tests.Implementation is T : Component.Event_Limiter.Implementation.Tester.Instance_Access renames Self.Tester; Incoming_Event : Event.T; Input_Tick : constant Tick.T := ((0, 0), 0); - Event_Start_List : constant Event_Id_List := (2, 8); - Event_Final_Disable_Range_List : constant Event_Id_List := (3, 4, 5, 6, 7); - Event_Final_Enable_Range_List : constant Event_Id_List := (3, 7); - Event_Empty_List : constant Event_Id_List := (1 .. 0 => 0); + Event_Start_List : constant Event_Id_List := [2, 8]; + Event_Final_Disable_Range_List : constant Event_Id_List := [3, 4, 5, 6, 7]; + Event_Final_Enable_Range_List : constant Event_Id_List := [3, 7]; + Event_Empty_List : constant Event_Id_List := [1 .. 0 => 0]; -- Test starting the id at a non-zero value Start_Id : constant Event_Types.Event_Id := 2; begin @@ -770,9 +770,9 @@ package body Event_Limiter_Tests.Implementation is T : Component.Event_Limiter.Implementation.Tester.Instance_Access renames Self.Tester; Incoming_Event : Event.T; Input_Tick : constant Tick.T := ((0, 0), 0); - Event_Start_List : constant Event_Id_List := (2, 5, 8, 10); - Event_Disabled_List : constant Event_Id_List := (2, 5, 8, 10, 12, 13, 14, 15, 16); - Event_Enabled_List : constant Event_Id_List := (1, 3, 4, 6, 7, 9, 11); + Event_Start_List : constant Event_Id_List := [2, 5, 8, 10]; + Event_Disabled_List : constant Event_Id_List := [2, 5, 8, 10, 12, 13, 14, 15, 16]; + Event_Enabled_List : constant Event_Id_List := [1, 3, 4, 6, 7, 9, 11]; Component_Enable_State : Two_Counter_Entry_Enums.Event_State_Type.E; -- Test starting the id at a non-zero value Start_Id : constant Event_Types.Event_Id := 1; @@ -1010,7 +1010,7 @@ package body Event_Limiter_Tests.Implementation is -- Make sure some events were thrown: Natural_Assert.Eq (T.Event_T_Recv_Sync_History.Get_Count, 1); Natural_Assert.Eq (T.Invalid_Command_Received_History.Get_Count, 1); - Invalid_Command_Info_Assert.Eq (T.Invalid_Command_Received_History.Get (1), (Id => T.Commands.Get_Disable_Event_Limit_Range_Id, Errant_Field_Number => Interfaces.Unsigned_32'Last, Errant_Field => (0, 0, 0, 0, 0, 0, 0, 0))); + Invalid_Command_Info_Assert.Eq (T.Invalid_Command_Received_History.Get (1), (Id => T.Commands.Get_Disable_Event_Limit_Range_Id, Errant_Field_Number => Interfaces.Unsigned_32'Last, Errant_Field => [0, 0, 0, 0, 0, 0, 0, 0])); end Test_Invalid_Command; end Event_Limiter_Tests.Implementation; diff --git a/src/components/event_limiter/two_counter_entry/test/two_counter_entry_tests-implementation.adb b/src/components/event_limiter/two_counter_entry/test/two_counter_entry_tests-implementation.adb index d298cd0d..5a1362e9 100644 --- a/src/components/event_limiter/two_counter_entry/test/two_counter_entry_tests-implementation.adb +++ b/src/components/event_limiter/two_counter_entry/test/two_counter_entry_tests-implementation.adb @@ -40,8 +40,8 @@ package body Two_Counter_Entry_Tests.Implementation is overriding procedure Test_Init_List (Self : in out Instance) is Ignore_Self : Instance renames Self; My_Counter : Two_Counter_Entry.Instance; - Event_Start_List : constant Two_Counter_Entry.Event_Id_List := (4, 5); - Event_Start_Empty_List : constant Two_Counter_Entry.Event_Id_List := (1 .. 0 => 0); + Event_Start_List : constant Two_Counter_Entry.Event_Id_List := [4, 5]; + Event_Start_Empty_List : constant Two_Counter_Entry.Event_Id_List := [1 .. 0 => 0]; Event_State : Event_State_Type.E; State_Return_Status : Two_Counter_Entry.Enable_State_Status; begin @@ -154,7 +154,7 @@ package body Two_Counter_Entry_Tests.Implementation is overriding procedure Test_Increment_Count (Self : in out Instance) is Ignore_Self : Instance renames Self; My_Counter : Two_Counter_Entry.Instance; - Event_Start_List : constant Two_Counter_Entry.Event_Id_List := (1, 2, 3); + Event_Start_List : constant Two_Counter_Entry.Event_Id_List := [1, 2, 3]; Return_Status : Two_Counter_Entry.Count_Status; Event_State : Event_State_Type.E; State_Return_Status : Two_Counter_Entry.Enable_State_Status; @@ -292,7 +292,7 @@ package body Two_Counter_Entry_Tests.Implementation is overriding procedure Test_Decrement_Count (Self : in out Instance) is Ignore_Self : Instance renames Self; My_Counter : Two_Counter_Entry.Instance; - Event_Start_List : constant Two_Counter_Entry.Event_Id_List := (7, 8); + Event_Start_List : constant Two_Counter_Entry.Event_Id_List := [7, 8]; Return_Status : Two_Counter_Entry.Count_Status; Event_State : Event_State_Type.E; State_Return_Status : Two_Counter_Entry.Enable_State_Status; @@ -509,7 +509,7 @@ package body Two_Counter_Entry_Tests.Implementation is overriding procedure Test_Set_Enable_State (Self : in out Instance) is Ignore_Self : Instance renames Self; My_Counter : Two_Counter_Entry.Instance; - Event_Start_List : constant Two_Counter_Entry.Event_Id_List := (3, 5); + Event_Start_List : constant Two_Counter_Entry.Event_Id_List := [3, 5]; State_Return_Status : Two_Counter_Entry.Enable_State_Status; Event_State : Event_State_Type.E; begin @@ -575,7 +575,7 @@ package body Two_Counter_Entry_Tests.Implementation is Event_State : Event_State_Type.E; Persistence : Two_Counter_Entry.Persistence_Type; State_Return_Status : Two_Counter_Entry.Enable_State_Status; - Event_Start_Empty_List : constant Two_Counter_Entry.Event_Id_List := (1 .. 0 => 0); + Event_Start_Empty_List : constant Two_Counter_Entry.Event_Id_List := [1 .. 0 => 0]; begin My_Counter.Init (Event_Id_Start => 0, Event_Id_Stop => 6, Event_Disable_List => Event_Start_Empty_List, Event_Limit_Persistence => 7); @@ -725,7 +725,7 @@ package body Two_Counter_Entry_Tests.Implementation is Ignore_Self : Instance renames Self; My_Counter : Two_Counter_Entry.Instance; Return_Status : Two_Counter_Entry.Count_Status; - Event_Start_Empty_List : constant Two_Counter_Entry.Event_Id_List := (1 .. 0 => 0); + Event_Start_Empty_List : constant Two_Counter_Entry.Event_Id_List := [1 .. 0 => 0]; Test_Limit_Count : Interfaces.Unsigned_16 := 0; begin My_Counter.Init (Event_Id_Start => 0, Event_Id_Stop => 6, Event_Disable_List => Event_Start_Empty_List, Event_Limit_Persistence => 2); @@ -793,7 +793,7 @@ package body Two_Counter_Entry_Tests.Implementation is Ignore_Self : Instance renames Self; use Event_Types; My_Counter : Two_Counter_Entry.Instance; - Event_Start_List : constant Two_Counter_Entry.Event_Id_List := (4, 5); + Event_Start_List : constant Two_Counter_Entry.Event_Id_List := [4, 5]; Start_Id : Event_Id; Stop_Id : Event_Id; begin @@ -818,7 +818,7 @@ package body Two_Counter_Entry_Tests.Implementation is overriding procedure Test_Master_Enable_Switch (Self : in out Instance) is Ignore_Self : Instance renames Self; My_Counter : Two_Counter_Entry.Instance; - Event_Start_List : constant Two_Counter_Entry.Event_Id_List := (4, 5); + Event_Start_List : constant Two_Counter_Entry.Event_Id_List := [4, 5]; Master_State : Event_State_Type.E; begin My_Counter.Init (Event_Id_Start => 0, Event_Id_Stop => 5, Event_Disable_List => Event_Start_List, Event_Limit_Persistence => 7); diff --git a/src/components/event_limiter/two_counter_entry/two_counter_entry.adb b/src/components/event_limiter/two_counter_entry/two_counter_entry.adb index d111e5d2..1fe666ca 100644 --- a/src/components/event_limiter/two_counter_entry/two_counter_entry.adb +++ b/src/components/event_limiter/two_counter_entry/two_counter_entry.adb @@ -18,7 +18,7 @@ package body Two_Counter_Entry is Self.Bytes := new Basic_Types.Byte_Array (0 .. Num_Event_Bytes - 1); -- Init the array so that all events are enabled by default and the counts are set to 0. - Self.Bytes.all := (others => Two_Counter_Entry_Type.Serialization.To_Byte_Array ((Top_Event_Enabled_State => Event_State_Type.Enabled, Top_Event_Count => 0, Bottom_Event_Enabled_State => Event_State_Type.Enabled, Bottom_Event_Count => 0)) (0)); + Self.Bytes.all := [others => Two_Counter_Entry_Type.Serialization.To_Byte_Array ((Top_Event_Enabled_State => Event_State_Type.Enabled, Top_Event_Count => 0, Bottom_Event_Enabled_State => Event_State_Type.Enabled, Bottom_Event_Count => 0)) (0)]; -- Then disable the event based on our disable list for Event_Id_To_Disable of Event_Disable_List loop diff --git a/src/components/event_packetizer/component-event_packetizer-implementation.adb b/src/components/event_packetizer/component-event_packetizer-implementation.adb index 5168e812..98544378 100644 --- a/src/components/event_packetizer/component-event_packetizer-implementation.adb +++ b/src/components/event_packetizer/component-event_packetizer-implementation.adb @@ -38,7 +38,7 @@ package body Component.Event_Packetizer.Implementation is -- Zero out the packet memory, and set the ids: for Idx in Packets'Range loop - Packets (Idx) := (Header => (Time => (0, 0), Id => 0, Sequence_Count => 0, Buffer_Length => 0), Buffer => (others => 0)); + Packets (Idx) := (Header => (Time => (0, 0), Id => 0, Sequence_Count => 0, Buffer_Length => 0), Buffer => [others => 0]); end loop; Initialized := True; diff --git a/src/components/event_packetizer/test/event_packetizer_tests-implementation.adb b/src/components/event_packetizer/test/event_packetizer_tests-implementation.adb index 27057fd3..c5a4b828 100644 --- a/src/components/event_packetizer/test/event_packetizer_tests-implementation.adb +++ b/src/components/event_packetizer/test/event_packetizer_tests-implementation.adb @@ -43,9 +43,9 @@ package body Event_Packetizer_Tests.Implementation is -- Global Event Definitions: ------------------------------------------------------------------------- - Event_1 : constant Event.T := (Header => ((1, 2), 1, 0), Param_Buffer => (others => 0)); -- Same size as event header, 14 bytes. - Event_2 : constant Event.T := (Header => ((1, 2), 2, 6), Param_Buffer => (0 => 1, 1 => 2, 2 => 3, 3 => 4, 4 => 5, 5 => 6, others => 0)); -- Event header + 6 bytes, 20 bytes. - Event_3 : constant Event.T := (Header => ((1, 2), 3, 3), Param_Buffer => (0 => 1, 1 => 2, 2 => 3, 3 => 4, 4 => 5, 5 .. 11 => 6, others => 0)); -- Event header + 3 bytes, 14 bytes. + Event_1 : constant Event.T := (Header => ((1, 2), 1, 0), Param_Buffer => [others => 0]); -- Same size as event header, 14 bytes. + Event_2 : constant Event.T := (Header => ((1, 2), 2, 6), Param_Buffer => [0 => 1, 1 => 2, 2 => 3, 3 => 4, 4 => 5, 5 => 6, others => 0]); -- Event header + 6 bytes, 20 bytes. + Event_3 : constant Event.T := (Header => ((1, 2), 3, 3), Param_Buffer => [0 => 1, 1 => 2, 2 => 3, 3 => 4, 4 => 5, 5 .. 11 => 6, others => 0]); -- Event header + 3 bytes, 14 bytes. ------------------------------------------------------------------------- -- Helper function: @@ -53,7 +53,7 @@ package body Event_Packetizer_Tests.Implementation is -- Function which extracts an event from the packet at the given index, and checks it against, -- the passed in event. The next unchecked index into the packet is returned. function Check_Event (The_Packet : in Packet.T; Evt : in Event.T; Current_Index : in Natural) return Natural is - Extracted_Event : Event.T := (((0, 0), 0, 0), (others => 0)); + Extracted_Event : Event.T := (((0, 0), 0, 0), [others => 0]); Param_Index : constant Natural := Current_Index + Event_Header.Serialization.Serialized_Length; Next_Index : Natural := Param_Index; begin diff --git a/src/components/fault_correction/component-fault_correction-implementation.adb b/src/components/fault_correction/component-fault_correction-implementation.adb index a5cde521..6d8d4636 100644 --- a/src/components/fault_correction/component-fault_correction-implementation.adb +++ b/src/components/fault_correction/component-fault_correction-implementation.adb @@ -252,7 +252,7 @@ package body Component.Fault_Correction.Implementation is -- data products as necessary. declare The_Time : constant Sys_Time.T := Self.Sys_Time_T_Get; - Param_Buffer : Fault_Types.Parameter_Buffer_Type := (others => 0); + Param_Buffer : Fault_Types.Parameter_Buffer_Type := [others => 0]; begin -- Copy over info from fault into statically sized fault type for serialization into info event: Param_Buffer (Param_Buffer'First .. Param_Buffer'First + Arg.Header.Param_Buffer_Length - 1) := diff --git a/src/components/fault_correction/test/fault_correction_tests-implementation.adb b/src/components/fault_correction/test/fault_correction_tests-implementation.adb index a31fee09..3b696353 100644 --- a/src/components/fault_correction/test/fault_correction_tests-implementation.adb +++ b/src/components/fault_correction/test/fault_correction_tests-implementation.adb @@ -59,9 +59,9 @@ package body Fault_Correction_Tests.Implementation is procedure Init_None is begin -- Empty list not ok. - Self.Tester.Component_Instance.Init (Fault_Response_Configurations => ( + Self.Tester.Component_Instance.Init (Fault_Response_Configurations => [ 1 .. 0 => Test_Assembly_Fault_Responses.Component_A_Fault_1_Response - )); + ]); -- Should never get here: Assert (False, "Init none did not produce exception!"); exception @@ -73,12 +73,12 @@ package body Fault_Correction_Tests.Implementation is procedure Init_Duplicate is begin -- Empty list not ok. - Self.Tester.Component_Instance.Init (Fault_Response_Configurations => ( + Self.Tester.Component_Instance.Init (Fault_Response_Configurations => [ 0 => Test_Assembly_Fault_Responses.Component_A_Fault_1_Response, 1 => Test_Assembly_Fault_Responses.Component_A_Fault_2_Response, 2 => Test_Assembly_Fault_Responses.Component_B_Fault_1_Response, 3 => Test_Assembly_Fault_Responses.Component_A_Fault_1_Response - )); + ]); -- Should never get here: Assert (False, "Init dupe dupe did not produce exception!"); exception @@ -90,9 +90,9 @@ package body Fault_Correction_Tests.Implementation is procedure Init_Too_Many is begin -- Empty list not ok. - Self.Tester.Component_Instance.Init (Fault_Response_Configurations => ( + Self.Tester.Component_Instance.Init (Fault_Response_Configurations => [ 0 .. 5000 => Test_Assembly_Fault_Responses.Component_A_Fault_1_Response - )); + ]); -- Should never get here: Assert (False, "Init dupe dupe did not produce exception!"); exception @@ -147,7 +147,7 @@ package body Fault_Correction_Tests.Implementation is T : Component.Fault_Correction.Implementation.Tester.Instance_Access renames Self.Tester; begin -- OK send the component a fault that is enabled: - T.Fault_T_Send ((((15, 12), Test_Assembly_Faults.Component_A_Fault_1, 0), (others => 55))); + T.Fault_T_Send ((((15, 12), Test_Assembly_Faults.Component_A_Fault_1, 0), [others => 55])); Natural_Assert.Eq (T.Dispatch_All, 1); -- Make sure response was sent out: @@ -163,7 +163,7 @@ package body Fault_Correction_Tests.Implementation is -- Make sure we get some events: Natural_Assert.Eq (T.Event_T_Recv_Sync_History.Get_Count, 2); Natural_Assert.Eq (T.Fault_Received_History.Get_Count, 1); - Fault_Static_Assert.Eq (T.Fault_Received_History.Get (1), (((15, 12), Test_Assembly_Faults.Component_A_Fault_1, 0), (others => 0))); + Fault_Static_Assert.Eq (T.Fault_Received_History.Get (1), (((15, 12), Test_Assembly_Faults.Component_A_Fault_1, 0), [others => 0])); Natural_Assert.Eq (T.Fault_Response_Sent_History.Get_Count, 1); Command_Header_Assert.Eq (T.Fault_Response_Sent_History.Get (1), ( Source_Id => 0, @@ -199,7 +199,7 @@ package body Fault_Correction_Tests.Implementation is ); -- OK send the component the same fault again: - T.Fault_T_Send ((((15, 12), Test_Assembly_Faults.Component_A_Fault_1, 0), (others => 55))); + T.Fault_T_Send ((((15, 12), Test_Assembly_Faults.Component_A_Fault_1, 0), [others => 55])); Natural_Assert.Eq (T.Dispatch_All, 1); -- Make sure response was sent out: @@ -210,7 +210,7 @@ package body Fault_Correction_Tests.Implementation is -- Make sure we get some events: Natural_Assert.Eq (T.Event_T_Recv_Sync_History.Get_Count, 4); Natural_Assert.Eq (T.Fault_Received_History.Get_Count, 2); - Fault_Static_Assert.Eq (T.Fault_Received_History.Get (2), (((15, 12), Test_Assembly_Faults.Component_A_Fault_1, 0), (others => 0))); + Fault_Static_Assert.Eq (T.Fault_Received_History.Get (2), (((15, 12), Test_Assembly_Faults.Component_A_Fault_1, 0), [others => 0])); Natural_Assert.Eq (T.Fault_Response_Sent_History.Get_Count, 2); Command_Header_Assert.Eq (T.Fault_Response_Sent_History.Get (2), Test_Assembly_Fault_Responses.Component_A_Fault_1_Response.Command_Response.Header); @@ -226,7 +226,7 @@ package body Fault_Correction_Tests.Implementation is Natural_Assert.Eq (T.Fault_Response_Statuses_History.Get_Count, 1); -- no change -- OK send the component a latching fault: - T.Fault_T_Send ((((16, 12), Test_Assembly_Faults.Component_A_Fault_2, 0), (others => 55))); + T.Fault_T_Send ((((16, 12), Test_Assembly_Faults.Component_A_Fault_2, 0), [others => 55])); Natural_Assert.Eq (T.Dispatch_All, 1); -- Make sure response was sent out: @@ -237,7 +237,7 @@ package body Fault_Correction_Tests.Implementation is -- Make sure we get some events: Natural_Assert.Eq (T.Event_T_Recv_Sync_History.Get_Count, 6); Natural_Assert.Eq (T.Fault_Received_History.Get_Count, 3); - Fault_Static_Assert.Eq (T.Fault_Received_History.Get (3), (((16, 12), Test_Assembly_Faults.Component_A_Fault_2, 0), (others => 0))); + Fault_Static_Assert.Eq (T.Fault_Received_History.Get (3), (((16, 12), Test_Assembly_Faults.Component_A_Fault_2, 0), [others => 0])); Natural_Assert.Eq (T.Fault_Response_Sent_History.Get_Count, 3); Command_Header_Assert.Eq (T.Fault_Response_Sent_History.Get (3), Test_Assembly_Fault_Responses.Component_A_Fault_2_Response.Command_Response.Header); @@ -268,7 +268,7 @@ package body Fault_Correction_Tests.Implementation is ); -- OK send the component same latching fault again: - T.Fault_T_Send ((((17, 12), Test_Assembly_Faults.Component_A_Fault_2, 1), (others => 55))); + T.Fault_T_Send ((((17, 12), Test_Assembly_Faults.Component_A_Fault_2, 1), [others => 55])); Natural_Assert.Eq (T.Dispatch_All, 1); -- Make sure response was sent out: @@ -277,7 +277,7 @@ package body Fault_Correction_Tests.Implementation is -- Make sure we get some events: Natural_Assert.Eq (T.Event_T_Recv_Sync_History.Get_Count, 7); Natural_Assert.Eq (T.Fault_Received_History.Get_Count, 4); - Fault_Static_Assert.Eq (T.Fault_Received_History.Get (4), (((17, 12), Test_Assembly_Faults.Component_A_Fault_2, 1), (0 => 55, others => 0))); + Fault_Static_Assert.Eq (T.Fault_Received_History.Get (4), (((17, 12), Test_Assembly_Faults.Component_A_Fault_2, 1), [0 => 55, others => 0])); Natural_Assert.Eq (T.Fault_Response_Sent_History.Get_Count, 3); -- No change, latched -- Make sure we get some data products: @@ -291,7 +291,7 @@ package body Fault_Correction_Tests.Implementation is Natural_Assert.Eq (T.Fault_Response_Statuses_History.Get_Count, 2); -- No change, latched -- OK send a disabled fault: - T.Fault_T_Send ((((17, 12), Test_Assembly_Faults.Component_B_Fault_1, 1), (others => 55))); + T.Fault_T_Send ((((17, 12), Test_Assembly_Faults.Component_B_Fault_1, 1), [others => 55])); Natural_Assert.Eq (T.Dispatch_All, 1); -- Make sure response was sent out: @@ -300,7 +300,7 @@ package body Fault_Correction_Tests.Implementation is -- Make sure we get some events: Natural_Assert.Eq (T.Event_T_Recv_Sync_History.Get_Count, 8); Natural_Assert.Eq (T.Fault_Received_History.Get_Count, 5); - Fault_Static_Assert.Eq (T.Fault_Received_History.Get (5), (((17, 12), Test_Assembly_Faults.Component_B_Fault_1, 1), (0 => 55, others => 0))); + Fault_Static_Assert.Eq (T.Fault_Received_History.Get (5), (((17, 12), Test_Assembly_Faults.Component_B_Fault_1, 1), [0 => 55, others => 0])); Natural_Assert.Eq (T.Fault_Response_Sent_History.Get_Count, 3); -- No change, disabled -- Make sure we get some data products: @@ -318,7 +318,7 @@ package body Fault_Correction_Tests.Implementation is T : Component.Fault_Correction.Implementation.Tester.Instance_Access renames Self.Tester; begin -- OK send a disabled fault: - T.Fault_T_Send ((((17, 12), Test_Assembly_Faults.Component_B_Fault_1, 1), (others => 55))); + T.Fault_T_Send ((((17, 12), Test_Assembly_Faults.Component_B_Fault_1, 1), [others => 55])); Natural_Assert.Eq (T.Dispatch_All, 1); -- Make sure response was sent out: @@ -327,7 +327,7 @@ package body Fault_Correction_Tests.Implementation is -- Make sure we get some events: Natural_Assert.Eq (T.Event_T_Recv_Sync_History.Get_Count, 1); Natural_Assert.Eq (T.Fault_Received_History.Get_Count, 1); - Fault_Static_Assert.Eq (T.Fault_Received_History.Get (1), (((17, 12), Test_Assembly_Faults.Component_B_Fault_1, 1), (0 => 55, others => 0))); + Fault_Static_Assert.Eq (T.Fault_Received_History.Get (1), (((17, 12), Test_Assembly_Faults.Component_B_Fault_1, 1), [0 => 55, others => 0])); Natural_Assert.Eq (T.Fault_Response_Sent_History.Get_Count, 0); -- No change, disabled -- Make sure we get some data products: @@ -371,7 +371,7 @@ package body Fault_Correction_Tests.Implementation is ); -- OK send fault again: - T.Fault_T_Send ((((17, 12), Test_Assembly_Faults.Component_B_Fault_1, 1), (others => 55))); + T.Fault_T_Send ((((17, 12), Test_Assembly_Faults.Component_B_Fault_1, 1), [others => 55])); Natural_Assert.Eq (T.Dispatch_All, 1); -- Make sure response was sent out: @@ -382,7 +382,7 @@ package body Fault_Correction_Tests.Implementation is -- Make sure we get some events: Natural_Assert.Eq (T.Event_T_Recv_Sync_History.Get_Count, 4); Natural_Assert.Eq (T.Fault_Received_History.Get_Count, 2); - Fault_Static_Assert.Eq (T.Fault_Received_History.Get (2), (((17, 12), Test_Assembly_Faults.Component_B_Fault_1, 1), (0 => 55, others => 0))); + Fault_Static_Assert.Eq (T.Fault_Received_History.Get (2), (((17, 12), Test_Assembly_Faults.Component_B_Fault_1, 1), [0 => 55, others => 0])); Natural_Assert.Eq (T.Fault_Response_Sent_History.Get_Count, 1); Command_Header_Assert.Eq (T.Fault_Response_Sent_History.Get (1), Test_Assembly_Fault_Responses.Component_B_Fault_1_Response.Command_Response.Header); @@ -443,7 +443,7 @@ package body Fault_Correction_Tests.Implementation is ); -- OK send fault again: - T.Fault_T_Send ((((17, 12), Test_Assembly_Faults.Component_B_Fault_1, 1), (others => 55))); + T.Fault_T_Send ((((17, 12), Test_Assembly_Faults.Component_B_Fault_1, 1), [others => 55])); Natural_Assert.Eq (T.Dispatch_All, 1); -- Make sure response was sent out: @@ -452,7 +452,7 @@ package body Fault_Correction_Tests.Implementation is -- Make sure we get some events: Natural_Assert.Eq (T.Event_T_Recv_Sync_History.Get_Count, 6); Natural_Assert.Eq (T.Fault_Received_History.Get_Count, 3); - Fault_Static_Assert.Eq (T.Fault_Received_History.Get (3), (((17, 12), Test_Assembly_Faults.Component_B_Fault_1, 1), (0 => 55, others => 0))); + Fault_Static_Assert.Eq (T.Fault_Received_History.Get (3), (((17, 12), Test_Assembly_Faults.Component_B_Fault_1, 1), [0 => 55, others => 0])); -- Make sure we get some data products: Natural_Assert.Eq (T.Data_Product_T_Recv_Sync_History.Get_Count, 12); @@ -499,9 +499,9 @@ package body Fault_Correction_Tests.Implementation is T : Component.Fault_Correction.Implementation.Tester.Instance_Access renames Self.Tester; begin -- OK send a few faults: - T.Fault_T_Send ((((15, 12), Test_Assembly_Faults.Component_A_Fault_1, 0), (others => 55))); - T.Fault_T_Send ((((16, 12), Test_Assembly_Faults.Component_A_Fault_2, 0), (others => 55))); - T.Fault_T_Send ((((16, 12), Test_Assembly_Faults.Component_B_Fault_3, 0), (others => 55))); + T.Fault_T_Send ((((15, 12), Test_Assembly_Faults.Component_A_Fault_1, 0), [others => 55])); + T.Fault_T_Send ((((16, 12), Test_Assembly_Faults.Component_A_Fault_2, 0), [others => 55])); + T.Fault_T_Send ((((16, 12), Test_Assembly_Faults.Component_B_Fault_3, 0), [others => 55])); Natural_Assert.Eq (T.Dispatch_All, 3); -- Check latest state data product: @@ -635,9 +635,9 @@ package body Fault_Correction_Tests.Implementation is ); -- Load up a few more faults: - T.Fault_T_Send ((((15, 12), Test_Assembly_Faults.Component_A_Fault_1, 0), (others => 55))); - T.Fault_T_Send ((((16, 12), Test_Assembly_Faults.Component_A_Fault_2, 0), (others => 55))); - T.Fault_T_Send ((((16, 12), Test_Assembly_Faults.Component_B_Fault_3, 0), (others => 55))); + T.Fault_T_Send ((((15, 12), Test_Assembly_Faults.Component_A_Fault_1, 0), [others => 55])); + T.Fault_T_Send ((((16, 12), Test_Assembly_Faults.Component_A_Fault_2, 0), [others => 55])); + T.Fault_T_Send ((((16, 12), Test_Assembly_Faults.Component_B_Fault_3, 0), [others => 55])); Natural_Assert.Eq (T.Dispatch_All, 3); -- Check latest state data product: @@ -745,7 +745,7 @@ package body Fault_Correction_Tests.Implementation is Packed_Fault_Id_Assert.Eq (T.Unrecognized_Fault_Id_History.Get (3), (Id => 99)); -- Send unrecognized fault: - T.Fault_T_Send ((((15, 12), 99, 0), (others => 55))); + T.Fault_T_Send ((((15, 12), 99, 0), [others => 55])); Natural_Assert.Eq (T.Dispatch_All, 1); -- Check events: @@ -775,7 +775,7 @@ package body Fault_Correction_Tests.Implementation is -- OK, let's try to send a fault: T.Expect_Fault_T_Send_Dropped := True; - T.Fault_T_Send ((((15, 12), 99, 0), (others => 55))); + T.Fault_T_Send ((((15, 12), 99, 0), [others => 55])); -- Make sure event thrown: Natural_Assert.Eq (T.Event_T_Recv_Sync_History.Get_Count, 2); @@ -799,7 +799,7 @@ package body Fault_Correction_Tests.Implementation is -- Make sure some events were thrown: Natural_Assert.Eq (T.Event_T_Recv_Sync_History.Get_Count, 1); Natural_Assert.Eq (T.Invalid_Command_Received_History.Get_Count, 1); - Invalid_Command_Info_Assert.Eq (T.Invalid_Command_Received_History.Get (1), (Id => T.Commands.Get_Disable_Fault_Response_Id, Errant_Field_Number => Interfaces.Unsigned_32'Last, Errant_Field => (0, 0, 0, 0, 0, 0, 0, 0))); + Invalid_Command_Info_Assert.Eq (T.Invalid_Command_Received_History.Get (1), (Id => T.Commands.Get_Disable_Fault_Response_Id, Errant_Field_Number => Interfaces.Unsigned_32'Last, Errant_Field => [0, 0, 0, 0, 0, 0, 0, 0])); end Test_Invalid_Command; end Fault_Correction_Tests.Implementation; diff --git a/src/components/forwarder/test/forwarder_tests-implementation.adb b/src/components/forwarder/test/forwarder_tests-implementation.adb index fe6c9aa2..97880cc7 100644 --- a/src/components/forwarder/test/forwarder_tests-implementation.adb +++ b/src/components/forwarder/test/forwarder_tests-implementation.adb @@ -140,7 +140,7 @@ package body Forwarder_Tests.Implementation is -- Make sure some events were thrown: Natural_Assert.Eq (T.Event_T_Recv_Sync_History.Get_Count, 1); Natural_Assert.Eq (T.Invalid_Command_Received_History.Get_Count, 1); - Invalid_Command_Info_Assert.Eq (T.Invalid_Command_Received_History.Get (1), (Id => T.Commands.Get_Enable_Forwarding_Id, Errant_Field_Number => Interfaces.Unsigned_32'Last, Errant_Field => (0, 0, 0, 0, 0, 0, 0, 1))); + Invalid_Command_Info_Assert.Eq (T.Invalid_Command_Received_History.Get (1), (Id => T.Commands.Get_Enable_Forwarding_Id, Errant_Field_Number => Interfaces.Unsigned_32'Last, Errant_Field => [0, 0, 0, 0, 0, 0, 0, 1])); end Test_Invalid_Command; end Forwarder_Tests.Implementation; diff --git a/src/components/last_chance_manager/component-last_chance_manager-implementation.adb b/src/components/last_chance_manager/component-last_chance_manager-implementation.adb index d97cd672..bebab2de 100644 --- a/src/components/last_chance_manager/component-last_chance_manager-implementation.adb +++ b/src/components/last_chance_manager/component-last_chance_manager-implementation.adb @@ -89,7 +89,7 @@ package body Component.Last_Chance_Manager.Implementation is The_Time : constant Sys_Time.T := Self.Sys_Time_T_Get; begin -- Clear all the data: - Self.Exception_Data.all := (Exception_Name => (others => 0), Exception_Message => (others => 0), Stack_Trace_Depth => 0, Stack_Trace => (others => (Address => To_Address (Integer_Address (0))))); + Self.Exception_Data.all := (Exception_Name => [others => 0], Exception_Message => [others => 0], Stack_Trace_Depth => 0, Stack_Trace => [others => (Address => To_Address (Integer_Address (0)))]); -- Send out our data: Self.Send_Out_Packet_And_Data_Product (The_Time); diff --git a/src/components/last_chance_manager/test/last_chance_manager_tests-implementation.adb b/src/components/last_chance_manager/test/last_chance_manager_tests-implementation.adb index 78ef84de..a3a6d995 100644 --- a/src/components/last_chance_manager/test/last_chance_manager_tests-implementation.adb +++ b/src/components/last_chance_manager/test/last_chance_manager_tests-implementation.adb @@ -18,10 +18,10 @@ package body Last_Chance_Manager_Tests.Implementation is -- Global data: ------------------------------------------------------------------------- Exception_Data : aliased Packed_Exception_Occurrence.T := ( - Exception_Name => (others => 0), - Exception_Message => (others => 0), + Exception_Name => [others => 0], + Exception_Message => [others => 0], Stack_Trace_Depth => 0, - Stack_Trace => (others => (Address => To_Address (Integer_Address (0)))) + Stack_Trace => [others => (Address => To_Address (Integer_Address (0)))] ); ------------------------------------------------------------------------- @@ -32,10 +32,10 @@ package body Last_Chance_Manager_Tests.Implementation is begin -- Reset data: Exception_Data := ( - Exception_Name => (others => 0), - Exception_Message => (others => 0), + Exception_Name => [others => 0], + Exception_Message => [others => 0], Stack_Trace_Depth => 0, - Stack_Trace => (others => (Address => To_Address (Integer_Address (0)))) + Stack_Trace => [others => (Address => To_Address (Integer_Address (0)))] ); -- Allocate heap memory to component: @@ -73,10 +73,10 @@ package body Last_Chance_Manager_Tests.Implementation is -- Check packet data: Packed_Exception_Occurrence_Assert.Eq (T.Lch_Memory_Region_Dump_History.Get (1), ( - Exception_Name => (others => 0), - Exception_Message => (others => 0), + Exception_Name => [others => 0], + Exception_Message => [others => 0], Stack_Trace_Depth => 0, - Stack_Trace => (others => (Address => To_Address (Integer_Address (0)))) + Stack_Trace => [others => (Address => To_Address (Integer_Address (0)))] )); -- Check data product data: @@ -99,17 +99,17 @@ package body Last_Chance_Manager_Tests.Implementation is -- Check packet data: Packed_Exception_Occurrence_Assert.Eq (T.Lch_Memory_Region_Dump_History.Get (2), ( - Exception_Name => (others => 0), - Exception_Message => (others => 0), + Exception_Name => [others => 0], + Exception_Message => [others => 0], Stack_Trace_Depth => 0, - Stack_Trace => (others => (Address => To_Address (Integer_Address (0)))) + Stack_Trace => [others => (Address => To_Address (Integer_Address (0)))] )); -- Check data product data: Packed_Stack_Trace_Info_Assert.Eq (T.Lch_Stack_Trace_Info_History.Get (2), (Stack_Trace_Depth => 0, Stack_Trace_Bottom_Address => (Address => To_Address (Integer_Address (0))))); -- OK now modify the region: - Exception_Data := (Exception_Name => (others => 44), Exception_Message => (others => 33), Stack_Trace_Depth => 0, Stack_Trace => (others => (Address => To_Address (Integer_Address (99))))); + Exception_Data := (Exception_Name => [others => 44], Exception_Message => [others => 33], Stack_Trace_Depth => 0, Stack_Trace => [others => (Address => To_Address (Integer_Address (99)))]); Exception_Data.Stack_Trace (0) := (Address => To_Address (Integer_Address (88))); -- set this to unique value to make sure it is seen in dp -- Ok now dump the region, and expect more packets and data products: @@ -131,17 +131,17 @@ package body Last_Chance_Manager_Tests.Implementation is -- Check packet data: Packed_Exception_Occurrence_Assert.Eq (T.Lch_Memory_Region_Dump_History.Get (3), ( - Exception_Name => (others => 44), - Exception_Message => (others => 33), + Exception_Name => [others => 44], + Exception_Message => [others => 33], Stack_Trace_Depth => 0, - Stack_Trace => (0 => (Address => To_Address (Integer_Address (88))), others => (Address => To_Address (Integer_Address (99)))) + Stack_Trace => [0 => (Address => To_Address (Integer_Address (88))), others => (Address => To_Address (Integer_Address (99)))] )); -- Check data product data: Packed_Stack_Trace_Info_Assert.Eq (T.Lch_Stack_Trace_Info_History.Get (3), (Stack_Trace_Depth => 0, Stack_Trace_Bottom_Address => (Address => To_Address (Integer_Address (88))))); -- OK now modify the region: - Exception_Data := (Exception_Name => (others => 44), Exception_Message => (others => 33), Stack_Trace_Depth => 16, Stack_Trace => (others => (Address => To_Address (Integer_Address (0))))); + Exception_Data := (Exception_Name => [others => 44], Exception_Message => [others => 33], Stack_Trace_Depth => 16, Stack_Trace => [others => (Address => To_Address (Integer_Address (0)))]); -- Ok now dump the region, and expect more packets and data products: T.Command_T_Send (T.Commands.Dump_Last_Chance_Handler_Region); @@ -162,10 +162,10 @@ package body Last_Chance_Manager_Tests.Implementation is -- Check packet data: Packed_Exception_Occurrence_Assert.Eq (T.Lch_Memory_Region_Dump_History.Get (4), ( - Exception_Name => (others => 44), - Exception_Message => (others => 33), + Exception_Name => [others => 44], + Exception_Message => [others => 33], Stack_Trace_Depth => 16, - Stack_Trace => (others => (Address => To_Address (Integer_Address (0)))) + Stack_Trace => [others => (Address => To_Address (Integer_Address (0)))] )); -- Check data product data: @@ -184,17 +184,17 @@ package body Last_Chance_Manager_Tests.Implementation is -- Check packet data: Packed_Exception_Occurrence_Assert.Eq (T.Lch_Memory_Region_Dump_History.Get (1), ( - Exception_Name => (others => 0), - Exception_Message => (others => 0), + Exception_Name => [others => 0], + Exception_Message => [others => 0], Stack_Trace_Depth => 0, - Stack_Trace => (others => (Address => To_Address (Integer_Address (0)))) + Stack_Trace => [others => (Address => To_Address (Integer_Address (0)))] )); -- Check data product data: Packed_Stack_Trace_Info_Assert.Eq (T.Lch_Stack_Trace_Info_History.Get (1), (Stack_Trace_Depth => 0, Stack_Trace_Bottom_Address => (Address => To_Address (Integer_Address (0))))); -- OK now modify the region: - Exception_Data := (Exception_Name => (others => 44), Exception_Message => (others => 33), Stack_Trace_Depth => 16, Stack_Trace => (others => (Address => To_Address (Integer_Address (99))))); + Exception_Data := (Exception_Name => [others => 44], Exception_Message => [others => 33], Stack_Trace_Depth => 16, Stack_Trace => [others => (Address => To_Address (Integer_Address (99)))]); -- Call Set_Up, make sure, correct stuff thrown with exception data in store. Self.Tester.Component_Instance.Set_Up; @@ -212,10 +212,10 @@ package body Last_Chance_Manager_Tests.Implementation is -- Check packet data: Packed_Exception_Occurrence_Assert.Eq (T.Lch_Memory_Region_Dump_History.Get (2), ( - Exception_Name => (others => 44), - Exception_Message => (others => 33), + Exception_Name => [others => 44], + Exception_Message => [others => 33], Stack_Trace_Depth => 16, - Stack_Trace => (others => (Address => To_Address (Integer_Address (99)))) + Stack_Trace => [others => (Address => To_Address (Integer_Address (99)))] )); -- Check data product data: @@ -232,10 +232,10 @@ package body Last_Chance_Manager_Tests.Implementation is -- Check stored data: Packed_Exception_Occurrence_Assert.Eq (Exception_Data, ( - Exception_Name => (others => 0), - Exception_Message => (others => 0), + Exception_Name => [others => 0], + Exception_Message => [others => 0], Stack_Trace_Depth => 0, - Stack_Trace => (others => (Address => To_Address (Integer_Address (0)))) + Stack_Trace => [others => (Address => To_Address (Integer_Address (0)))] )); -- Check packets and data products: @@ -246,10 +246,10 @@ package body Last_Chance_Manager_Tests.Implementation is -- Check packet data: Packed_Exception_Occurrence_Assert.Eq (T.Lch_Memory_Region_Dump_History.Get (3), ( - Exception_Name => (others => 0), - Exception_Message => (others => 0), + Exception_Name => [others => 0], + Exception_Message => [others => 0], Stack_Trace_Depth => 0, - Stack_Trace => (others => (Address => To_Address (Integer_Address (0)))) + Stack_Trace => [others => (Address => To_Address (Integer_Address (0)))] )); -- Check data product data: @@ -271,7 +271,7 @@ package body Last_Chance_Manager_Tests.Implementation is -- Make sure some events were thrown: Natural_Assert.Eq (T.Event_T_Recv_Sync_History.Get_Count, 1); Natural_Assert.Eq (T.Invalid_Command_Received_History.Get_Count, 1); - Invalid_Command_Info_Assert.Eq (T.Invalid_Command_Received_History.Get (1), (Id => T.Commands.Get_Dump_Last_Chance_Handler_Region_Id, Errant_Field_Number => Interfaces.Unsigned_32'Last, Errant_Field => (0, 0, 0, 0, 0, 0, 0, 1))); + Invalid_Command_Info_Assert.Eq (T.Invalid_Command_Received_History.Get (1), (Id => T.Commands.Get_Dump_Last_Chance_Handler_Region_Id, Errant_Field_Number => Interfaces.Unsigned_32'Last, Errant_Field => [0, 0, 0, 0, 0, 0, 0, 1])); end Test_Invalid_Command; end Last_Chance_Manager_Tests.Implementation; diff --git a/src/components/limiter/test/component-limiter-implementation-tester.adb b/src/components/limiter/test/component-limiter-implementation-tester.adb index d6491df3..86bcf93e 100644 --- a/src/components/limiter/test/component-limiter-implementation-tester.adb +++ b/src/components/limiter/test/component-limiter-implementation-tester.adb @@ -213,7 +213,7 @@ package body Component.Limiter.Implementation.Tester is not overriding function Fetch_Parameter (Self : in out Instance; Id : in Parameter_Types.Parameter_Id; Par : out Parameter.T) return Parameter_Update_Status.E is use Parameter_Enums.Parameter_Update_Status; use Parameter_Enums.Parameter_Operation_Type; - Param_Update : Parameter_Update.T := (Operation => Fetch, Status => Success, Param => (Header => (Id => Id, Buffer_Length => 0), Buffer => (others => 0))); + Param_Update : Parameter_Update.T := (Operation => Fetch, Status => Success, Param => (Header => (Id => Id, Buffer_Length => 0), Buffer => [others => 0])); begin -- Set the ID to fetch: Param_Update.Param.Header.Id := Id; @@ -225,7 +225,7 @@ package body Component.Limiter.Implementation.Tester is not overriding function Update_Parameters (Self : in out Instance) return Parameter_Update_Status.E is use Parameter_Enums.Parameter_Update_Status; use Parameter_Enums.Parameter_Operation_Type; - Param_Update : Parameter_Update.T := (Operation => Update, Status => Success, Param => ((0, 0), (others => 0))); + Param_Update : Parameter_Update.T := (Operation => Update, Status => Success, Param => ((0, 0), [others => 0])); begin Self.Parameter_Update_T_Provide (Param_Update); return Param_Update.Status; diff --git a/src/components/limiter/test/limiter_tests-implementation.adb b/src/components/limiter/test/limiter_tests-implementation.adb index 4e812c41..b700e375 100644 --- a/src/components/limiter/test/limiter_tests-implementation.adb +++ b/src/components/limiter/test/limiter_tests-implementation.adb @@ -314,7 +314,7 @@ package body Limiter_Tests.Implementation is -- Make sure some events were thrown: Natural_Assert.Eq (T.Event_T_Recv_Sync_History.Get_Count, 1); Natural_Assert.Eq (T.Invalid_Command_Received_History.Get_Count, 1); - Invalid_Command_Info_Assert.Eq (T.Invalid_Command_Received_History.Get (1), (Id => T.Commands.Get_Sends_Per_Tick_Id, Errant_Field_Number => Interfaces.Unsigned_32'Last, Errant_Field => (0, 0, 0, 0, 0, 0, 0, 0))); + Invalid_Command_Info_Assert.Eq (T.Invalid_Command_Received_History.Get (1), (Id => T.Commands.Get_Sends_Per_Tick_Id, Errant_Field_Number => Interfaces.Unsigned_32'Last, Errant_Field => [0, 0, 0, 0, 0, 0, 0, 0])); end Test_Invalid_Command; overriding procedure Test_Invalid_Parameter (Self : in out Instance) is @@ -332,7 +332,7 @@ package body Limiter_Tests.Implementation is -- Make sure some events were thrown: Natural_Assert.Eq (T.Event_T_Recv_Sync_History.Get_Count, 1); Natural_Assert.Eq (T.Invalid_Parameter_Received_History.Get_Count, 1); - Invalid_Parameter_Info_Assert.Eq (T.Invalid_Parameter_Received_History.Get (1), (Id => T.Parameters.Get_Max_Sends_Per_Tick_Id, Errant_Field_Number => Interfaces.Unsigned_32'Last, Errant_Field => (0, 0, 0, 0, 0, 0, 0, 0))); + Invalid_Parameter_Info_Assert.Eq (T.Invalid_Parameter_Received_History.Get (1), (Id => T.Parameters.Get_Max_Sends_Per_Tick_Id, Errant_Field_Number => Interfaces.Unsigned_32'Last, Errant_Field => [0, 0, 0, 0, 0, 0, 0, 0])); -- Make the parameter invalid by setting a crazy id; Param.Header.Id := 1_001; @@ -345,7 +345,7 @@ package body Limiter_Tests.Implementation is -- Make sure some events were thrown: Natural_Assert.Eq (T.Event_T_Recv_Sync_History.Get_Count, 2); Natural_Assert.Eq (T.Invalid_Parameter_Received_History.Get_Count, 2); - Invalid_Parameter_Info_Assert.Eq (T.Invalid_Parameter_Received_History.Get (2), (Id => 1_001, Errant_Field_Number => Interfaces.Unsigned_32'Last - 1, Errant_Field => (0, 0, 0, 0, 0, 0, 16#03#, 16#E9#))); + Invalid_Parameter_Info_Assert.Eq (T.Invalid_Parameter_Received_History.Get (2), (Id => 1_001, Errant_Field_Number => Interfaces.Unsigned_32'Last - 1, Errant_Field => [0, 0, 0, 0, 0, 0, 16#03#, 16#E9#])); end Test_Invalid_Parameter; end Limiter_Tests.Implementation; diff --git a/src/components/limiter/test_variable/component-limiter-implementation-tester.adb b/src/components/limiter/test_variable/component-limiter-implementation-tester.adb index d6491df3..86bcf93e 100644 --- a/src/components/limiter/test_variable/component-limiter-implementation-tester.adb +++ b/src/components/limiter/test_variable/component-limiter-implementation-tester.adb @@ -213,7 +213,7 @@ package body Component.Limiter.Implementation.Tester is not overriding function Fetch_Parameter (Self : in out Instance; Id : in Parameter_Types.Parameter_Id; Par : out Parameter.T) return Parameter_Update_Status.E is use Parameter_Enums.Parameter_Update_Status; use Parameter_Enums.Parameter_Operation_Type; - Param_Update : Parameter_Update.T := (Operation => Fetch, Status => Success, Param => (Header => (Id => Id, Buffer_Length => 0), Buffer => (others => 0))); + Param_Update : Parameter_Update.T := (Operation => Fetch, Status => Success, Param => (Header => (Id => Id, Buffer_Length => 0), Buffer => [others => 0])); begin -- Set the ID to fetch: Param_Update.Param.Header.Id := Id; @@ -225,7 +225,7 @@ package body Component.Limiter.Implementation.Tester is not overriding function Update_Parameters (Self : in out Instance) return Parameter_Update_Status.E is use Parameter_Enums.Parameter_Update_Status; use Parameter_Enums.Parameter_Operation_Type; - Param_Update : Parameter_Update.T := (Operation => Update, Status => Success, Param => ((0, 0), (others => 0))); + Param_Update : Parameter_Update.T := (Operation => Update, Status => Success, Param => ((0, 0), [others => 0])); begin Self.Parameter_Update_T_Provide (Param_Update); return Param_Update.Status; diff --git a/src/components/limiter/test_variable/simple_variable.record.yaml b/src/components/limiter/test_variable/simple_variable.record.yaml index 58defc5e..a088bdbe 100644 --- a/src/components/limiter/test_variable/simple_variable.record.yaml +++ b/src/components/limiter/test_variable/simple_variable.record.yaml @@ -11,5 +11,5 @@ fields: - name: Buffer type: Buffer_Type format: U8x20 - default: (others => 0) + default: "[others => 0]" variable_length: Length diff --git a/src/components/limiter/test_variable/variable_tests-implementation.adb b/src/components/limiter/test_variable/variable_tests-implementation.adb index 3bd83340..e1f9563a 100644 --- a/src/components/limiter/test_variable/variable_tests-implementation.adb +++ b/src/components/limiter/test_variable/variable_tests-implementation.adb @@ -61,44 +61,44 @@ package body Variable_Tests.Implementation is Byte_Assert.Eq (T.Component_Instance.Get_Queue_Current_Percent_Used, 0); -- Enqueue one max size piece of data, make sure one send occurs. - T.T_Send ((Length => 20, Buffer => (others => 5))); + T.T_Send ((Length => 20, Buffer => [others => 5])); Natural_Assert.Eq (T.T_Recv_Sync_History.Get_Count, 0); Byte_Assert.Eq (T.Component_Instance.Get_Queue_Current_Percent_Used, 25); T.Tick_T_Send (The_Tick); Natural_Assert.Eq (T.T_Recv_Sync_History.Get_Count, 1); - Simple_Variable_Assert.Eq (T.T_Recv_Sync_History.Get (1), (Length => 20, Buffer => (others => 5))); + Simple_Variable_Assert.Eq (T.T_Recv_Sync_History.Get (1), (Length => 20, Buffer => [others => 5])); -- Enqueue two max size pieces of data, make sure two sends occur. - T.T_Send ((Length => 20, Buffer => (others => 2))); - T.T_Send ((Length => 20, Buffer => (others => 3))); + T.T_Send ((Length => 20, Buffer => [others => 2])); + T.T_Send ((Length => 20, Buffer => [others => 3])); Natural_Assert.Eq (T.T_Recv_Sync_History.Get_Count, 1); Byte_Assert.Eq (T.Component_Instance.Get_Queue_Current_Percent_Used, 50); T.Tick_T_Send (The_Tick); Natural_Assert.Eq (T.T_Recv_Sync_History.Get_Count, 3); - Simple_Variable_Assert.Eq (T.T_Recv_Sync_History.Get (2), (Length => 20, Buffer => (others => 2))); - Simple_Variable_Assert.Eq (T.T_Recv_Sync_History.Get (3), (Length => 20, Buffer => (others => 3))); + Simple_Variable_Assert.Eq (T.T_Recv_Sync_History.Get (2), (Length => 20, Buffer => [others => 2])); + Simple_Variable_Assert.Eq (T.T_Recv_Sync_History.Get (3), (Length => 20, Buffer => [others => 3])); -- Enqueue two half size pieces of data, make sure two sends occur. - T.T_Send ((Length => 10, Buffer => (others => 2))); - T.T_Send ((Length => 10, Buffer => (others => 3))); + T.T_Send ((Length => 10, Buffer => [others => 2])); + T.T_Send ((Length => 10, Buffer => [others => 3])); Natural_Assert.Eq (T.T_Recv_Sync_History.Get_Count, 3); -- IMPORTANT check, the queue usage should be less than 50% if variable length queueing of the -- generic is working! Byte_Assert.Lt (T.Component_Instance.Get_Queue_Current_Percent_Used, 40); T.Tick_T_Send (The_Tick); Natural_Assert.Eq (T.T_Recv_Sync_History.Get_Count, 5); - Simple_Variable_Assert.Eq (T.T_Recv_Sync_History.Get (4), (Length => 10, Buffer => (others => 2))); - Simple_Variable_Assert.Eq (T.T_Recv_Sync_History.Get (5), (Length => 10, Buffer => (others => 3))); + Simple_Variable_Assert.Eq (T.T_Recv_Sync_History.Get (4), (Length => 10, Buffer => [others => 2])); + Simple_Variable_Assert.Eq (T.T_Recv_Sync_History.Get (5), (Length => 10, Buffer => [others => 3])); -- Enqueue one half size pieces of data, make sure one send occurs. - T.T_Send ((Length => 9, Buffer => (others => 4))); + T.T_Send ((Length => 9, Buffer => [others => 4])); Natural_Assert.Eq (T.T_Recv_Sync_History.Get_Count, 5); -- IMPORTANT check, the queue usage should be less than 25% if variable length queueing of the -- generic is working! Byte_Assert.Lt (T.Component_Instance.Get_Queue_Current_Percent_Used, 25); T.Tick_T_Send (The_Tick); Natural_Assert.Eq (T.T_Recv_Sync_History.Get_Count, 6); - Simple_Variable_Assert.Eq (T.T_Recv_Sync_History.Get (6), (Length => 9, Buffer => (others => 4))); + Simple_Variable_Assert.Eq (T.T_Recv_Sync_History.Get (6), (Length => 9, Buffer => [others => 4])); end Test_Queueing_Variable_Length; end Variable_Tests.Implementation; diff --git a/src/components/logger/component-logger-implementation.adb b/src/components/logger/component-logger-implementation.adb index c19d381e..28dbaf3c 100644 --- a/src/components/logger/component-logger-implementation.adb +++ b/src/components/logger/component-logger-implementation.adb @@ -152,7 +152,7 @@ package body Component.Logger.Implementation is Self.Buffer.Init (Self.Bytes, Self.Meta_Data); else Self.Bytes := new Basic_Types.Byte_Array (0 .. Size - 1); - Self.Bytes.all := (others => 0); -- Initialize to zeros if this is on the heap. + Self.Bytes.all := [others => 0]; -- Initialize to zeros if this is on the heap. pragma Assert (Meta_Data = null, "This should never happen."); Self.Meta_Data := new Circular_Buffer_Meta.T; -- Initialize circular buffer with bytes following the meta data storage: diff --git a/src/components/logger/test/logger_tests-implementation.adb b/src/components/logger/test/logger_tests-implementation.adb index 1e97211d..2298eb21 100644 --- a/src/components/logger/test/logger_tests-implementation.adb +++ b/src/components/logger/test/logger_tests-implementation.adb @@ -84,8 +84,8 @@ package body Logger_Tests.Implementation is use Byte_Array_Pointer.Packed; T : Component_Tester_Package.Instance_Access renames Self.Tester; The_Tick : Tick.T; - Bytes : Basic_Types.Byte_Array := (0 .. 99 => 0); - Bytes_To_Compare : Basic_Types.Byte_Array := (0 .. 99 => 0); + Bytes : Basic_Types.Byte_Array := [0 .. 99 => 0]; + Bytes_To_Compare : Basic_Types.Byte_Array := [0 .. 99 => 0]; Ptr : Byte_Array_Pointer.Instance; Idx : Natural := 0; begin @@ -329,8 +329,8 @@ package body Logger_Tests.Implementation is use Byte_Array_Pointer.Packed; T : Component_Tester_Package.Instance_Access renames Self.Tester; The_Tick : Tick.T; - Bytes : Basic_Types.Byte_Array := (0 .. 99 => 0); - Bytes_To_Compare : Basic_Types.Byte_Array := (0 .. 99 => 0); + Bytes : Basic_Types.Byte_Array := [0 .. 99 => 0]; + Bytes_To_Compare : Basic_Types.Byte_Array := [0 .. 99 => 0]; Ptr : Byte_Array_Pointer.Instance; Idx : Natural := 0; Len : Natural := 0; @@ -690,7 +690,7 @@ package body Logger_Tests.Implementation is end Init_Nominal_Heap; procedure Init_Nominal_Static is - Bytes : aliased Basic_Types.Byte_Array := (0 .. 50 => 0); + Bytes : aliased Basic_Types.Byte_Array := [0 .. 50 => 0]; Meta_Data : aliased Circular_Buffer_Meta.T; begin T.Component_Instance.Init (Bytes => Bytes'Unchecked_Access, Meta_Data => Meta_Data'Unchecked_Access); @@ -701,7 +701,7 @@ package body Logger_Tests.Implementation is end Init_Nominal_Static; procedure Init_Nominal_Mode is - Bytes : aliased Basic_Types.Byte_Array := (0 .. 50 => 0); + Bytes : aliased Basic_Types.Byte_Array := [0 .. 50 => 0]; Meta_Data : aliased Circular_Buffer_Meta.T; begin T.Component_Instance.Init (Bytes => Bytes'Unchecked_Access, Meta_Data => Meta_Data'Unchecked_Access, Initial_Mode => Logger_Mode.Enabled); @@ -712,7 +712,7 @@ package body Logger_Tests.Implementation is end Init_Nominal_Mode; procedure Init_Everything is - Bytes : aliased Basic_Types.Byte_Array := (0 .. 50 => 0); + Bytes : aliased Basic_Types.Byte_Array := [0 .. 50 => 0]; Meta_Data : aliased Circular_Buffer_Meta.T; begin T.Component_Instance.Init (Bytes => Bytes'Unchecked_Access, Meta_Data => Meta_Data'Unchecked_Access, Size => 50); @@ -736,7 +736,7 @@ package body Logger_Tests.Implementation is end Init_Nothing; procedure Init_Some_1 is - Bytes : aliased Basic_Types.Byte_Array := (0 .. 50 => 0); + Bytes : aliased Basic_Types.Byte_Array := [0 .. 50 => 0]; begin T.Component_Instance.Init (Bytes => Bytes'Unchecked_Access); -- Should never get here: @@ -760,7 +760,7 @@ package body Logger_Tests.Implementation is end Init_Some_2; procedure Init_Some_3 is - Bytes : aliased Basic_Types.Byte_Array := (0 .. 50 => 0); + Bytes : aliased Basic_Types.Byte_Array := [0 .. 50 => 0]; begin T.Component_Instance.Init (Bytes => Bytes'Unchecked_Access, Size => 40); -- Should never get here: @@ -810,7 +810,7 @@ package body Logger_Tests.Implementation is Natural_Assert.Eq (T.Dumping_Log_Memory_History.Get_Count, 0); Natural_Assert.Eq (T.Event_T_Recv_Sync_History.Get_Count, 1); Natural_Assert.Eq (T.Invalid_Command_Received_History.Get_Count, 1); - Invalid_Command_Info_Assert.Eq (T.Invalid_Command_Received_History.Get (1), (Id => T.Commands.Get_Dump_Oldest_Data_Id, Errant_Field_Number => Interfaces.Unsigned_32'Last, Errant_Field => (0, 0, 0, 0, 0, 0, 0, 0))); + Invalid_Command_Info_Assert.Eq (T.Invalid_Command_Received_History.Get (1), (Id => T.Commands.Get_Dump_Oldest_Data_Id, Errant_Field_Number => Interfaces.Unsigned_32'Last, Errant_Field => [0, 0, 0, 0, 0, 0, 0, 0])); end Test_Invalid_Command; end Logger_Tests.Implementation; diff --git a/src/components/logger/test_variable/simple_variable.record.yaml b/src/components/logger/test_variable/simple_variable.record.yaml index 58defc5e..a088bdbe 100644 --- a/src/components/logger/test_variable/simple_variable.record.yaml +++ b/src/components/logger/test_variable/simple_variable.record.yaml @@ -11,5 +11,5 @@ fields: - name: Buffer type: Buffer_Type format: U8x20 - default: (others => 0) + default: "[others => 0]" variable_length: Length diff --git a/src/components/logger/test_variable/variable_tests-implementation.adb b/src/components/logger/test_variable/variable_tests-implementation.adb index 9a2078a1..79491893 100644 --- a/src/components/logger/test_variable/variable_tests-implementation.adb +++ b/src/components/logger/test_variable/variable_tests-implementation.adb @@ -86,43 +86,43 @@ package body Variable_Tests.Implementation is use Serializer_Types; T : Component_Tester_Package.Instance_Access renames Self.Tester; Var : Simple_Variable.T; - Bytes : Basic_Types.Byte_Array := (0 .. 99 => 0); - Bytes_To_Compare : Basic_Types.Byte_Array := (0 .. 99 => 0); + Bytes : Basic_Types.Byte_Array := [0 .. 99 => 0]; + Bytes_To_Compare : Basic_Types.Byte_Array := [0 .. 99 => 0]; Ptr : Byte_Array_Pointer.Instance; Idx : Natural := 0; Len : Natural := 0; - Log_Bytes : aliased Basic_Types.Byte_Array := (0 .. 49 => 0); + Log_Bytes : aliased Basic_Types.Byte_Array := [0 .. 49 => 0]; Meta_Data : aliased Circular_Buffer_Meta.T := (0, 0, 0); begin -- Initialize the component: T.Component_Instance.Init (Bytes => Log_Bytes'Unchecked_Access, Meta_Data => Meta_Data'Unchecked_Access, Initial_Mode => Logger_Mode.Enabled); -- Send some data to the logger while it is disabled: - Var := (0, (0 => 1, 1 => 2, 2 => 3, others => 9)); + Var := (0, [0 => 1, 1 => 2, 2 => 3, others => 9]); T.T_Send (Var); Put_Line (Basic_Types.Representation.Image (Log_Bytes)); pragma Assert (Simple_Variable.Serialized_Length (Var, Len) = Success); pragma Assert (Simple_Variable.Serialization.To_Byte_Array (Bytes_To_Compare (Idx .. Idx + Len - 1), Var) = Success); Idx := Idx + Len; - Var := (1, (0 => 1, others => 9)); + Var := (1, [0 => 1, others => 9]); T.T_Send (Var); Put_Line (Basic_Types.Representation.Image (Log_Bytes)); pragma Assert (Simple_Variable.Serialized_Length (Var, Len) = Success); pragma Assert (Simple_Variable.Serialization.To_Byte_Array (Bytes_To_Compare (Idx .. Idx + Len - 1), Var) = Success); Idx := Idx + Len; - Var := (2, (0 => 2, 1 => 3, others => 9)); + Var := (2, [0 => 2, 1 => 3, others => 9]); T.T_Send (Var); Put_Line (Basic_Types.Representation.Image (Log_Bytes)); pragma Assert (Simple_Variable.Serialized_Length (Var, Len) = Success); pragma Assert (Simple_Variable.Serialization.To_Byte_Array (Bytes_To_Compare (Idx .. Idx + Len - 1), Var) = Success); Idx := Idx + Len; - Var := (3, (0 => 4, 1 => 5, 2 => 6, others => 9)); + Var := (3, [0 => 4, 1 => 5, 2 => 6, others => 9]); T.T_Send (Var); Put_Line (Basic_Types.Representation.Image (Log_Bytes)); pragma Assert (Simple_Variable.Serialized_Length (Var, Len) = Success); pragma Assert (Simple_Variable.Serialization.To_Byte_Array (Bytes_To_Compare (Idx .. Idx + Len - 1), Var) = Success); Idx := Idx + Len; - Var := (4, (0 => 7, 1 => 8, 2 => 9, 3 => 10, others => 9)); + Var := (4, [0 => 7, 1 => 8, 2 => 9, 3 => 10, others => 9]); T.T_Send (Var); Put_Line (Basic_Types.Representation.Image (Log_Bytes)); pragma Assert (Simple_Variable.Serialized_Length (Var, Len) = Success); @@ -240,30 +240,30 @@ package body Variable_Tests.Implementation is T : Component_Tester_Package.Instance_Access renames Self.Tester; Var : Simple_Variable.T; Len : Natural := 0; - Log_Bytes : aliased Basic_Types.Byte_Array := (0 .. 49 => 0); + Log_Bytes : aliased Basic_Types.Byte_Array := [0 .. 49 => 0]; Meta_Data : aliased Circular_Buffer_Meta.T := (0, 0, 0); begin -- Initialize the component: T.Component_Instance.Init (Bytes => Log_Bytes'Unchecked_Access, Meta_Data => Meta_Data'Unchecked_Access, Initial_Mode => Logger_Mode.Enabled); -- Send good log data: - Var := (3, (others => 9)); + Var := (3, [others => 9]); T.T_Send (Var); -- Send some bad log data: - Var := (21, (0 => 1, 1 => 2, 2 => 3, others => 9)); + Var := (21, [0 => 1, 1 => 2, 2 => 3, others => 9]); T.T_Send (Var); Put_Line (Basic_Types.Representation.Image (Log_Bytes)); pragma Assert (Simple_Variable.Serialized_Length (Var, Len) = Failure); - Var := (255, (0 => 1, others => 9)); + Var := (255, [0 => 1, others => 9]); T.T_Send (Var); Put_Line (Basic_Types.Representation.Image (Log_Bytes)); pragma Assert (Simple_Variable.Serialized_Length (Var, Len) = Failure); - Var := (22, (0 => 2, 1 => 3, others => 9)); + Var := (22, [0 => 2, 1 => 3, others => 9]); T.T_Send (Var); Put_Line (Basic_Types.Representation.Image (Log_Bytes)); pragma Assert (Simple_Variable.Serialized_Length (Var, Len) = Failure); - Var := (23, (0 => 4, 1 => 5, 2 => 6, others => 9)); + Var := (23, [0 => 4, 1 => 5, 2 => 6, others => 9]); T.T_Send (Var); Put_Line (Basic_Types.Representation.Image (Log_Bytes)); pragma Assert (Simple_Variable.Serialized_Length (Var, Len) = Failure); @@ -292,16 +292,16 @@ package body Variable_Tests.Implementation is T.Component_Instance.Init (Size => 5, Initial_Mode => Logger_Mode.Enabled); -- Send some good log data: - Var := (4, (others => 9)); + Var := (4, [others => 9]); T.T_Send (Var); Put_Line (Basic_Types.Representation.Image (Log_Bytes)); -- Send some bad log data: - Var := (5, (others => 8)); + Var := (5, [others => 8]); T.T_Send (Var); - Var := (6, (others => 8)); + Var := (6, [others => 8]); T.T_Send (Var); - Var := (255, (others => 8)); + Var := (255, [others => 8]); T.T_Send (Var); -- Make sure 4 error events were thrown: @@ -340,7 +340,7 @@ package body Variable_Tests.Implementation is Natural_Assert.Eq (T.Dumping_Log_Memory_History.Get_Count, 0); Natural_Assert.Eq (T.Event_T_Recv_Sync_History.Get_Count, 1); Natural_Assert.Eq (T.Invalid_Command_Received_History.Get_Count, 1); - Invalid_Command_Info_Assert.Eq (T.Invalid_Command_Received_History.Get (1), (Id => T.Commands.Get_Dump_Oldest_Data_Id, Errant_Field_Number => Interfaces.Unsigned_32'Last, Errant_Field => (0, 0, 0, 0, 0, 0, 0, 0))); + Invalid_Command_Info_Assert.Eq (T.Invalid_Command_Received_History.Get (1), (Id => T.Commands.Get_Dump_Oldest_Data_Id, Errant_Field_Number => Interfaces.Unsigned_32'Last, Errant_Field => [0, 0, 0, 0, 0, 0, 0, 0])); end Test_Invalid_Command; end Variable_Tests.Implementation; diff --git a/src/components/memory_copier/test/component-memory_copier-implementation-tester.ads b/src/components/memory_copier/test/component-memory_copier-implementation-tester.ads index 32a263ec..5c7b4460 100644 --- a/src/components/memory_copier/test/component-memory_copier-implementation-tester.ads +++ b/src/components/memory_copier/test/component-memory_copier-implementation-tester.ads @@ -66,7 +66,7 @@ package Component.Memory_Copier.Implementation.Tester is Expect_Command_T_Send_Dropped : Boolean := False; Command_T_Send_Dropped_Count : Natural := 0; -- Memory regions for simulation: - Scratch : Basic_Types.Byte_Array (0 .. 99) := (others => 15); + Scratch : Basic_Types.Byte_Array (0 .. 99) := [others => 15]; Scratch_Return_Status : Memory_Manager_Enums.Memory_Request_Status.E := Memory_Manager_Enums.Memory_Request_Status.Success; end record; type Instance_Access is access all Instance; diff --git a/src/components/memory_copier/test/memory_copier_tests-implementation.adb b/src/components/memory_copier/test/memory_copier_tests-implementation.adb index 4cef30fe..e026e0f2 100644 --- a/src/components/memory_copier/test/memory_copier_tests-implementation.adb +++ b/src/components/memory_copier/test/memory_copier_tests-implementation.adb @@ -73,7 +73,7 @@ package body Memory_Copier_Tests.Implementation is type Boolean_Access is access all Boolean; task type Simulator_Task (Class_Self : Class_Access; Task_Exit : Boolean_Access); - Sim_Bytes : aliased Basic_Types.Byte_Array := (0 .. 99 => 12); + Sim_Bytes : aliased Basic_Types.Byte_Array := [0 .. 99 => 12]; task body Simulator_Task is Ignore : Natural; @@ -115,8 +115,8 @@ package body Memory_Copier_Tests.Implementation is T : Component.Memory_Copier.Implementation.Tester.Instance_Access renames Self.Tester; Task_Exit : aliased Boolean := False; Sim_Task : Simulator_Task (Self'Unchecked_Access, Task_Exit'Unchecked_Access); - Dest : Basic_Types.Byte_Array (0 .. 99) := (others => 44); - Dest2 : Basic_Types.Byte_Array (0 .. 99) := (others => 55); + Dest : Basic_Types.Byte_Array (0 .. 99) := [others => 44]; + Dest2 : Basic_Types.Byte_Array (0 .. 99) := [others => 55]; begin -- Send command to copy region: T.Command_T_Send (T.Commands.Copy_Memory_Region ((Source_Address => 5, Source_Length => 6, Destination_Address => Dest'Address))); @@ -177,7 +177,7 @@ package body Memory_Copier_Tests.Implementation is T : Component.Memory_Copier.Implementation.Tester.Instance_Access renames Self.Tester; Task_Exit : aliased Boolean := False; Sim_Task : Simulator_Task (Self'Unchecked_Access, Task_Exit'Unchecked_Access); - Dest : Basic_Types.Byte_Array (0 .. 99) := (others => 44); + Dest : Basic_Types.Byte_Array (0 .. 99) := [others => 44]; begin -- Send command to copy region 1 byte too large: T.Command_T_Send (T.Commands.Copy_Memory_Region ((Source_Address => 0, Source_Length => 5, Destination_Address => Dest'Address))); @@ -213,7 +213,7 @@ package body Memory_Copier_Tests.Implementation is T : Component.Memory_Copier.Implementation.Tester.Instance_Access renames Self.Tester; Task_Exit : aliased Boolean := False; Sim_Task : Simulator_Task (Self'Unchecked_Access, Task_Exit'Unchecked_Access); - Dest : Basic_Types.Byte_Array (0 .. 99) := (others => 44); + Dest : Basic_Types.Byte_Array (0 .. 99) := [others => 44]; begin -- Send command to copy region 1 byte too large: T.Command_T_Send (T.Commands.Copy_Memory_Region ((Source_Address => 0, Source_Length => T.Scratch'Length, Destination_Address => Dest'Address))); @@ -247,7 +247,7 @@ package body Memory_Copier_Tests.Implementation is T : Component.Memory_Copier.Implementation.Tester.Instance_Access renames Self.Tester; Task_Exit : aliased Boolean := False; Sim_Task : Simulator_Task (Self'Unchecked_Access, Task_Exit'Unchecked_Access); - Dest : Basic_Types.Byte_Array (0 .. 99) := (others => 44); + Dest : Basic_Types.Byte_Array (0 .. 99) := [others => 44]; begin -- Set scratch return status: T.Scratch_Return_Status := Memory_Manager_Enums.Memory_Request_Status.Failure; @@ -282,7 +282,7 @@ package body Memory_Copier_Tests.Implementation is T : Component.Memory_Copier.Implementation.Tester.Instance_Access renames Self.Tester; Task_Exit : aliased Boolean := False; Sim_Task : Simulator_Task (Self'Unchecked_Access, Task_Exit'Unchecked_Access); - Dest : Basic_Types.Byte_Array (0 .. 99) := (others => 44); + Dest : Basic_Types.Byte_Array (0 .. 99) := [others => 44]; begin -- Send command to copy region 1 byte too large: T.Command_T_Send (T.Commands.Copy_Memory_Region ((Source_Address => 0, Source_Length => T.Scratch'Length + 1, Destination_Address => Dest'Address))); @@ -373,7 +373,7 @@ package body Memory_Copier_Tests.Implementation is -- Make sure some events were thrown: Natural_Assert.Eq (T.Event_T_Recv_Sync_History.Get_Count, 1); Natural_Assert.Eq (T.Invalid_Command_Received_History.Get_Count, 1); - Invalid_Command_Info_Assert.Eq (T.Invalid_Command_Received_History.Get (1), (Id => T.Commands.Get_Copy_Memory_Region_Id, Errant_Field_Number => Interfaces.Unsigned_32'Last, Errant_Field => (0, 0, 0, 0, 0, 0, 0, 22))); + Invalid_Command_Info_Assert.Eq (T.Invalid_Command_Received_History.Get (1), (Id => T.Commands.Get_Copy_Memory_Region_Id, Errant_Field_Number => Interfaces.Unsigned_32'Last, Errant_Field => [0, 0, 0, 0, 0, 0, 0, 22])); end Test_Invalid_Command; end Memory_Copier_Tests.Implementation; diff --git a/src/components/memory_dumper/test/memory_dumper_tests-implementation.adb b/src/components/memory_dumper/test/memory_dumper_tests-implementation.adb index c3849bfd..d6339384 100644 --- a/src/components/memory_dumper/test/memory_dumper_tests-implementation.adb +++ b/src/components/memory_dumper/test/memory_dumper_tests-implementation.adb @@ -24,11 +24,11 @@ with Interfaces; package body Memory_Dumper_Tests.Implementation is - Region_1 : aliased Basic_Types.Byte_Array := (1, 2, 3, 4, 5, 6, 7, 8, 9, 10); + Region_1 : aliased Basic_Types.Byte_Array := [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; Region_1_Address : constant System.Address := Region_1'Address; - Region_2 : aliased Basic_Types.Byte_Array := (98, 97, 96, 95, 94, 93, 92, 91, 90, 89, 88, 87, 86, 85, 84, 83, 82, 81, 80, 79); + Region_2 : aliased Basic_Types.Byte_Array := [98, 97, 96, 95, 94, 93, 92, 91, 90, 89, 88, 87, 86, 85, 84, 83, 82, 81, 80, 79]; Region_2_Address : constant System.Address := Region_2'Address; - Regions : aliased Memory_Manager_Types.Memory_Region_Array := ((Region_1_Address, Region_1'Length), (Region_2_Address, Region_2'Length)); + Regions : aliased Memory_Manager_Types.Memory_Region_Array := [(Region_1_Address, Region_1'Length), (Region_2_Address, Region_2'Length)]; ------------------------------------------------------------------------- -- Fixtures: @@ -95,7 +95,7 @@ package body Memory_Dumper_Tests.Implementation is -- Check memory dump: Packet_Id_Assert.Eq (T.Memory_Dump_Recv_Sync_History.Get (1).Id, Packets.Get_Memory_Dump_Packet_Id); - Byte_Array_Pointer_Assert.Eq (T.Memory_Dump_Recv_Sync_History.Get (1).Memory_Pointer, (1, 2, 3, 4, 5, 6, 7, 8, 9, 10)); + Byte_Array_Pointer_Assert.Eq (T.Memory_Dump_Recv_Sync_History.Get (1).Memory_Pointer, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]); -- Send command to dump entire second region: Region := (Address => Region_2_Address, Length => Region_2'Length); @@ -124,7 +124,7 @@ package body Memory_Dumper_Tests.Implementation is -- Check memory dump: Packet_Id_Assert.Eq (T.Memory_Dump_Recv_Sync_History.Get (2).Id, Packets.Get_Memory_Dump_Packet_Id); - Byte_Array_Pointer_Assert.Eq (T.Memory_Dump_Recv_Sync_History.Get (2).Memory_Pointer, (98, 97, 96, 95, 94, 93, 92, 91, 90, 89, 88, 87, 86, 85, 84, 83, 82, 81, 80, 79)); + Byte_Array_Pointer_Assert.Eq (T.Memory_Dump_Recv_Sync_History.Get (2).Memory_Pointer, [98, 97, 96, 95, 94, 93, 92, 91, 90, 89, 88, 87, 86, 85, 84, 83, 82, 81, 80, 79]); -- Send command to dump partial first region: Region := (Address => Region_1_Address, Length => 5); @@ -147,7 +147,7 @@ package body Memory_Dumper_Tests.Implementation is -- Check memory dump: Packet_Id_Assert.Eq (T.Memory_Dump_Recv_Sync_History.Get (3).Id, Packets.Get_Memory_Dump_Packet_Id); - Byte_Array_Pointer_Assert.Eq (T.Memory_Dump_Recv_Sync_History.Get (3).Memory_Pointer, (1, 2, 3, 4, 5)); + Byte_Array_Pointer_Assert.Eq (T.Memory_Dump_Recv_Sync_History.Get (3).Memory_Pointer, [1, 2, 3, 4, 5]); -- Send command to dump partial second region: Region := (Address => Region_2_Address + Storage_Offset (12), Length => 6); @@ -170,7 +170,7 @@ package body Memory_Dumper_Tests.Implementation is -- Check memory dump: Packet_Id_Assert.Eq (T.Memory_Dump_Recv_Sync_History.Get (4).Id, Packets.Get_Memory_Dump_Packet_Id); - Byte_Array_Pointer_Assert.Eq (T.Memory_Dump_Recv_Sync_History.Get (4).Memory_Pointer, (86, 85, 84, 83, 82, 81)); + Byte_Array_Pointer_Assert.Eq (T.Memory_Dump_Recv_Sync_History.Get (4).Memory_Pointer, [86, 85, 84, 83, 82, 81]); end Test_Nominal_Dumping; overriding procedure Test_Memory_Crc (Self : in out Instance) is @@ -270,11 +270,11 @@ package body Memory_Dumper_Tests.Implementation is Natural_Assert.Eq (T.Memory_Crc_History.Get_Count, 3); Put_Line ("CRC:"); Put_Line (Memory_Region_Crc.Representation.Image (T.Memory_Crc_History.Get (3))); - Memory_Region_Crc_Assert.Eq (T.Memory_Crc_History.Get (3), (Region => (Region.Address, Region.Length), Crc => Crc_16.Compute_Crc_16 ((3, 4, 5, 6)))); + Memory_Region_Crc_Assert.Eq (T.Memory_Crc_History.Get (3), (Region => (Region.Address, Region.Length), Crc => Crc_16.Compute_Crc_16 ([3, 4, 5, 6]))); -- Check data product: Natural_Assert.Eq (T.Crc_Report_History.Get_Count, 3); - Memory_Region_Crc_Assert.Eq (T.Crc_Report_History.Get (3), (Region => (Region.Address, Region.Length), Crc => Crc_16.Compute_Crc_16 ((3, 4, 5, 6)))); + Memory_Region_Crc_Assert.Eq (T.Crc_Report_History.Get (3), (Region => (Region.Address, Region.Length), Crc => Crc_16.Compute_Crc_16 ([3, 4, 5, 6]))); -- Send command to crc partial second region: Region := (Address => Region_2_Address + Storage_Offset (12), Length => 8); @@ -298,11 +298,11 @@ package body Memory_Dumper_Tests.Implementation is Natural_Assert.Eq (T.Memory_Crc_History.Get_Count, 4); Put_Line ("CRC:"); Put_Line (Memory_Region_Crc.Representation.Image (T.Memory_Crc_History.Get (4))); - Memory_Region_Crc_Assert.Eq (T.Memory_Crc_History.Get (4), (Region => (Region.Address, Region.Length), Crc => Crc_16.Compute_Crc_16 ((86, 85, 84, 83, 82, 81, 80, 79)))); + Memory_Region_Crc_Assert.Eq (T.Memory_Crc_History.Get (4), (Region => (Region.Address, Region.Length), Crc => Crc_16.Compute_Crc_16 ([86, 85, 84, 83, 82, 81, 80, 79]))); -- Check data product: Natural_Assert.Eq (T.Crc_Report_History.Get_Count, 4); - Memory_Region_Crc_Assert.Eq (T.Crc_Report_History.Get (4), (Region => (Region.Address, Region.Length), Crc => Crc_16.Compute_Crc_16 ((86, 85, 84, 83, 82, 81, 80, 79)))); + Memory_Region_Crc_Assert.Eq (T.Crc_Report_History.Get (4), (Region => (Region.Address, Region.Length), Crc => Crc_16.Compute_Crc_16 ([86, 85, 84, 83, 82, 81, 80, 79]))); end Test_Memory_Crc; overriding procedure Test_Invalid_Address (Self : in out Instance) is @@ -476,7 +476,7 @@ package body Memory_Dumper_Tests.Implementation is -- Make sure some events were thrown: Natural_Assert.Eq (T.Event_T_Recv_Sync_History.Get_Count, 1); Natural_Assert.Eq (T.Invalid_Command_Received_History.Get_Count, 1); - Invalid_Command_Info_Assert.Eq (T.Invalid_Command_Received_History.Get (1), (Id => T.Commands.Get_Crc_Memory_Id, Errant_Field_Number => Interfaces.Unsigned_32'Last, Errant_Field => (0, 0, 0, 0, 0, 0, 0, 0))); + Invalid_Command_Info_Assert.Eq (T.Invalid_Command_Received_History.Get (1), (Id => T.Commands.Get_Crc_Memory_Id, Errant_Field_Number => Interfaces.Unsigned_32'Last, Errant_Field => [0, 0, 0, 0, 0, 0, 0, 0])); end Test_Invalid_Command; end Memory_Dumper_Tests.Implementation; diff --git a/src/components/memory_manager/component-memory_manager-implementation.adb b/src/components/memory_manager/component-memory_manager-implementation.adb index c164a38b..d1959a58 100644 --- a/src/components/memory_manager/component-memory_manager-implementation.adb +++ b/src/components/memory_manager/component-memory_manager-implementation.adb @@ -138,7 +138,7 @@ package body Component.Memory_Manager.Implementation is begin -- Update the data products: Self.Data_Product_T_Send_If_Connected (Self.Data_Products.Memory_Region_Status (The_Time, (State => Self.Arbiter.Get_State))); - Self.Data_Product_T_Send_If_Connected (Self.Data_Products.Crc_Report (The_Time, (Region => (Address => 0, Length => 0), Crc => (0, 0)))); + Self.Data_Product_T_Send_If_Connected (Self.Data_Products.Crc_Report (The_Time, (Region => (Address => 0, Length => 0), Crc => [0, 0]))); Self.Data_Product_T_Send_If_Connected (Self.Data_Products.Memory_Location (The_Time, Self.Region)); end Set_Up; diff --git a/src/components/memory_manager/test/memory_manager_tests-implementation.adb b/src/components/memory_manager/test/memory_manager_tests-implementation.adb index 17d0c94a..cad81ea3 100644 --- a/src/components/memory_manager/test/memory_manager_tests-implementation.adb +++ b/src/components/memory_manager/test/memory_manager_tests-implementation.adb @@ -36,7 +36,7 @@ package body Memory_Manager_Tests.Implementation is ------------------------------------------------------------------------- -- 100 byte region. By declaring this outside the component we can -- easily view the internal memory region. - Memory : aliased Basic_Types.Byte_Array := (0 .. 99 => 0); + Memory : aliased Basic_Types.Byte_Array := [0 .. 99 => 0]; ------------------------------------------------------------------------- -- Fixtures: @@ -45,7 +45,7 @@ package body Memory_Manager_Tests.Implementation is overriding procedure Set_Up_Test (Self : in out Instance) is begin -- Reset memory to zeros: - Memory := (others => 0); + Memory := [others => 0]; -- Allocate heap memory to component: Self.Tester.Init_Base (Queue_Size => Self.Tester.Component_Instance.Get_Max_Queue_Element_Size * 3); @@ -128,7 +128,7 @@ package body Memory_Manager_Tests.Implementation is Natural_Assert.Eq (T.Crc_Report_History.Get_Count, 1); Natural_Assert.Eq (T.Memory_Region_Status_History.Get_Count, 1); Natural_Assert.Eq (T.Memory_Location_History.Get_Count, 1); - Virtual_Memory_Region_Crc_Assert.Eq (T.Crc_Report_History.Get (1), (Region => (Address => 0, Length => 0), Crc => (0, 0))); + Virtual_Memory_Region_Crc_Assert.Eq (T.Crc_Report_History.Get (1), (Region => (Address => 0, Length => 0), Crc => [0, 0])); Memory_Manager_State_Assert.Eq (T.Memory_Region_Status_History.Get (1), (State => Available)); Memory_Region_Assert.Eq (T.Memory_Location_History.Get (1), (Memory'Address, Memory'Length)); @@ -142,18 +142,18 @@ package body Memory_Manager_Tests.Implementation is Memory_Manager_State_Assert.Eq (T.Memory_Region_Status_History.Get (2), (State => In_Use)); -- Check the memory region - Byte_Array_Assert.Eq (Memory, (0 .. Memory'Length - 1 => 0)); + Byte_Array_Assert.Eq (Memory, [0 .. Memory'Length - 1 => 0]); -- Fill the pointer: declare use Byte_Array_Pointer.Packed; Ptr : constant Byte_Array_Pointer.Instance := Unpack (Request.Ided_Region.Region); begin - Byte_Array_Pointer.Copy_To (Ptr, (0 .. Memory'Length - 1 => 55)); + Byte_Array_Pointer.Copy_To (Ptr, [0 .. Memory'Length - 1 => 55]); end; -- Check the memory region: - Byte_Array_Assert.Eq (Memory, (0 .. Memory'Length - 1 => 55)); + Byte_Array_Assert.Eq (Memory, [0 .. Memory'Length - 1 => 55]); -- Release the memory region: T.Ided_Memory_Region_T_Release_Reciprocal (Request.Ided_Region); @@ -173,18 +173,18 @@ package body Memory_Manager_Tests.Implementation is Memory_Manager_State_Assert.Eq (T.Memory_Region_Status_History.Get (4), (State => In_Use)); -- Check the memory region - Byte_Array_Assert.Eq (Memory, (0 .. Memory'Length - 1 => 55)); + Byte_Array_Assert.Eq (Memory, [0 .. Memory'Length - 1 => 55]); -- Fill the pointer: declare use Byte_Array_Pointer.Packed; Ptr : constant Byte_Array_Pointer.Instance := Unpack (Request.Ided_Region.Region); begin - Byte_Array_Pointer.Copy_To (Ptr, (0 .. Memory'Length - 1 => 22)); + Byte_Array_Pointer.Copy_To (Ptr, [0 .. Memory'Length - 1 => 22]); end; -- Check the memory region: - Byte_Array_Assert.Eq (Memory, (0 .. Memory'Length - 1 => 22)); + Byte_Array_Assert.Eq (Memory, [0 .. Memory'Length - 1 => 22]); -- Release the memory region: T.Ided_Memory_Region_T_Release_Reciprocal (Request.Ided_Region); @@ -209,7 +209,7 @@ package body Memory_Manager_Tests.Implementation is Natural_Assert.Eq (T.Crc_Report_History.Get_Count, 1); Natural_Assert.Eq (T.Memory_Region_Status_History.Get_Count, 1); Natural_Assert.Eq (T.Memory_Location_History.Get_Count, 1); - Virtual_Memory_Region_Crc_Assert.Eq (T.Crc_Report_History.Get (1), (Region => (Address => 0, Length => 0), Crc => (0, 0))); + Virtual_Memory_Region_Crc_Assert.Eq (T.Crc_Report_History.Get (1), (Region => (Address => 0, Length => 0), Crc => [0, 0])); Memory_Manager_State_Assert.Eq (T.Memory_Region_Status_History.Get (1), (State => Available)); Memory_Region_Assert.Eq (T.Memory_Location_History.Get (1), (Memory'Address, Memory'Length)); @@ -236,18 +236,18 @@ package body Memory_Manager_Tests.Implementation is Memory_Manager_State_Assert.Eq (T.Memory_Region_Status_History.Get (2), (State => In_Use)); -- Check the memory region - Byte_Array_Assert.Eq (Memory, (0 .. Memory'Length - 1 => 0)); + Byte_Array_Assert.Eq (Memory, [0 .. Memory'Length - 1 => 0]); -- Fill the pointer: declare use Byte_Array_Pointer.Packed; Ptr : constant Byte_Array_Pointer.Instance := Unpack (Request.Ided_Region.Region); begin - Byte_Array_Pointer.Copy_To (Ptr, (0 .. Memory'Length - 1 => 22)); + Byte_Array_Pointer.Copy_To (Ptr, [0 .. Memory'Length - 1 => 22]); end; -- Check the memory region: - Byte_Array_Assert.Eq (Memory, (0 .. Memory'Length - 1 => 22)); + Byte_Array_Assert.Eq (Memory, [0 .. Memory'Length - 1 => 22]); -- -- Request the memory region again: @@ -301,7 +301,7 @@ package body Memory_Manager_Tests.Implementation is Dump : Memory_Packetizer_Types.Memory_Dump; begin -- Set bytes to pattern to make testing easier: - Memory := (0 => 0, 1 => 1, 2 => 2, 3 => 3, 4 => 4, 5 => 5, 6 => 6, 7 => 7, 8 => 8, 9 => 9, 10 => 10, 11 => 11, 12 => 12, 13 => 13, 14 => 14, 15 => 15, 16 .. 50 => 33, 51 .. 99 => 55); + Memory := [0 => 0, 1 => 1, 2 => 2, 3 => 3, 4 => 4, 5 => 5, 6 => 6, 7 => 7, 8 => 8, 9 => 9, 10 => 10, 11 => 11, 12 => 12, 13 => 13, 14 => 14, 15 => 15, 16 .. 50 => 33, 51 .. 99 => 55]; -- Send command to dump region: T.Command_T_Send (T.Commands.Dump_Memory_Region); @@ -341,7 +341,7 @@ package body Memory_Manager_Tests.Implementation is -- Check dump id and data: Natural_Assert.Eq (Natural (Dump.Id), Natural (T.Packets.Get_Memory_Region_Packet_Id)); - Byte_Array_Assert.Eq (To_Byte_Array (Dump.Memory_Pointer), (0 => 0, 1 => 1, 2 => 2, 3 => 3, 4 => 4)); + Byte_Array_Assert.Eq (To_Byte_Array (Dump.Memory_Pointer), [0 => 0, 1 => 1, 2 => 2, 3 => 3, 4 => 4]); -- Send command to dump part of region: T.Command_T_Send (T.Commands.Dump_Memory_Region_Bytes ((Address => 13, Length => 8))); @@ -360,7 +360,7 @@ package body Memory_Manager_Tests.Implementation is -- Check dump id and data: Natural_Assert.Eq (Natural (Dump.Id), Natural (T.Packets.Get_Memory_Region_Packet_Id)); - Byte_Array_Assert.Eq (To_Byte_Array (Dump.Memory_Pointer), (0 => 13, 1 => 14, 2 => 15, 3 .. 7 => 33)); + Byte_Array_Assert.Eq (To_Byte_Array (Dump.Memory_Pointer), [0 => 13, 1 => 14, 2 => 15, 3 .. 7 => 33]); -- Send command to dump part of region: T.Command_T_Send (T.Commands.Dump_Memory_Region_Bytes ((Address => 98, Length => 2))); @@ -379,7 +379,7 @@ package body Memory_Manager_Tests.Implementation is -- Check dump id and data: Natural_Assert.Eq (Natural (Dump.Id), Natural (T.Packets.Get_Memory_Region_Packet_Id)); - Byte_Array_Assert.Eq (To_Byte_Array (Dump.Memory_Pointer), (0 => 55, 1 => 55)); + Byte_Array_Assert.Eq (To_Byte_Array (Dump.Memory_Pointer), [0 => 55, 1 => 55]); -- No data products except the ones at initialization. Natural_Assert.Eq (T.Data_Product_T_Recv_Sync_History.Get_Count, 3); @@ -393,7 +393,7 @@ package body Memory_Manager_Tests.Implementation is Natural_Assert.Eq (T.Data_Product_T_Recv_Sync_History.Get_Count, 3); -- Set bytes to pattern to make testing easier: - Memory := (0 => 0, 1 => 1, 2 => 2, 3 => 3, 4 => 4, 5 => 5, 6 => 6, 7 => 7, 8 => 8, 9 => 9, 10 => 10, 11 => 11, 12 => 12, 13 => 13, 14 => 14, 15 => 15, 16 .. 50 => 33, 51 .. 99 => 55); + Memory := [0 => 0, 1 => 1, 2 => 2, 3 => 3, 4 => 4, 5 => 5, 6 => 6, 7 => 7, 8 => 8, 9 => 9, 10 => 10, 11 => 11, 12 => 12, 13 => 13, 14 => 14, 15 => 15, 16 .. 50 => 33, 51 .. 99 => 55]; -- Send command to dump region: T.Command_T_Send (T.Commands.Crc_Memory_Region_Bytes ((Address => 0, Length => Memory'Length))); @@ -480,7 +480,7 @@ package body Memory_Manager_Tests.Implementation is Cmd : Command.T; begin -- Send command to write start of region: - pragma Assert (T.Commands.Write_Memory_Region ((Address => 0, Length => 5, Data => (others => 15)), Cmd) = Success); + pragma Assert (T.Commands.Write_Memory_Region ((Address => 0, Length => 5, Data => [others => 15]), Cmd) = Success); T.Command_T_Send (Cmd); Natural_Assert.Eq (T.Dispatch_All, 1); Natural_Assert.Eq (T.Command_Response_T_Recv_Sync_History.Get_Count, 1); @@ -494,11 +494,11 @@ package body Memory_Manager_Tests.Implementation is Virtual_Memory_Region_Assert.Eq (T.Memory_Written_History.Get (1), (Address => 0, Length => 5)); -- Check the memory region to make sure it was written to: - Byte_Array_Assert.Eq (Memory (0 .. 4), (0 .. 4 => 15)); - Byte_Array_Assert.Eq (Memory (5 .. Memory'Last), (5 .. Memory'Last => 0)); + Byte_Array_Assert.Eq (Memory (0 .. 4), [0 .. 4 => 15]); + Byte_Array_Assert.Eq (Memory (5 .. Memory'Last), [5 .. Memory'Last => 0]); -- Send command to write middle of region: - pragma Assert (T.Commands.Write_Memory_Region ((Address => 40, Length => 11, Data => (others => 12)), Cmd) = Success); + pragma Assert (T.Commands.Write_Memory_Region ((Address => 40, Length => 11, Data => [others => 12]), Cmd) = Success); T.Command_T_Send (Cmd); Natural_Assert.Eq (T.Dispatch_All, 1); Natural_Assert.Eq (T.Command_Response_T_Recv_Sync_History.Get_Count, 2); @@ -512,12 +512,12 @@ package body Memory_Manager_Tests.Implementation is Virtual_Memory_Region_Assert.Eq (T.Memory_Written_History.Get (2), (Address => 40, Length => 11)); -- Check the memory region to make sure it was written to: - Byte_Array_Assert.Eq (Memory (0 .. 4), (0 .. 4 => 15)); - Byte_Array_Assert.Eq (Memory (40 .. 50), (40 .. 50 => 12)); - Byte_Array_Assert.Eq (Memory (51 .. Memory'Last), (51 .. Memory'Last => 0)); + Byte_Array_Assert.Eq (Memory (0 .. 4), [0 .. 4 => 15]); + Byte_Array_Assert.Eq (Memory (40 .. 50), [40 .. 50 => 12]); + Byte_Array_Assert.Eq (Memory (51 .. Memory'Last), [51 .. Memory'Last => 0]); -- Send command to write end of region: - pragma Assert (T.Commands.Write_Memory_Region ((Address => 98, Length => 2, Data => (others => 44)), Cmd) = Success); + pragma Assert (T.Commands.Write_Memory_Region ((Address => 98, Length => 2, Data => [others => 44]), Cmd) = Success); T.Command_T_Send (Cmd); Natural_Assert.Eq (T.Dispatch_All, 1); Natural_Assert.Eq (T.Command_Response_T_Recv_Sync_History.Get_Count, 3); @@ -531,13 +531,13 @@ package body Memory_Manager_Tests.Implementation is Virtual_Memory_Region_Assert.Eq (T.Memory_Written_History.Get (3), (Address => 98, Length => 2)); -- Check the memory region to make sure it was written to: - Byte_Array_Assert.Eq (Memory (0 .. 4), (0 .. 4 => 15)); - Byte_Array_Assert.Eq (Memory (40 .. 50), (40 .. 50 => 12)); - Byte_Array_Assert.Eq (Memory (51 .. Memory'Last - 2), (51 .. Memory'Last - 2 => 0)); - Byte_Array_Assert.Eq (Memory (98 .. Memory'Last), (98 .. Memory'Last => 44)); + Byte_Array_Assert.Eq (Memory (0 .. 4), [0 .. 4 => 15]); + Byte_Array_Assert.Eq (Memory (40 .. 50), [40 .. 50 => 12]); + Byte_Array_Assert.Eq (Memory (51 .. Memory'Last - 2), [51 .. Memory'Last - 2 => 0]); + Byte_Array_Assert.Eq (Memory (98 .. Memory'Last), [98 .. Memory'Last => 44]); -- Send command to write end of region: - pragma Assert (T.Commands.Write_Memory_Region ((Address => 98, Length => 1, Data => (others => 18)), Cmd) = Success); + pragma Assert (T.Commands.Write_Memory_Region ((Address => 98, Length => 1, Data => [others => 18]), Cmd) = Success); T.Command_T_Send (Cmd); Natural_Assert.Eq (T.Dispatch_All, 1); Natural_Assert.Eq (T.Command_Response_T_Recv_Sync_History.Get_Count, 4); @@ -551,11 +551,11 @@ package body Memory_Manager_Tests.Implementation is Virtual_Memory_Region_Assert.Eq (T.Memory_Written_History.Get (4), (Address => 98, Length => 1)); -- Check the memory region to make sure it was written to: - Byte_Array_Assert.Eq (Memory (0 .. 4), (0 .. 4 => 15)); - Byte_Array_Assert.Eq (Memory (40 .. 50), (40 .. 50 => 12)); - Byte_Array_Assert.Eq (Memory (51 .. Memory'Last - 2), (51 .. Memory'Last - 2 => 0)); - Byte_Array_Assert.Eq (Memory (98 .. 98), (98 .. 98 => 18)); - Byte_Array_Assert.Eq (Memory (99 .. Memory'Last), (99 .. Memory'Last => 44)); + Byte_Array_Assert.Eq (Memory (0 .. 4), [0 .. 4 => 15]); + Byte_Array_Assert.Eq (Memory (40 .. 50), [40 .. 50 => 12]); + Byte_Array_Assert.Eq (Memory (51 .. Memory'Last - 2), [51 .. Memory'Last - 2 => 0]); + Byte_Array_Assert.Eq (Memory (98 .. 98), [98 .. 98 => 18]); + Byte_Array_Assert.Eq (Memory (99 .. Memory'Last), [99 .. Memory'Last => 44]); end Test_Nominal_Memory_Write; overriding procedure Test_Write_Unreleased_Region (Self : in out Instance) is @@ -574,7 +574,7 @@ package body Memory_Manager_Tests.Implementation is Memory_Manager_State_Assert.Eq (T.Memory_Region_Status_History.Get (2), (State => In_Use)); -- Send command to write start of region, expect failure: - pragma Assert (T.Commands.Write_Memory_Region ((Address => 0, Length => 5, Data => (others => 15)), Cmd) = Success); + pragma Assert (T.Commands.Write_Memory_Region ((Address => 0, Length => 5, Data => [others => 15]), Cmd) = Success); T.Command_T_Send (Cmd); Natural_Assert.Eq (T.Dispatch_All, 1); Natural_Assert.Eq (T.Command_Response_T_Recv_Sync_History.Get_Count, 1); @@ -587,7 +587,7 @@ package body Memory_Manager_Tests.Implementation is Natural_Assert.Eq (T.Memory_Unavailable_History.Get_Count, 1); -- Check the memory region to make sure it was written to: - Byte_Array_Assert.Eq (Memory (0 .. Memory'Last), (0 .. Memory'Last => 0)); + Byte_Array_Assert.Eq (Memory (0 .. Memory'Last), [0 .. Memory'Last => 0]); -- Now release the region so it becomes available. T.Ided_Memory_Region_T_Release_Reciprocal (Request.Ided_Region); @@ -598,7 +598,7 @@ package body Memory_Manager_Tests.Implementation is Memory_Manager_State_Assert.Eq (T.Memory_Region_Status_History.Get (3), (State => Available)); -- Send command to write start of region, expect success: - pragma Assert (T.Commands.Write_Memory_Region ((Address => 0, Length => 5, Data => (others => 15)), Cmd) = Success); + pragma Assert (T.Commands.Write_Memory_Region ((Address => 0, Length => 5, Data => [others => 15]), Cmd) = Success); T.Command_T_Send (Cmd); Natural_Assert.Eq (T.Dispatch_All, 1); Natural_Assert.Eq (T.Command_Response_T_Recv_Sync_History.Get_Count, 2); @@ -613,8 +613,8 @@ package body Memory_Manager_Tests.Implementation is Virtual_Memory_Region_Assert.Eq (T.Memory_Written_History.Get (1), (Address => 0, Length => 5)); -- Check the memory region to make sure it was written to: - Byte_Array_Assert.Eq (Memory (0 .. 4), (0 .. 4 => 15)); - Byte_Array_Assert.Eq (Memory (5 .. Memory'Last), (5 .. Memory'Last => 0)); + Byte_Array_Assert.Eq (Memory (0 .. 4), [0 .. 4 => 15]); + Byte_Array_Assert.Eq (Memory (5 .. Memory'Last), [5 .. Memory'Last => 0]); end Test_Write_Unreleased_Region; overriding procedure Test_Dump_Invalid_Region (Self : in out Instance) is @@ -737,8 +737,8 @@ package body Memory_Manager_Tests.Implementation is begin -- Send command to write part too big of region: declare - Bytes : constant Virtual_Memory_Region_Write.Serialization.Byte_Array := (0, 0, 0, 0, 100, 100, others => 255); - Temp : constant Virtual_Memory_Region_Write.T := (0, 0, (others => 0)); + Bytes : constant Virtual_Memory_Region_Write.Serialization.Byte_Array := [0, 0, 0, 0, 100, 100, others => 255]; + Temp : constant Virtual_Memory_Region_Write.T := (0, 0, [others => 0]); begin pragma Assert (T.Commands.Write_Memory_Region (Temp, Cmd) = Success); -- Overwrite with invalid bytes. @@ -752,10 +752,10 @@ package body Memory_Manager_Tests.Implementation is -- Make sure some events were thrown: Natural_Assert.Eq (T.Event_T_Recv_Sync_History.Get_Count, 1); Natural_Assert.Eq (T.Invalid_Command_Received_History.Get_Count, 1); - Invalid_Command_Info_Assert.Eq (T.Invalid_Command_Received_History.Get (1), (Id => T.Commands.Get_Write_Memory_Region_Id, Errant_Field_Number => Interfaces.Unsigned_32'Last, Errant_Field => (0, 0, 0, 0, 0, 0, 0, 6))); + Invalid_Command_Info_Assert.Eq (T.Invalid_Command_Received_History.Get (1), (Id => T.Commands.Get_Write_Memory_Region_Id, Errant_Field_Number => Interfaces.Unsigned_32'Last, Errant_Field => [0, 0, 0, 0, 0, 0, 0, 6])); -- Send command to write part of region: - pragma Assert (T.Commands.Write_Memory_Region ((Address => 100, Length => 0, Data => (others => 255)), Cmd) = Success); + pragma Assert (T.Commands.Write_Memory_Region ((Address => 100, Length => 0, Data => [others => 255]), Cmd) = Success); T.Command_T_Send (Cmd); Natural_Assert.Eq (T.Dispatch_All, 1); Natural_Assert.Eq (T.Command_Response_T_Recv_Sync_History.Get_Count, 2); @@ -767,7 +767,7 @@ package body Memory_Manager_Tests.Implementation is Invalid_Virtual_Memory_Region_Assert.Eq (T.Invalid_Memory_Region_History.Get (1), (Invalid_Region => (Address => 100, Length => 0), Managed_Region => (Address => 0, Length => Memory'Length))); -- Send command to write part of region: - pragma Assert (T.Commands.Write_Memory_Region ((Address => 50, Length => 51, Data => (others => 255)), Cmd) = Success); + pragma Assert (T.Commands.Write_Memory_Region ((Address => 50, Length => 51, Data => [others => 255]), Cmd) = Success); T.Command_T_Send (Cmd); Natural_Assert.Eq (T.Dispatch_All, 1); Natural_Assert.Eq (T.Command_Response_T_Recv_Sync_History.Get_Count, 3); @@ -779,7 +779,7 @@ package body Memory_Manager_Tests.Implementation is Invalid_Virtual_Memory_Region_Assert.Eq (T.Invalid_Memory_Region_History.Get (2), (Invalid_Region => (Address => 50, Length => 51), Managed_Region => (Address => 0, Length => Memory'Length))); -- Send command to write part of region: - pragma Assert (T.Commands.Write_Memory_Region ((Address => 0, Length => 0, Data => (others => 255)), Cmd) = Success); + pragma Assert (T.Commands.Write_Memory_Region ((Address => 0, Length => 0, Data => [others => 255]), Cmd) = Success); T.Command_T_Send (Cmd); Natural_Assert.Eq (T.Dispatch_All, 1); Natural_Assert.Eq (T.Command_Response_T_Recv_Sync_History.Get_Count, 4); @@ -794,7 +794,7 @@ package body Memory_Manager_Tests.Implementation is Natural_Assert.Eq (T.Data_Product_T_Recv_Sync_History.Get_Count, 3); -- Check the memory region to make sure it was never written to: - Byte_Array_Assert.Eq (Memory, (0 .. Memory'Length - 1 => 0)); + Byte_Array_Assert.Eq (Memory, [0 .. Memory'Length - 1 => 0]); end Test_Write_Invalid_Region; overriding procedure Test_Force_Release_Command (Self : in out Instance) is @@ -805,7 +805,7 @@ package body Memory_Manager_Tests.Implementation is Natural_Assert.Eq (T.Data_Product_T_Recv_Sync_History.Get_Count, 3); Natural_Assert.Eq (T.Crc_Report_History.Get_Count, 1); Natural_Assert.Eq (T.Memory_Region_Status_History.Get_Count, 1); - Virtual_Memory_Region_Crc_Assert.Eq (T.Crc_Report_History.Get (1), (Region => (Address => 0, Length => 0), Crc => (0, 0))); + Virtual_Memory_Region_Crc_Assert.Eq (T.Crc_Report_History.Get (1), (Region => (Address => 0, Length => 0), Crc => [0, 0])); Memory_Manager_State_Assert.Eq (T.Memory_Region_Status_History.Get (1), (State => Available)); -- Send command to force release region: @@ -909,7 +909,7 @@ package body Memory_Manager_Tests.Implementation is -- Make sure some events were thrown: Natural_Assert.Eq (T.Event_T_Recv_Sync_History.Get_Count, 1); Natural_Assert.Eq (T.Invalid_Command_Received_History.Get_Count, 1); - Invalid_Command_Info_Assert.Eq (T.Invalid_Command_Received_History.Get (1), (Id => T.Commands.Get_Force_Release_Id, Errant_Field_Number => Interfaces.Unsigned_32'Last, Errant_Field => (0, 0, 0, 0, 0, 0, 0, 13))); + Invalid_Command_Info_Assert.Eq (T.Invalid_Command_Received_History.Get (1), (Id => T.Commands.Get_Force_Release_Id, Errant_Field_Number => Interfaces.Unsigned_32'Last, Errant_Field => [0, 0, 0, 0, 0, 0, 0, 13])); end Test_Invalid_Command; end Memory_Manager_Tests.Implementation; diff --git a/src/components/memory_packetizer/component-memory_packetizer-implementation.adb b/src/components/memory_packetizer/component-memory_packetizer-implementation.adb index 429f9d76..5a34713d 100644 --- a/src/components/memory_packetizer/component-memory_packetizer-implementation.adb +++ b/src/components/memory_packetizer/component-memory_packetizer-implementation.adb @@ -154,7 +154,7 @@ package body Component.Memory_Packetizer.Implementation is Sequence_Count => Sequence_Count, Buffer_Length => Buffer_Length + Mem_Header_Length ), - Buffer => (others => 0) + Buffer => [others => 0] ); begin -- Serialize the slice into a memory region packed record that includes address and length information: diff --git a/src/components/memory_packetizer/test/memory_packetizer_tests-implementation.adb b/src/components/memory_packetizer/test/memory_packetizer_tests-implementation.adb index e50dc829..b37283f8 100644 --- a/src/components/memory_packetizer/test/memory_packetizer_tests-implementation.adb +++ b/src/components/memory_packetizer/test/memory_packetizer_tests-implementation.adb @@ -61,15 +61,15 @@ package body Memory_Packetizer_Tests.Implementation is A_Packet : Packet.T; Mem_Region_Length : constant Natural := Memory_Region.Serialization.Serialized_Length; Packet_Data_Length : constant Natural := A_Packet.Buffer'Length - Mem_Region_Length; - Bytes : aliased Basic_Types.Byte_Array := (0 .. 4 * Packet_Data_Length - Packet_Data_Length / 2 - 1 => 0); + Bytes : aliased Basic_Types.Byte_Array := [0 .. 4 * Packet_Data_Length - Packet_Data_Length / 2 - 1 => 0]; Dump_1 : constant Memory_Packetizer_Types.Memory_Dump := (Id => 7, Memory_Pointer => From_Address (Bytes'Address, Bytes'Length)); Dump_2 : constant Memory_Packetizer_Types.Memory_Dump := (Id => 28, Memory_Pointer => From_Address (Bytes'Address, Bytes'Length)); begin -- Fill the byte array: - Bytes (0 .. Packet_Data_Length - 1) := (others => 9); - Bytes (Packet_Data_Length .. 2 * Packet_Data_Length - 1) := (others => 10); - Bytes (2 * Packet_Data_Length .. 3 * Packet_Data_Length - 1) := (others => 11); - Bytes (3 * Packet_Data_Length .. 4 * Packet_Data_Length - Packet_Data_Length / 2 - 1) := (others => 12); + Bytes (0 .. Packet_Data_Length - 1) := [others => 9]; + Bytes (Packet_Data_Length .. 2 * Packet_Data_Length - 1) := [others => 10]; + Bytes (2 * Packet_Data_Length .. 3 * Packet_Data_Length - 1) := [others => 11]; + Bytes (3 * Packet_Data_Length .. 4 * Packet_Data_Length - Packet_Data_Length / 2 - 1) := [others => 12]; -- Send two memory dumps: T.Memory_Dump_Send (Dump_1); @@ -111,14 +111,14 @@ package body Memory_Packetizer_Tests.Implementation is Natural_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (8).Header.Buffer_Length, Packet_Data_Length / 2 + Memory_Region.Serialization.Serialized_Length); -- Check packet contents: - Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (1).Buffer (Mem_Region_Length .. A_Packet.Buffer'Last), (0 .. Packet_Data_Length - 1 => 9)); - Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (2).Buffer (Mem_Region_Length .. A_Packet.Buffer'Last), (0 .. Packet_Data_Length - 1 => 10)); - Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (3).Buffer (Mem_Region_Length .. A_Packet.Buffer'Last), (0 .. Packet_Data_Length - 1 => 11)); - Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (4).Buffer (Mem_Region_Length .. T.Packet_T_Recv_Sync_History.Get (4).Header.Buffer_Length - 1), (0 .. Packet_Data_Length / 2 - 1 => 12)); - Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (5).Buffer (Mem_Region_Length .. A_Packet.Buffer'Last), (0 .. Packet_Data_Length - 1 => 9)); - Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (6).Buffer (Mem_Region_Length .. A_Packet.Buffer'Last), (0 .. Packet_Data_Length - 1 => 10)); - Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (7).Buffer (Mem_Region_Length .. A_Packet.Buffer'Last), (0 .. Packet_Data_Length - 1 => 11)); - Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (8).Buffer (Mem_Region_Length .. T.Packet_T_Recv_Sync_History.Get (8).Header.Buffer_Length - 1), (0 .. Packet_Data_Length / 2 - 1 => 12)); + Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (1).Buffer (Mem_Region_Length .. A_Packet.Buffer'Last), [0 .. Packet_Data_Length - 1 => 9]); + Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (2).Buffer (Mem_Region_Length .. A_Packet.Buffer'Last), [0 .. Packet_Data_Length - 1 => 10]); + Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (3).Buffer (Mem_Region_Length .. A_Packet.Buffer'Last), [0 .. Packet_Data_Length - 1 => 11]); + Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (4).Buffer (Mem_Region_Length .. T.Packet_T_Recv_Sync_History.Get (4).Header.Buffer_Length - 1), [0 .. Packet_Data_Length / 2 - 1 => 12]); + Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (5).Buffer (Mem_Region_Length .. A_Packet.Buffer'Last), [0 .. Packet_Data_Length - 1 => 9]); + Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (6).Buffer (Mem_Region_Length .. A_Packet.Buffer'Last), [0 .. Packet_Data_Length - 1 => 10]); + Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (7).Buffer (Mem_Region_Length .. A_Packet.Buffer'Last), [0 .. Packet_Data_Length - 1 => 11]); + Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (8).Buffer (Mem_Region_Length .. T.Packet_T_Recv_Sync_History.Get (8).Header.Buffer_Length - 1), [0 .. Packet_Data_Length / 2 - 1 => 12]); -- Check packet address and length headers: Memory_Region_Assert.Eq (Memory_Region.Serialization.From_Byte_Array (T.Packet_T_Recv_Sync_History.Get (1).Buffer (0 .. Mem_Region_Length - 1)), (Bytes'Address, Packet_Data_Length)); @@ -171,10 +171,10 @@ package body Memory_Packetizer_Tests.Implementation is end; -- Fill the byte array: - Bytes (0 .. Packet_Data_Length - 1) := (others => 7); - Bytes (Packet_Data_Length .. 2 * Packet_Data_Length - 1) := (others => 6); - Bytes (2 * Packet_Data_Length .. 3 * Packet_Data_Length - 1) := (others => 5); - Bytes (3 * Packet_Data_Length .. 4 * Packet_Data_Length - Packet_Data_Length / 2 - 1) := (others => 4); + Bytes (0 .. Packet_Data_Length - 1) := [others => 7]; + Bytes (Packet_Data_Length .. 2 * Packet_Data_Length - 1) := [others => 6]; + Bytes (2 * Packet_Data_Length .. 3 * Packet_Data_Length - 1) := [others => 5]; + Bytes (3 * Packet_Data_Length .. 4 * Packet_Data_Length - Packet_Data_Length / 2 - 1) := [others => 4]; -- Delay 5 seconds to simulate low packet load: declare @@ -224,14 +224,14 @@ package body Memory_Packetizer_Tests.Implementation is Natural_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (16).Header.Buffer_Length, Packet_Data_Length / 2 + Memory_Region.Serialization.Serialized_Length); -- Check packet contents: - Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (9).Buffer (Mem_Region_Length .. A_Packet.Buffer'Last), (0 .. Packet_Data_Length - 1 => 7)); - Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (10).Buffer (Mem_Region_Length .. A_Packet.Buffer'Last), (0 .. Packet_Data_Length - 1 => 6)); - Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (11).Buffer (Mem_Region_Length .. A_Packet.Buffer'Last), (0 .. Packet_Data_Length - 1 => 5)); - Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (12).Buffer (Mem_Region_Length .. T.Packet_T_Recv_Sync_History.Get (4).Header.Buffer_Length - 1), (0 .. Packet_Data_Length / 2 - 1 => 4)); - Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (13).Buffer (Mem_Region_Length .. A_Packet.Buffer'Last), (0 .. Packet_Data_Length - 1 => 7)); - Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (14).Buffer (Mem_Region_Length .. A_Packet.Buffer'Last), (0 .. Packet_Data_Length - 1 => 6)); - Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (15).Buffer (Mem_Region_Length .. A_Packet.Buffer'Last), (0 .. Packet_Data_Length - 1 => 5)); - Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (16).Buffer (Mem_Region_Length .. T.Packet_T_Recv_Sync_History.Get (8).Header.Buffer_Length - 1), (0 .. Packet_Data_Length / 2 - 1 => 4)); + Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (9).Buffer (Mem_Region_Length .. A_Packet.Buffer'Last), [0 .. Packet_Data_Length - 1 => 7]); + Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (10).Buffer (Mem_Region_Length .. A_Packet.Buffer'Last), [0 .. Packet_Data_Length - 1 => 6]); + Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (11).Buffer (Mem_Region_Length .. A_Packet.Buffer'Last), [0 .. Packet_Data_Length - 1 => 5]); + Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (12).Buffer (Mem_Region_Length .. T.Packet_T_Recv_Sync_History.Get (4).Header.Buffer_Length - 1), [0 .. Packet_Data_Length / 2 - 1 => 4]); + Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (13).Buffer (Mem_Region_Length .. A_Packet.Buffer'Last), [0 .. Packet_Data_Length - 1 => 7]); + Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (14).Buffer (Mem_Region_Length .. A_Packet.Buffer'Last), [0 .. Packet_Data_Length - 1 => 6]); + Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (15).Buffer (Mem_Region_Length .. A_Packet.Buffer'Last), [0 .. Packet_Data_Length - 1 => 5]); + Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (16).Buffer (Mem_Region_Length .. T.Packet_T_Recv_Sync_History.Get (8).Header.Buffer_Length - 1), [0 .. Packet_Data_Length / 2 - 1 => 4]); -- Check packet address and length headers: Memory_Region_Assert.Eq (Memory_Region.Serialization.From_Byte_Array (T.Packet_T_Recv_Sync_History.Get (9).Buffer (0 .. Mem_Region_Length - 1)), (Bytes'Address, Packet_Data_Length)); @@ -292,7 +292,7 @@ package body Memory_Packetizer_Tests.Implementation is A_Packet : Packet.T; Mem_Region_Length : constant Natural := Memory_Region.Serialization.Serialized_Length; Packet_Data_Length : constant Natural := A_Packet.Buffer'Length - Mem_Region_Length; - Bytes : aliased Basic_Types.Byte_Array := (0 .. 4 * Packet_Data_Length - Packet_Data_Length / 2 - 1 => 0); + Bytes : aliased Basic_Types.Byte_Array := [0 .. 4 * Packet_Data_Length - Packet_Data_Length / 2 - 1 => 0]; Dump_1 : constant Memory_Packetizer_Types.Memory_Dump := (Id => 4, Memory_Pointer => From_Address (Bytes'Address, Bytes'Length)); begin -- Check data product at start: @@ -333,10 +333,10 @@ package body Memory_Packetizer_Tests.Implementation is Packets_Per_Period_Assert.Eq (T.Max_Packets_Per_Time_Period_History.Get (3), (Max_Packets => 1, Period => 3)); -- Fill the byte array: - Bytes (0 .. Packet_Data_Length - 1) := (others => 9); - Bytes (Packet_Data_Length .. 2 * Packet_Data_Length - 1) := (others => 10); - Bytes (2 * Packet_Data_Length .. 3 * Packet_Data_Length - 1) := (others => 11); - Bytes (3 * Packet_Data_Length .. 4 * Packet_Data_Length - Packet_Data_Length / 2 - 1) := (others => 12); + Bytes (0 .. Packet_Data_Length - 1) := [others => 9]; + Bytes (Packet_Data_Length .. 2 * Packet_Data_Length - 1) := [others => 10]; + Bytes (2 * Packet_Data_Length .. 3 * Packet_Data_Length - 1) := [others => 11]; + Bytes (3 * Packet_Data_Length .. 4 * Packet_Data_Length - Packet_Data_Length / 2 - 1) := [others => 12]; -- Send two memory dumps: T.Memory_Dump_Send (Dump_1); @@ -367,10 +367,10 @@ package body Memory_Packetizer_Tests.Implementation is Natural_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (4).Header.Buffer_Length, Packet_Data_Length / 2 + Memory_Region.Serialization.Serialized_Length); -- Check packet contents: - Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (1).Buffer (Mem_Region_Length .. A_Packet.Buffer'Last), (0 .. Packet_Data_Length - 1 => 9)); - Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (2).Buffer (Mem_Region_Length .. A_Packet.Buffer'Last), (0 .. Packet_Data_Length - 1 => 10)); - Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (3).Buffer (Mem_Region_Length .. A_Packet.Buffer'Last), (0 .. Packet_Data_Length - 1 => 11)); - Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (4).Buffer (Mem_Region_Length .. T.Packet_T_Recv_Sync_History.Get (4).Header.Buffer_Length - 1), (0 .. Packet_Data_Length / 2 - 1 => 12)); + Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (1).Buffer (Mem_Region_Length .. A_Packet.Buffer'Last), [0 .. Packet_Data_Length - 1 => 9]); + Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (2).Buffer (Mem_Region_Length .. A_Packet.Buffer'Last), [0 .. Packet_Data_Length - 1 => 10]); + Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (3).Buffer (Mem_Region_Length .. A_Packet.Buffer'Last), [0 .. Packet_Data_Length - 1 => 11]); + Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (4).Buffer (Mem_Region_Length .. T.Packet_T_Recv_Sync_History.Get (4).Header.Buffer_Length - 1), [0 .. Packet_Data_Length / 2 - 1 => 12]); -- Check packet timing: declare @@ -420,7 +420,7 @@ package body Memory_Packetizer_Tests.Implementation is overriding procedure Test_Invalid_Command (Self : in out Instance) is T : Component.Memory_Packetizer.Implementation.Tester.Instance_Access renames Self.Tester; - Bytes : constant Packets_Per_Period.Serialization.Byte_Array := (others => 0); + Bytes : constant Packets_Per_Period.Serialization.Byte_Array := [others => 0]; begin -- Send an invalid command, we need to use serialization to avoid a constraint error. T.Command_T_Send (T.Commands.Set_Max_Packet_Rate (Packets_Per_Period.Serialization.From_Byte_Array (Bytes))); @@ -437,14 +437,14 @@ package body Memory_Packetizer_Tests.Implementation is Natural_Assert.Eq (T.Event_T_Recv_Sync_History.Get_Count, 1); Natural_Assert.Eq (T.Max_Packet_Rate_Set_History.Get_Count, 0); Natural_Assert.Eq (T.Invalid_Command_Received_History.Get_Count, 1); - Invalid_Command_Info_Assert.Eq (T.Invalid_Command_Received_History.Get (1), (Id => T.Commands.Get_Set_Max_Packet_Rate_Id, Errant_Field_Number => 2, Errant_Field => (0, 0, 0, 0, 0, 0, 0, 0))); + Invalid_Command_Info_Assert.Eq (T.Invalid_Command_Received_History.Get (1), (Id => T.Commands.Get_Set_Max_Packet_Rate_Id, Errant_Field_Number => 2, Errant_Field => [0, 0, 0, 0, 0, 0, 0, 0])); end Test_Invalid_Command; overriding procedure Test_Memory_Dump_Dropped (Self : in out Instance) is use Byte_Array_Pointer; T : Component.Memory_Packetizer.Implementation.Tester.Instance_Access renames Self.Tester; A_Packet : Packet.T; - Bytes : aliased Basic_Types.Byte_Array := (0 .. 4 * A_Packet.Buffer'Length - A_Packet.Buffer'Length / 2 - 1 => 0); + Bytes : aliased Basic_Types.Byte_Array := [0 .. 4 * A_Packet.Buffer'Length - A_Packet.Buffer'Length / 2 - 1 => 0]; Dump_1 : constant Memory_Packetizer_Types.Memory_Dump := (Id => 1, Memory_Pointer => From_Address (Bytes'Address, Bytes'Length)); Dump_2 : constant Memory_Packetizer_Types.Memory_Dump := (Id => 2, Memory_Pointer => From_Address (Bytes'Address, Bytes'Length)); Dump_3 : constant Memory_Packetizer_Types.Memory_Dump := (Id => 3, Memory_Pointer => From_Address (Bytes'Address, Bytes'Length)); @@ -491,12 +491,12 @@ package body Memory_Packetizer_Tests.Implementation is A_Packet : Packet.T; Mem_Region_Length : constant Natural := Memory_Region.Serialization.Serialized_Length; Packet_Data_Length : constant Natural := A_Packet.Buffer'Length - Mem_Region_Length; - Bytes : aliased Basic_Types.Byte_Array := (0 .. 15 => 9); + Bytes : aliased Basic_Types.Byte_Array := [0 .. 15 => 9]; Dump_1 : constant Memory_Packetizer_Types.Memory_Dump := (Id => 1, Memory_Pointer => From_Address (Bytes'Address, Bytes'Length)); Dump_2 : constant Memory_Packetizer_Types.Memory_Dump := (Id => 2, Memory_Pointer => From_Address (Bytes'Address, Bytes'Length)); Dump_3 : constant Memory_Packetizer_Types.Memory_Dump := (Id => 3, Memory_Pointer => From_Address (Bytes'Address, Bytes'Length)); Dump_4 : constant Memory_Packetizer_Types.Memory_Dump := (Id => 4, Memory_Pointer => From_Address (Bytes'Address, Bytes'Length)); - Bytes_2 : aliased Basic_Types.Byte_Array := (0 .. 2 * Packet_Data_Length - 1 => 8); + Bytes_2 : aliased Basic_Types.Byte_Array := [0 .. 2 * Packet_Data_Length - 1 => 8]; Dump_5 : constant Memory_Packetizer_Types.Memory_Dump := (Id => 1, Memory_Pointer => From_Address (Bytes_2'Address, Bytes_2'Length)); Dump_6 : constant Memory_Packetizer_Types.Memory_Dump := (Id => 2, Memory_Pointer => From_Address (Bytes_2'Address, Bytes_2'Length)); Dump_7 : constant Memory_Packetizer_Types.Memory_Dump := (Id => 3, Memory_Pointer => From_Address (Bytes_2'Address, Bytes_2'Length)); @@ -539,10 +539,10 @@ package body Memory_Packetizer_Tests.Implementation is end loop; -- Check packet contents: - Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (1).Buffer (Mem_Region_Length .. T.Packet_T_Recv_Sync_History.Get (1).Header.Buffer_Length - 1), (0 .. 15 => 9)); - Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (2).Buffer (Mem_Region_Length .. T.Packet_T_Recv_Sync_History.Get (2).Header.Buffer_Length - 1), (0 .. 15 => 9)); - Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (3).Buffer (Mem_Region_Length .. T.Packet_T_Recv_Sync_History.Get (3).Header.Buffer_Length - 1), (0 .. 15 => 9)); - Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (4).Buffer (Mem_Region_Length .. T.Packet_T_Recv_Sync_History.Get (4).Header.Buffer_Length - 1), (0 .. 15 => 9)); + Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (1).Buffer (Mem_Region_Length .. T.Packet_T_Recv_Sync_History.Get (1).Header.Buffer_Length - 1), [0 .. 15 => 9]); + Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (2).Buffer (Mem_Region_Length .. T.Packet_T_Recv_Sync_History.Get (2).Header.Buffer_Length - 1), [0 .. 15 => 9]); + Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (3).Buffer (Mem_Region_Length .. T.Packet_T_Recv_Sync_History.Get (3).Header.Buffer_Length - 1), [0 .. 15 => 9]); + Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (4).Buffer (Mem_Region_Length .. T.Packet_T_Recv_Sync_History.Get (4).Header.Buffer_Length - 1), [0 .. 15 => 9]); -- Send memory dumps to fill up queue: T.Memory_Dump_Send (Dump_5); @@ -591,14 +591,14 @@ package body Memory_Packetizer_Tests.Implementation is end loop; -- Check packet contents: - Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (5).Buffer (Mem_Region_Length .. T.Packet_T_Recv_Sync_History.Get (5).Header.Buffer_Length - 1), (0 .. Packet_Data_Length - 1 => 8)); - Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (6).Buffer (Mem_Region_Length .. T.Packet_T_Recv_Sync_History.Get (6).Header.Buffer_Length - 1), (0 .. Packet_Data_Length - 1 => 8)); - Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (7).Buffer (Mem_Region_Length .. T.Packet_T_Recv_Sync_History.Get (7).Header.Buffer_Length - 1), (0 .. Packet_Data_Length - 1 => 8)); - Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (8).Buffer (Mem_Region_Length .. T.Packet_T_Recv_Sync_History.Get (8).Header.Buffer_Length - 1), (0 .. Packet_Data_Length - 1 => 8)); - Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (9).Buffer (Mem_Region_Length .. T.Packet_T_Recv_Sync_History.Get (9).Header.Buffer_Length - 1), (0 .. Packet_Data_Length - 1 => 8)); - Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (10).Buffer (Mem_Region_Length .. T.Packet_T_Recv_Sync_History.Get (10).Header.Buffer_Length - 1), (0 .. Packet_Data_Length - 1 => 8)); - Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (11).Buffer (Mem_Region_Length .. T.Packet_T_Recv_Sync_History.Get (11).Header.Buffer_Length - 1), (0 .. Packet_Data_Length - 1 => 8)); - Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (12).Buffer (Mem_Region_Length .. T.Packet_T_Recv_Sync_History.Get (12).Header.Buffer_Length - 1), (0 .. Packet_Data_Length - 1 => 8)); + Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (5).Buffer (Mem_Region_Length .. T.Packet_T_Recv_Sync_History.Get (5).Header.Buffer_Length - 1), [0 .. Packet_Data_Length - 1 => 8]); + Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (6).Buffer (Mem_Region_Length .. T.Packet_T_Recv_Sync_History.Get (6).Header.Buffer_Length - 1), [0 .. Packet_Data_Length - 1 => 8]); + Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (7).Buffer (Mem_Region_Length .. T.Packet_T_Recv_Sync_History.Get (7).Header.Buffer_Length - 1), [0 .. Packet_Data_Length - 1 => 8]); + Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (8).Buffer (Mem_Region_Length .. T.Packet_T_Recv_Sync_History.Get (8).Header.Buffer_Length - 1), [0 .. Packet_Data_Length - 1 => 8]); + Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (9).Buffer (Mem_Region_Length .. T.Packet_T_Recv_Sync_History.Get (9).Header.Buffer_Length - 1), [0 .. Packet_Data_Length - 1 => 8]); + Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (10).Buffer (Mem_Region_Length .. T.Packet_T_Recv_Sync_History.Get (10).Header.Buffer_Length - 1), [0 .. Packet_Data_Length - 1 => 8]); + Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (11).Buffer (Mem_Region_Length .. T.Packet_T_Recv_Sync_History.Get (11).Header.Buffer_Length - 1), [0 .. Packet_Data_Length - 1 => 8]); + Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (12).Buffer (Mem_Region_Length .. T.Packet_T_Recv_Sync_History.Get (12).Header.Buffer_Length - 1), [0 .. Packet_Data_Length - 1 => 8]); end Test_Max_Packet_Id_Exceeded; end Memory_Packetizer_Tests.Implementation; diff --git a/src/components/memory_packetizer_fixed_id/test/memory_packetizer_fixed_id_tests-implementation.adb b/src/components/memory_packetizer_fixed_id/test/memory_packetizer_fixed_id_tests-implementation.adb index 6cdd0de7..9a6ca3c7 100644 --- a/src/components/memory_packetizer_fixed_id/test/memory_packetizer_fixed_id_tests-implementation.adb +++ b/src/components/memory_packetizer_fixed_id/test/memory_packetizer_fixed_id_tests-implementation.adb @@ -58,15 +58,15 @@ package body Memory_Packetizer_Fixed_Id_Tests.Implementation is A_Packet : Packet.T; Mem_Region_Length : constant Natural := Memory_Region.Serialization.Serialized_Length; Packet_Data_Length : constant Natural := A_Packet.Buffer'Length - Mem_Region_Length; - Bytes : aliased Basic_Types.Byte_Array := (0 .. 4 * Packet_Data_Length - Packet_Data_Length / 2 - 1 => 0); + Bytes : aliased Basic_Types.Byte_Array := [0 .. 4 * Packet_Data_Length - Packet_Data_Length / 2 - 1 => 0]; Dump_1 : constant Memory_Packetizer_Types.Memory_Dump := (Id => 7, Memory_Pointer => From_Address (Bytes'Address, Bytes'Length)); Dump_2 : constant Memory_Packetizer_Types.Memory_Dump := (Id => 28, Memory_Pointer => From_Address (Bytes'Address, Bytes'Length)); begin -- Fill the byte array: - Bytes (0 .. Packet_Data_Length - 1) := (others => 9); - Bytes (Packet_Data_Length .. 2 * Packet_Data_Length - 1) := (others => 10); - Bytes (2 * Packet_Data_Length .. 3 * Packet_Data_Length - 1) := (others => 11); - Bytes (3 * Packet_Data_Length .. 4 * Packet_Data_Length - Packet_Data_Length / 2 - 1) := (others => 12); + Bytes (0 .. Packet_Data_Length - 1) := [others => 9]; + Bytes (Packet_Data_Length .. 2 * Packet_Data_Length - 1) := [others => 10]; + Bytes (2 * Packet_Data_Length .. 3 * Packet_Data_Length - 1) := [others => 11]; + Bytes (3 * Packet_Data_Length .. 4 * Packet_Data_Length - Packet_Data_Length / 2 - 1) := [others => 12]; -- Send two memory dumps: T.Memory_Dump_Send (Dump_1); @@ -109,14 +109,14 @@ package body Memory_Packetizer_Fixed_Id_Tests.Implementation is Natural_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (8).Header.Buffer_Length, Packet_Data_Length / 2 + Memory_Region.Serialization.Serialized_Length); -- Check packet contents: - Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (1).Buffer (Mem_Region_Length .. A_Packet.Buffer'Last), (0 .. Packet_Data_Length - 1 => 9)); - Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (2).Buffer (Mem_Region_Length .. A_Packet.Buffer'Last), (0 .. Packet_Data_Length - 1 => 10)); - Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (3).Buffer (Mem_Region_Length .. A_Packet.Buffer'Last), (0 .. Packet_Data_Length - 1 => 11)); - Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (4).Buffer (Mem_Region_Length .. T.Packet_T_Recv_Sync_History.Get (4).Header.Buffer_Length - 1), (0 .. Packet_Data_Length / 2 - 1 => 12)); - Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (5).Buffer (Mem_Region_Length .. A_Packet.Buffer'Last), (0 .. Packet_Data_Length - 1 => 9)); - Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (6).Buffer (Mem_Region_Length .. A_Packet.Buffer'Last), (0 .. Packet_Data_Length - 1 => 10)); - Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (7).Buffer (Mem_Region_Length .. A_Packet.Buffer'Last), (0 .. Packet_Data_Length - 1 => 11)); - Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (8).Buffer (Mem_Region_Length .. T.Packet_T_Recv_Sync_History.Get (8).Header.Buffer_Length - 1), (0 .. Packet_Data_Length / 2 - 1 => 12)); + Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (1).Buffer (Mem_Region_Length .. A_Packet.Buffer'Last), [0 .. Packet_Data_Length - 1 => 9]); + Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (2).Buffer (Mem_Region_Length .. A_Packet.Buffer'Last), [0 .. Packet_Data_Length - 1 => 10]); + Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (3).Buffer (Mem_Region_Length .. A_Packet.Buffer'Last), [0 .. Packet_Data_Length - 1 => 11]); + Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (4).Buffer (Mem_Region_Length .. T.Packet_T_Recv_Sync_History.Get (4).Header.Buffer_Length - 1), [0 .. Packet_Data_Length / 2 - 1 => 12]); + Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (5).Buffer (Mem_Region_Length .. A_Packet.Buffer'Last), [0 .. Packet_Data_Length - 1 => 9]); + Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (6).Buffer (Mem_Region_Length .. A_Packet.Buffer'Last), [0 .. Packet_Data_Length - 1 => 10]); + Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (7).Buffer (Mem_Region_Length .. A_Packet.Buffer'Last), [0 .. Packet_Data_Length - 1 => 11]); + Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (8).Buffer (Mem_Region_Length .. T.Packet_T_Recv_Sync_History.Get (8).Header.Buffer_Length - 1), [0 .. Packet_Data_Length / 2 - 1 => 12]); -- Check packet address and length headers: Memory_Region_Assert.Eq (Memory_Region.Serialization.From_Byte_Array (T.Packet_T_Recv_Sync_History.Get (1).Buffer (0 .. Mem_Region_Length - 1)), (Bytes'Address, Packet_Data_Length)); @@ -169,10 +169,10 @@ package body Memory_Packetizer_Fixed_Id_Tests.Implementation is end; -- Fill the byte array: - Bytes (0 .. Packet_Data_Length - 1) := (others => 7); - Bytes (Packet_Data_Length .. 2 * Packet_Data_Length - 1) := (others => 6); - Bytes (2 * Packet_Data_Length .. 3 * Packet_Data_Length - 1) := (others => 5); - Bytes (3 * Packet_Data_Length .. 4 * Packet_Data_Length - Packet_Data_Length / 2 - 1) := (others => 4); + Bytes (0 .. Packet_Data_Length - 1) := [others => 7]; + Bytes (Packet_Data_Length .. 2 * Packet_Data_Length - 1) := [others => 6]; + Bytes (2 * Packet_Data_Length .. 3 * Packet_Data_Length - 1) := [others => 5]; + Bytes (3 * Packet_Data_Length .. 4 * Packet_Data_Length - Packet_Data_Length / 2 - 1) := [others => 4]; -- Delay 5 seconds to simulate low packet load: declare @@ -223,14 +223,14 @@ package body Memory_Packetizer_Fixed_Id_Tests.Implementation is Natural_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (16).Header.Buffer_Length, Packet_Data_Length / 2 + Memory_Region.Serialization.Serialized_Length); -- Check packet contents: - Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (9).Buffer (Mem_Region_Length .. A_Packet.Buffer'Last), (0 .. Packet_Data_Length - 1 => 7)); - Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (10).Buffer (Mem_Region_Length .. A_Packet.Buffer'Last), (0 .. Packet_Data_Length - 1 => 6)); - Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (11).Buffer (Mem_Region_Length .. A_Packet.Buffer'Last), (0 .. Packet_Data_Length - 1 => 5)); - Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (12).Buffer (Mem_Region_Length .. T.Packet_T_Recv_Sync_History.Get (4).Header.Buffer_Length - 1), (0 .. Packet_Data_Length / 2 - 1 => 4)); - Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (13).Buffer (Mem_Region_Length .. A_Packet.Buffer'Last), (0 .. Packet_Data_Length - 1 => 7)); - Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (14).Buffer (Mem_Region_Length .. A_Packet.Buffer'Last), (0 .. Packet_Data_Length - 1 => 6)); - Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (15).Buffer (Mem_Region_Length .. A_Packet.Buffer'Last), (0 .. Packet_Data_Length - 1 => 5)); - Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (16).Buffer (Mem_Region_Length .. T.Packet_T_Recv_Sync_History.Get (8).Header.Buffer_Length - 1), (0 .. Packet_Data_Length / 2 - 1 => 4)); + Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (9).Buffer (Mem_Region_Length .. A_Packet.Buffer'Last), [0 .. Packet_Data_Length - 1 => 7]); + Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (10).Buffer (Mem_Region_Length .. A_Packet.Buffer'Last), [0 .. Packet_Data_Length - 1 => 6]); + Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (11).Buffer (Mem_Region_Length .. A_Packet.Buffer'Last), [0 .. Packet_Data_Length - 1 => 5]); + Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (12).Buffer (Mem_Region_Length .. T.Packet_T_Recv_Sync_History.Get (4).Header.Buffer_Length - 1), [0 .. Packet_Data_Length / 2 - 1 => 4]); + Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (13).Buffer (Mem_Region_Length .. A_Packet.Buffer'Last), [0 .. Packet_Data_Length - 1 => 7]); + Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (14).Buffer (Mem_Region_Length .. A_Packet.Buffer'Last), [0 .. Packet_Data_Length - 1 => 6]); + Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (15).Buffer (Mem_Region_Length .. A_Packet.Buffer'Last), [0 .. Packet_Data_Length - 1 => 5]); + Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (16).Buffer (Mem_Region_Length .. T.Packet_T_Recv_Sync_History.Get (8).Header.Buffer_Length - 1), [0 .. Packet_Data_Length / 2 - 1 => 4]); -- Check packet address and length headers: Memory_Region_Assert.Eq (Memory_Region.Serialization.From_Byte_Array (T.Packet_T_Recv_Sync_History.Get (9).Buffer (0 .. Mem_Region_Length - 1)), (Bytes'Address, Packet_Data_Length)); @@ -290,7 +290,7 @@ package body Memory_Packetizer_Fixed_Id_Tests.Implementation is A_Packet : Packet.T; Mem_Region_Length : constant Natural := Memory_Region.Serialization.Serialized_Length; Packet_Data_Length : constant Natural := A_Packet.Buffer'Length - Mem_Region_Length; - Bytes : aliased Basic_Types.Byte_Array := (0 .. 4 * Packet_Data_Length - Packet_Data_Length / 2 - 1 => 0); + Bytes : aliased Basic_Types.Byte_Array := [0 .. 4 * Packet_Data_Length - Packet_Data_Length / 2 - 1 => 0]; Dump_1 : constant Memory_Packetizer_Types.Memory_Dump := (Id => 4, Memory_Pointer => From_Address (Bytes'Address, Bytes'Length)); begin -- Check data product at start: @@ -331,10 +331,10 @@ package body Memory_Packetizer_Fixed_Id_Tests.Implementation is Packets_Per_Period_Assert.Eq (T.Max_Packets_Per_Time_Period_History.Get (3), (Max_Packets => 1, Period => 3)); -- Fill the byte array: - Bytes (0 .. Packet_Data_Length - 1) := (others => 9); - Bytes (Packet_Data_Length .. 2 * Packet_Data_Length - 1) := (others => 10); - Bytes (2 * Packet_Data_Length .. 3 * Packet_Data_Length - 1) := (others => 11); - Bytes (3 * Packet_Data_Length .. 4 * Packet_Data_Length - Packet_Data_Length / 2 - 1) := (others => 12); + Bytes (0 .. Packet_Data_Length - 1) := [others => 9]; + Bytes (Packet_Data_Length .. 2 * Packet_Data_Length - 1) := [others => 10]; + Bytes (2 * Packet_Data_Length .. 3 * Packet_Data_Length - 1) := [others => 11]; + Bytes (3 * Packet_Data_Length .. 4 * Packet_Data_Length - Packet_Data_Length / 2 - 1) := [others => 12]; -- Send two memory dumps: T.Memory_Dump_Send (Dump_1); @@ -365,10 +365,10 @@ package body Memory_Packetizer_Fixed_Id_Tests.Implementation is Natural_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (4).Header.Buffer_Length, Packet_Data_Length / 2 + Memory_Region.Serialization.Serialized_Length); -- Check packet contents: - Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (1).Buffer (Mem_Region_Length .. A_Packet.Buffer'Last), (0 .. Packet_Data_Length - 1 => 9)); - Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (2).Buffer (Mem_Region_Length .. A_Packet.Buffer'Last), (0 .. Packet_Data_Length - 1 => 10)); - Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (3).Buffer (Mem_Region_Length .. A_Packet.Buffer'Last), (0 .. Packet_Data_Length - 1 => 11)); - Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (4).Buffer (Mem_Region_Length .. T.Packet_T_Recv_Sync_History.Get (4).Header.Buffer_Length - 1), (0 .. Packet_Data_Length / 2 - 1 => 12)); + Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (1).Buffer (Mem_Region_Length .. A_Packet.Buffer'Last), [0 .. Packet_Data_Length - 1 => 9]); + Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (2).Buffer (Mem_Region_Length .. A_Packet.Buffer'Last), [0 .. Packet_Data_Length - 1 => 10]); + Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (3).Buffer (Mem_Region_Length .. A_Packet.Buffer'Last), [0 .. Packet_Data_Length - 1 => 11]); + Byte_Array_Assert.Eq (T.Packet_T_Recv_Sync_History.Get (4).Buffer (Mem_Region_Length .. T.Packet_T_Recv_Sync_History.Get (4).Header.Buffer_Length - 1), [0 .. Packet_Data_Length / 2 - 1 => 12]); -- Check packet timing: declare @@ -417,7 +417,7 @@ package body Memory_Packetizer_Fixed_Id_Tests.Implementation is overriding procedure Test_Invalid_Command (Self : in out Instance) is T : Component.Memory_Packetizer_Fixed_Id.Implementation.Tester.Instance_Access renames Self.Tester; - Bytes : constant Packets_Per_Period.Serialization.Byte_Array := (others => 0); + Bytes : constant Packets_Per_Period.Serialization.Byte_Array := [others => 0]; begin -- Send an invalid command, we need to use serialization to avoid a constraint error. T.Command_T_Send (T.Commands.Set_Max_Packet_Rate (Packets_Per_Period.Serialization.From_Byte_Array (Bytes))); @@ -434,14 +434,14 @@ package body Memory_Packetizer_Fixed_Id_Tests.Implementation is Natural_Assert.Eq (T.Event_T_Recv_Sync_History.Get_Count, 1); Natural_Assert.Eq (T.Max_Packet_Rate_Set_History.Get_Count, 0); Natural_Assert.Eq (T.Invalid_Command_Received_History.Get_Count, 1); - Invalid_Command_Info_Assert.Eq (T.Invalid_Command_Received_History.Get (1), (Id => T.Commands.Get_Set_Max_Packet_Rate_Id, Errant_Field_Number => 2, Errant_Field => (0, 0, 0, 0, 0, 0, 0, 0))); + Invalid_Command_Info_Assert.Eq (T.Invalid_Command_Received_History.Get (1), (Id => T.Commands.Get_Set_Max_Packet_Rate_Id, Errant_Field_Number => 2, Errant_Field => [0, 0, 0, 0, 0, 0, 0, 0])); end Test_Invalid_Command; overriding procedure Test_Memory_Dump_Dropped (Self : in out Instance) is use Byte_Array_Pointer; T : Component.Memory_Packetizer_Fixed_Id.Implementation.Tester.Instance_Access renames Self.Tester; A_Packet : Packet.T; - Bytes : aliased Basic_Types.Byte_Array := (0 .. 4 * A_Packet.Buffer'Length - A_Packet.Buffer'Length / 2 - 1 => 0); + Bytes : aliased Basic_Types.Byte_Array := [0 .. 4 * A_Packet.Buffer'Length - A_Packet.Buffer'Length / 2 - 1 => 0]; Dump_1 : constant Memory_Packetizer_Types.Memory_Dump := (Id => 1, Memory_Pointer => From_Address (Bytes'Address, Bytes'Length)); Dump_2 : constant Memory_Packetizer_Types.Memory_Dump := (Id => 2, Memory_Pointer => From_Address (Bytes'Address, Bytes'Length)); Dump_3 : constant Memory_Packetizer_Types.Memory_Dump := (Id => 3, Memory_Pointer => From_Address (Bytes'Address, Bytes'Length)); diff --git a/src/components/memory_stuffer/test/memory_stuffer_tests-implementation.adb b/src/components/memory_stuffer/test/memory_stuffer_tests-implementation.adb index faeac174..d2c41660 100644 --- a/src/components/memory_stuffer/test/memory_stuffer_tests-implementation.adb +++ b/src/components/memory_stuffer/test/memory_stuffer_tests-implementation.adb @@ -31,14 +31,14 @@ package body Memory_Stuffer_Tests.Implementation is -- Fixtures: ------------------------------------------------------------------------- - Region_1 : aliased Basic_Types.Byte_Array := (1, 2, 3, 4, 5, 6, 7, 8, 9, 10); + Region_1 : aliased Basic_Types.Byte_Array := [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; Region_1_Address : constant System.Address := Region_1'Address; - Region_2 : aliased Basic_Types.Byte_Array := (98, 97, 96, 95, 94, 93, 92, 91, 90, 89, 88, 87, 86, 85, 84, 83, 82, 81, 80, 79); + Region_2 : aliased Basic_Types.Byte_Array := [98, 97, 96, 95, 94, 93, 92, 91, 90, 89, 88, 87, 86, 85, 84, 83, 82, 81, 80, 79]; Region_2_Address : constant System.Address := Region_2'Address; - Regions : aliased Memory_Manager_Types.Memory_Region_Array := ((Region_1_Address, Region_1'Length), (Region_2_Address, Region_2'Length)); - Protection_List : aliased Memory_Manager_Types.Memory_Protection_Array := (Memory_Manager_Types.Unprotected_Region, Memory_Manager_Types.Protected_Region); + Regions : aliased Memory_Manager_Types.Memory_Region_Array := [(Region_1_Address, Region_1'Length), (Region_2_Address, Region_2'Length)]; + Protection_List : aliased Memory_Manager_Types.Memory_Protection_Array := [Memory_Manager_Types.Unprotected_Region, Memory_Manager_Types.Protected_Region]; -- Another region for copying from. - Region_3 : aliased Basic_Types.Byte_Array := (66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77); + Region_3 : aliased Basic_Types.Byte_Array := [66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77]; Region_3_Address : constant System.Address := Region_3'Address; overriding procedure Set_Up_Test (Self : in out Instance) is @@ -85,7 +85,7 @@ package body Memory_Stuffer_Tests.Implementation is end Init_Nominal_No_Protection; procedure Init_Size_Mismatch is - Protection_List_Bad : aliased Memory_Manager_Types.Memory_Protection_Array := (0 => Memory_Manager_Types.Unprotected_Region); + Protection_List_Bad : aliased Memory_Manager_Types.Memory_Protection_Array := [0 => Memory_Manager_Types.Unprotected_Region]; begin T.Component_Instance.Init (Regions'Access, Protection_List_Bad'Unchecked_Access); -- Should never get here: @@ -97,7 +97,7 @@ package body Memory_Stuffer_Tests.Implementation is end Init_Size_Mismatch; procedure Init_Size_Mismatch_2 is - Protection_List_Bad : aliased Memory_Manager_Types.Memory_Protection_Array := (Memory_Manager_Types.Unprotected_Region, Memory_Manager_Types.Protected_Region, Memory_Manager_Types.Protected_Region); + Protection_List_Bad : aliased Memory_Manager_Types.Memory_Protection_Array := [Memory_Manager_Types.Unprotected_Region, Memory_Manager_Types.Protected_Region, Memory_Manager_Types.Protected_Region]; begin T.Component_Instance.Init (Regions'Access, Protection_List_Bad'Unchecked_Access); -- Should never get here: @@ -112,8 +112,8 @@ package body Memory_Stuffer_Tests.Implementation is Natural_Assert.Eq (T.Event_T_Recv_Sync_History.Get_Count, 0); -- Make sure that memory is not written by default on valid startup: - Byte_Array_Assert.Eq (Region_1, (1, 2, 3, 4, 5, 6, 7, 8, 9, 10)); - Byte_Array_Assert.Eq (Region_2, (98, 97, 96, 95, 94, 93, 92, 91, 90, 89, 88, 87, 86, 85, 84, 83, 82, 81, 80, 79)); + Byte_Array_Assert.Eq (Region_1, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]); + Byte_Array_Assert.Eq (Region_2, [98, 97, 96, 95, 94, 93, 92, 91, 90, 89, 88, 87, 86, 85, 84, 83, 82, 81, 80, 79]); -- Test different start-up scenarios: Init_Nominal; @@ -148,14 +148,14 @@ package body Memory_Stuffer_Tests.Implementation is Natural_Assert.Eq (T.Event_T_Recv_Sync_History.Get_Count, 0); -- Make sure that memory is not written by default on valid startup: - Byte_Array_Assert.Eq (Region_1, (1, 2, 3, 4, 5, 6, 7, 8, 9, 10)); - Byte_Array_Assert.Eq (Region_2, (98, 97, 96, 95, 94, 93, 92, 91, 90, 89, 88, 87, 86, 85, 84, 83, 82, 81, 80, 79)); + Byte_Array_Assert.Eq (Region_1, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]); + Byte_Array_Assert.Eq (Region_2, [98, 97, 96, 95, 94, 93, 92, 91, 90, 89, 88, 87, 86, 85, 84, 83, 82, 81, 80, 79]); -- Send a command to stuff a memory region: Put_Line ("Writing region 1:"); Put_Line (Basic_Types.Representation.Image (Region_1)); Region := (Address => Region_1_Address, Length => Region_1'Length); - Ser_Status_Assert.Eq (T.Commands.Write_Memory ((Region.Address, Region.Length, (others => 9)), Cmd), Success); + Ser_Status_Assert.Eq (T.Commands.Write_Memory ((Region.Address, Region.Length, [others => 9]), Cmd), Success); T.Command_T_Send (Cmd); -- Make sure no events are thrown yet: @@ -175,11 +175,11 @@ package body Memory_Stuffer_Tests.Implementation is -- Check memory: Put_Line (Basic_Types.Representation.Image (Region_1)); - Byte_Array_Assert.Eq (Region_1, (9, 9, 9, 9, 9, 9, 9, 9, 9, 9)); + Byte_Array_Assert.Eq (Region_1, [9, 9, 9, 9, 9, 9, 9, 9, 9, 9]); -- Send a command to stuff a memory region: Region := (Address => Region_1_Address, Length => Region_1'Length - 1); - Ser_Status_Assert.Eq (T.Commands.Write_Memory ((Region.Address, Region.Length, (others => 8)), Cmd), Success); + Ser_Status_Assert.Eq (T.Commands.Write_Memory ((Region.Address, Region.Length, [others => 8]), Cmd), Success); T.Command_T_Send (Cmd); -- Drain the queue: @@ -196,11 +196,11 @@ package body Memory_Stuffer_Tests.Implementation is -- Check memory: Put_Line (Basic_Types.Representation.Image (Region_1)); - Byte_Array_Assert.Eq (Region_1, (8, 8, 8, 8, 8, 8, 8, 8, 8, 9)); + Byte_Array_Assert.Eq (Region_1, [8, 8, 8, 8, 8, 8, 8, 8, 8, 9]); -- Send a command to stuff a memory region: Region := (Address => Region_1_Address + Storage_Offset (2), Length => 3); - Ser_Status_Assert.Eq (T.Commands.Write_Memory ((Region.Address, Region.Length, (others => 7)), Cmd), Success); + Ser_Status_Assert.Eq (T.Commands.Write_Memory ((Region.Address, Region.Length, [others => 7]), Cmd), Success); T.Command_T_Send (Cmd); -- Drain the queue: @@ -217,13 +217,13 @@ package body Memory_Stuffer_Tests.Implementation is -- Check memory: Put_Line (Basic_Types.Representation.Image (Region_1)); - Byte_Array_Assert.Eq (Region_1, (8, 8, 7, 7, 7, 8, 8, 8, 8, 9)); + Byte_Array_Assert.Eq (Region_1, [8, 8, 7, 7, 7, 8, 8, 8, 8, 9]); -- Send a command to stuff a memory region: Put_Line ("Writing region 2:"); Put_Line (Basic_Types.Representation.Image (Region_2)); Region := (Address => Region_2_Address, Length => Region_2'Length); - Ser_Status_Assert.Eq (T.Commands.Write_Memory ((Region.Address, Region.Length, (others => 255)), Cmd), Success); + Ser_Status_Assert.Eq (T.Commands.Write_Memory ((Region.Address, Region.Length, [others => 255]), Cmd), Success); T.Command_T_Send (Cmd); -- Drain the queue: @@ -240,12 +240,12 @@ package body Memory_Stuffer_Tests.Implementation is -- Check memory: Put_Line (Basic_Types.Representation.Image (Region_2)); - Byte_Array_Assert.Eq (Region_1, (8, 8, 7, 7, 7, 8, 8, 8, 8, 9)); -- Make sure region 1 is unchanged. - Byte_Array_Assert.Eq (Region_2, (255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255)); + Byte_Array_Assert.Eq (Region_1, [8, 8, 7, 7, 7, 8, 8, 8, 8, 9]); -- Make sure region 1 is unchanged. + Byte_Array_Assert.Eq (Region_2, [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]); -- Send a command to stuff a memory region: Region := (Address => Region_2_Address, Length => 5); - Ser_Status_Assert.Eq (T.Commands.Write_Memory ((Region.Address, Region.Length, (others => 254)), Cmd), Success); + Ser_Status_Assert.Eq (T.Commands.Write_Memory ((Region.Address, Region.Length, [others => 254]), Cmd), Success); T.Command_T_Send (Cmd); -- Drain the queue: @@ -262,11 +262,11 @@ package body Memory_Stuffer_Tests.Implementation is -- Check memory: Put_Line (Basic_Types.Representation.Image (Region_2)); - Byte_Array_Assert.Eq (Region_2, (254, 254, 254, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255)); + Byte_Array_Assert.Eq (Region_2, [254, 254, 254, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]); -- Send a command to stuff a memory region: Region := (Address => Region_2_Address + Storage_Offset (15), Length => 3); - Ser_Status_Assert.Eq (T.Commands.Write_Memory ((Region.Address, Region.Length, (others => 253)), Cmd), Success); + Ser_Status_Assert.Eq (T.Commands.Write_Memory ((Region.Address, Region.Length, [others => 253]), Cmd), Success); T.Command_T_Send (Cmd); -- Drain the queue: @@ -283,7 +283,7 @@ package body Memory_Stuffer_Tests.Implementation is -- Check memory: Put_Line (Basic_Types.Representation.Image (Region_2)); - Byte_Array_Assert.Eq (Region_2, (254, 254, 254, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 253, 253, 253, 255, 255)); + Byte_Array_Assert.Eq (Region_2, [254, 254, 254, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 253, 253, 253, 255, 255]); -- Make sure no memory releases were sent. Natural_Assert.Eq (T.Memory_Region_Release_T_Recv_Sync_History.Get_Count, 0); @@ -304,7 +304,7 @@ package body Memory_Stuffer_Tests.Implementation is Put_Line ("Writing unprotected region 1:"); Put_Line (Basic_Types.Representation.Image (Region_1)); Region := (Address => Region_1_Address, Length => Region_1'Length); - Ser_Status_Assert.Eq (T.Commands.Write_Memory ((Region.Address, Region.Length, (others => 9)), Cmd), Success); + Ser_Status_Assert.Eq (T.Commands.Write_Memory ((Region.Address, Region.Length, [others => 9]), Cmd), Success); T.Command_T_Send (Cmd); -- Make sure no events are thrown yet: @@ -324,11 +324,11 @@ package body Memory_Stuffer_Tests.Implementation is -- Check memory: Put_Line (Basic_Types.Representation.Image (Region_1)); - Byte_Array_Assert.Eq (Region_1, (9, 9, 9, 9, 9, 9, 9, 9, 9, 9)); + Byte_Array_Assert.Eq (Region_1, [9, 9, 9, 9, 9, 9, 9, 9, 9, 9]); -- Send a command to stuff a memory region: Region := (Address => Region_1_Address, Length => Region_1'Length - 1); - Ser_Status_Assert.Eq (T.Commands.Write_Memory ((Region.Address, Region.Length, (others => 8)), Cmd), Success); + Ser_Status_Assert.Eq (T.Commands.Write_Memory ((Region.Address, Region.Length, [others => 8]), Cmd), Success); T.Command_T_Send (Cmd); -- Drain the queue: @@ -345,11 +345,11 @@ package body Memory_Stuffer_Tests.Implementation is -- Check memory: Put_Line (Basic_Types.Representation.Image (Region_1)); - Byte_Array_Assert.Eq (Region_1, (8, 8, 8, 8, 8, 8, 8, 8, 8, 9)); + Byte_Array_Assert.Eq (Region_1, [8, 8, 8, 8, 8, 8, 8, 8, 8, 9]); -- Send a command to stuff a memory region: Region := (Address => Region_1_Address + Storage_Offset (2), Length => 3); - Ser_Status_Assert.Eq (T.Commands.Write_Memory ((Region.Address, Region.Length, (others => 7)), Cmd), Success); + Ser_Status_Assert.Eq (T.Commands.Write_Memory ((Region.Address, Region.Length, [others => 7]), Cmd), Success); T.Command_T_Send (Cmd); -- Drain the queue: @@ -366,13 +366,13 @@ package body Memory_Stuffer_Tests.Implementation is -- Check memory: Put_Line (Basic_Types.Representation.Image (Region_1)); - Byte_Array_Assert.Eq (Region_1, (8, 8, 7, 7, 7, 8, 8, 8, 8, 9)); + Byte_Array_Assert.Eq (Region_1, [8, 8, 7, 7, 7, 8, 8, 8, 8, 9]); -- Send a command to stuff a memory region: Put_Line ("Writing protected region 2:"); Put_Line (Basic_Types.Representation.Image (Region_2)); Region := (Address => Region_2_Address, Length => Region_2'Length); - Ser_Status_Assert.Eq (T.Commands.Write_Memory ((Region.Address, Region.Length, (others => 255)), Cmd), Success); + Ser_Status_Assert.Eq (T.Commands.Write_Memory ((Region.Address, Region.Length, [others => 255]), Cmd), Success); T.Command_T_Send (Cmd); -- Drain the queue: @@ -388,9 +388,9 @@ package body Memory_Stuffer_Tests.Implementation is -- Check memory: Put_Line (Basic_Types.Representation.Image (Region_2)); -- Make sure region 1 is unchanged. - Byte_Array_Assert.Eq (Region_1, (8, 8, 7, 7, 7, 8, 8, 8, 8, 9)); + Byte_Array_Assert.Eq (Region_1, [8, 8, 7, 7, 7, 8, 8, 8, 8, 9]); -- Make sure region 2 is unchanged. - Byte_Array_Assert.Eq (Region_2, (254, 254, 254, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 253, 253, 253, 255, 255)); + Byte_Array_Assert.Eq (Region_2, [254, 254, 254, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 253, 253, 253, 255, 255]); -- Send arm command: T.Command_T_Send (T.Commands.Arm_Protected_Write ((Timeout => 2))); @@ -409,7 +409,7 @@ package body Memory_Stuffer_Tests.Implementation is -- Send a command to stuff a memory region: Region := (Address => Region_2_Address, Length => Region_2'Length); - Ser_Status_Assert.Eq (T.Commands.Write_Memory ((Region.Address, Region.Length, (others => 255)), Cmd), Success); + Ser_Status_Assert.Eq (T.Commands.Write_Memory ((Region.Address, Region.Length, [others => 255]), Cmd), Success); T.Command_T_Send (Cmd); -- Drain the queue: @@ -419,8 +419,8 @@ package body Memory_Stuffer_Tests.Implementation is -- Check memory: Put_Line (Basic_Types.Representation.Image (Region_2)); - Byte_Array_Assert.Eq (Region_1, (8, 8, 7, 7, 7, 8, 8, 8, 8, 9)); -- Make sure region 1 is unchanged. - Byte_Array_Assert.Eq (Region_2, (255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255)); + Byte_Array_Assert.Eq (Region_1, [8, 8, 7, 7, 7, 8, 8, 8, 8, 9]); -- Make sure region 1 is unchanged. + Byte_Array_Assert.Eq (Region_2, [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]); -- See if event thrown to disarm: Natural_Assert.Eq (T.Event_T_Recv_Sync_History.Get_Count, 11); @@ -435,7 +435,7 @@ package body Memory_Stuffer_Tests.Implementation is -- Send a command to stuff a memory region: Region := (Address => Region_2_Address, Length => 5); - Ser_Status_Assert.Eq (T.Commands.Write_Memory ((Region.Address, Region.Length, (others => 254)), Cmd), Success); + Ser_Status_Assert.Eq (T.Commands.Write_Memory ((Region.Address, Region.Length, [others => 254]), Cmd), Success); T.Command_T_Send (Cmd); -- Drain the queue: @@ -455,14 +455,14 @@ package body Memory_Stuffer_Tests.Implementation is -- Check memory: Put_Line (Basic_Types.Representation.Image (Region_2)); - Byte_Array_Assert.Eq (Region_2, (254, 254, 254, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255)); + Byte_Array_Assert.Eq (Region_2, [254, 254, 254, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]); -- Send arm command: T.Command_T_Send (T.Commands.Arm_Protected_Write ((Timeout => 2))); -- Send a command to stuff a memory region: Region := (Address => Region_2_Address + Storage_Offset (15), Length => 3); - Ser_Status_Assert.Eq (T.Commands.Write_Memory ((Region.Address, Region.Length, (others => 253)), Cmd), Success); + Ser_Status_Assert.Eq (T.Commands.Write_Memory ((Region.Address, Region.Length, [others => 253]), Cmd), Success); T.Command_T_Send (Cmd); -- Drain the queue: @@ -482,7 +482,7 @@ package body Memory_Stuffer_Tests.Implementation is -- Check memory: Put_Line (Basic_Types.Representation.Image (Region_2)); - Byte_Array_Assert.Eq (Region_2, (254, 254, 254, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 253, 253, 253, 255, 255)); + Byte_Array_Assert.Eq (Region_2, [254, 254, 254, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 253, 253, 253, 255, 255]); -- Make sure no memory releases were sent. Natural_Assert.Eq (T.Memory_Region_Release_T_Recv_Sync_History.Get_Count, 0); @@ -511,7 +511,7 @@ package body Memory_Stuffer_Tests.Implementation is -- Write region 2 and expect disarmed: Region := (Address => Region_2_Address, Length => Region_2'Length); - Ser_Status_Assert.Eq (T.Commands.Write_Memory ((Region.Address, Region.Length, (others => 1)), Cmd), Success); + Ser_Status_Assert.Eq (T.Commands.Write_Memory ((Region.Address, Region.Length, [others => 1]), Cmd), Success); T.Command_T_Send (Cmd); Natural_Assert.Eq (T.Dispatch_All, 1); Natural_Assert.Eq (T.Command_Response_T_Recv_Sync_History.Get_Count, 2); @@ -521,7 +521,7 @@ package body Memory_Stuffer_Tests.Implementation is Natural_Assert.Eq (T.Protected_Write_Enabled_History.Get_Count, 1); Natural_Assert.Eq (T.Protected_Write_Disabled_History.Get_Count, 1); Region := (Address => Region_2_Address, Length => Region_2'Length); - Ser_Status_Assert.Eq (T.Commands.Write_Memory ((Region.Address, Region.Length, (others => 1)), Cmd), Success); + Ser_Status_Assert.Eq (T.Commands.Write_Memory ((Region.Address, Region.Length, [others => 1]), Cmd), Success); T.Command_T_Send (Cmd); Natural_Assert.Eq (T.Dispatch_All, 1); Natural_Assert.Eq (T.Command_Response_T_Recv_Sync_History.Get_Count, 3); @@ -530,7 +530,7 @@ package body Memory_Stuffer_Tests.Implementation is Memory_Region_Assert.Eq (T.Protected_Write_Denied_History.Get (1), Region); -- Check memory: - Byte_Array_Assert.Eq (Region_2, (1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1)); + Byte_Array_Assert.Eq (Region_2, [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]); -- Send arm command: T.Command_T_Send (T.Commands.Arm_Protected_Write ((Timeout => 2))); @@ -544,7 +544,7 @@ package body Memory_Stuffer_Tests.Implementation is -- Write region 1 and expect disarmed: Region := (Address => Region_1_Address, Length => Region_1'Length); - Ser_Status_Assert.Eq (T.Commands.Write_Memory ((Region.Address, Region.Length, (others => 1)), Cmd), Success); + Ser_Status_Assert.Eq (T.Commands.Write_Memory ((Region.Address, Region.Length, [others => 1]), Cmd), Success); T.Command_T_Send (Cmd); Natural_Assert.Eq (T.Dispatch_All, 1); Natural_Assert.Eq (T.Command_Response_T_Recv_Sync_History.Get_Count, 5); @@ -554,7 +554,7 @@ package body Memory_Stuffer_Tests.Implementation is Natural_Assert.Eq (T.Protected_Write_Enabled_History.Get_Count, 2); Natural_Assert.Eq (T.Protected_Write_Disabled_History.Get_Count, 2); Region := (Address => Region_2_Address, Length => Region_2'Length); - Ser_Status_Assert.Eq (T.Commands.Write_Memory ((Region.Address, Region.Length, (others => 1)), Cmd), Success); + Ser_Status_Assert.Eq (T.Commands.Write_Memory ((Region.Address, Region.Length, [others => 1]), Cmd), Success); T.Command_T_Send (Cmd); Natural_Assert.Eq (T.Dispatch_All, 1); Natural_Assert.Eq (T.Command_Response_T_Recv_Sync_History.Get_Count, 6); @@ -563,8 +563,8 @@ package body Memory_Stuffer_Tests.Implementation is Memory_Region_Assert.Eq (T.Protected_Write_Denied_History.Get (2), Region); -- Check memory: - Byte_Array_Assert.Eq (Region_2, (1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1)); - Byte_Array_Assert.Eq (Region_1, (1, 1, 1, 1, 1, 1, 1, 1, 1, 1)); + Byte_Array_Assert.Eq (Region_2, [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]); + Byte_Array_Assert.Eq (Region_1, [1, 1, 1, 1, 1, 1, 1, 1, 1, 1]); -- Send arm command: T.Command_T_Send (T.Commands.Arm_Protected_Write ((Timeout => 2))); @@ -578,20 +578,20 @@ package body Memory_Stuffer_Tests.Implementation is -- Write invalid command expect disarmed: Region := (Address => Region_1_Address, Length => Region_1'Length); - Ser_Status_Assert.Eq (T.Commands.Write_Memory ((Region.Address, Region.Length, (others => 2)), Cmd), Success); + Ser_Status_Assert.Eq (T.Commands.Write_Memory ((Region.Address, Region.Length, [others => 2]), Cmd), Success); Cmd.Header.Arg_Buffer_Length := 0; -- Cause deserialization error T.Command_T_Send (Cmd); Natural_Assert.Eq (T.Dispatch_All, 1); Natural_Assert.Eq (T.Command_Response_T_Recv_Sync_History.Get_Count, 8); Command_Response_Assert.Eq (T.Command_Response_T_Recv_Sync_History.Get (8), (Source_Id => 0, Registration_Id => 0, Command_Id => T.Commands.Get_Write_Memory_Id, Status => Length_Error)); Natural_Assert.Eq (T.Invalid_Command_Received_History.Get_Count, 1); - Invalid_Command_Info_Assert.Eq (T.Invalid_Command_Received_History.Get (1), (Id => T.Commands.Get_Write_Memory_Id, Errant_Field_Number => Unsigned_32'Last, Errant_Field => (0, 0, 0, 0, 0, 0, 0, 0))); + Invalid_Command_Info_Assert.Eq (T.Invalid_Command_Received_History.Get (1), (Id => T.Commands.Get_Write_Memory_Id, Errant_Field_Number => Unsigned_32'Last, Errant_Field => [0, 0, 0, 0, 0, 0, 0, 0])); -- Expect system to be disarmed: Natural_Assert.Eq (T.Protected_Write_Enabled_History.Get_Count, 3); Natural_Assert.Eq (T.Protected_Write_Disabled_History.Get_Count, 3); Region := (Address => Region_2_Address, Length => Region_2'Length); - Ser_Status_Assert.Eq (T.Commands.Write_Memory ((Region.Address, Region.Length, (others => 1)), Cmd), Success); + Ser_Status_Assert.Eq (T.Commands.Write_Memory ((Region.Address, Region.Length, [others => 1]), Cmd), Success); T.Command_T_Send (Cmd); Natural_Assert.Eq (T.Dispatch_All, 1); Natural_Assert.Eq (T.Command_Response_T_Recv_Sync_History.Get_Count, 9); @@ -600,8 +600,8 @@ package body Memory_Stuffer_Tests.Implementation is Memory_Region_Assert.Eq (T.Protected_Write_Denied_History.Get (3), Region); -- Check memory: - Byte_Array_Assert.Eq (Region_2, (1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1)); - Byte_Array_Assert.Eq (Region_1, (1, 1, 1, 1, 1, 1, 1, 1, 1, 1)); + Byte_Array_Assert.Eq (Region_2, [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]); + Byte_Array_Assert.Eq (Region_1, [1, 1, 1, 1, 1, 1, 1, 1, 1, 1]); -- Send arm command: T.Command_T_Send (T.Commands.Arm_Protected_Write ((Timeout => 2))); @@ -615,7 +615,7 @@ package body Memory_Stuffer_Tests.Implementation is -- Write invalid address expect disarmed: Region := (Address => Region_1_Address - Storage_Offset (1), Length => Region_1'Length); - Ser_Status_Assert.Eq (T.Commands.Write_Memory ((Region.Address, Region.Length, (others => 2)), Cmd), Success); + Ser_Status_Assert.Eq (T.Commands.Write_Memory ((Region.Address, Region.Length, [others => 2]), Cmd), Success); T.Command_T_Send (Cmd); Natural_Assert.Eq (T.Dispatch_All, 1); Natural_Assert.Eq (T.Command_Response_T_Recv_Sync_History.Get_Count, 11); @@ -627,7 +627,7 @@ package body Memory_Stuffer_Tests.Implementation is Natural_Assert.Eq (T.Protected_Write_Enabled_History.Get_Count, 4); Natural_Assert.Eq (T.Protected_Write_Disabled_History.Get_Count, 4); Region := (Address => Region_2_Address, Length => Region_2'Length); - Ser_Status_Assert.Eq (T.Commands.Write_Memory ((Region.Address, Region.Length, (others => 1)), Cmd), Success); + Ser_Status_Assert.Eq (T.Commands.Write_Memory ((Region.Address, Region.Length, [others => 1]), Cmd), Success); T.Command_T_Send (Cmd); Natural_Assert.Eq (T.Dispatch_All, 1); Natural_Assert.Eq (T.Command_Response_T_Recv_Sync_History.Get_Count, 12); @@ -636,8 +636,8 @@ package body Memory_Stuffer_Tests.Implementation is Memory_Region_Assert.Eq (T.Protected_Write_Denied_History.Get (4), Region); -- Check memory: - Byte_Array_Assert.Eq (Region_2, (1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1)); - Byte_Array_Assert.Eq (Region_1, (1, 1, 1, 1, 1, 1, 1, 1, 1, 1)); + Byte_Array_Assert.Eq (Region_2, [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]); + Byte_Array_Assert.Eq (Region_1, [1, 1, 1, 1, 1, 1, 1, 1, 1, 1]); -- Send arm command: T.Command_T_Send (T.Commands.Arm_Protected_Write ((Timeout => 2))); @@ -661,7 +661,7 @@ package body Memory_Stuffer_Tests.Implementation is -- Write region 2 expect disarmed: Region := (Address => Region_2_Address, Length => Region_2'Length); - Ser_Status_Assert.Eq (T.Commands.Write_Memory ((Region.Address, Region.Length, (others => 2)), Cmd), Success); + Ser_Status_Assert.Eq (T.Commands.Write_Memory ((Region.Address, Region.Length, [others => 2]), Cmd), Success); T.Command_T_Send (Cmd); Natural_Assert.Eq (T.Dispatch_All, 1); Natural_Assert.Eq (T.Command_Response_T_Recv_Sync_History.Get_Count, 15); @@ -671,7 +671,7 @@ package body Memory_Stuffer_Tests.Implementation is Natural_Assert.Eq (T.Protected_Write_Enabled_History.Get_Count, 6); Natural_Assert.Eq (T.Protected_Write_Disabled_History.Get_Count, 5); Region := (Address => Region_2_Address, Length => Region_2'Length); - Ser_Status_Assert.Eq (T.Commands.Write_Memory ((Region.Address, Region.Length, (others => 1)), Cmd), Success); + Ser_Status_Assert.Eq (T.Commands.Write_Memory ((Region.Address, Region.Length, [others => 1]), Cmd), Success); T.Command_T_Send (Cmd); Natural_Assert.Eq (T.Dispatch_All, 1); Natural_Assert.Eq (T.Command_Response_T_Recv_Sync_History.Get_Count, 16); @@ -680,8 +680,8 @@ package body Memory_Stuffer_Tests.Implementation is Memory_Region_Assert.Eq (T.Protected_Write_Denied_History.Get (5), Region); -- Check memory: - Byte_Array_Assert.Eq (Region_2, (2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2)); - Byte_Array_Assert.Eq (Region_1, (1, 1, 1, 1, 1, 1, 1, 1, 1, 1)); + Byte_Array_Assert.Eq (Region_2, [2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2]); + Byte_Array_Assert.Eq (Region_1, [1, 1, 1, 1, 1, 1, 1, 1, 1, 1]); -- Make sure no memory releases were sent. Natural_Assert.Eq (T.Memory_Region_Release_T_Recv_Sync_History.Get_Count, 0); @@ -708,13 +708,13 @@ package body Memory_Stuffer_Tests.Implementation is Natural_Assert.Eq (T.Protected_Write_Disabled_History.Get_Count, 0); -- Delay 2 seconds, by sending ticks - T.Tick_T_Send (((0, 0), 0)); + T.Tick_T_Send (((90, 0), 0)); Natural_Assert.Eq (T.Dispatch_All, 1); Natural_Assert.Eq (T.Data_Product_T_Recv_Sync_History.Get_Count, 3); Natural_Assert.Eq (T.Armed_State_Timeout_History.Get_Count, 2); Packed_Arm_Timeout_Assert.Eq (T.Armed_State_Timeout_History.Get (2), (Timeout => 1)); Natural_Assert.Eq (T.Event_T_Recv_Sync_History.Get_Count, 1); - T.Tick_T_Send (((0, 0), 0)); + T.Tick_T_Send (((90, 0), 0)); Natural_Assert.Eq (T.Dispatch_All, 1); Natural_Assert.Eq (T.Data_Product_T_Recv_Sync_History.Get_Count, 5); Natural_Assert.Eq (T.Armed_State_Timeout_History.Get_Count, 3); @@ -728,7 +728,7 @@ package body Memory_Stuffer_Tests.Implementation is Natural_Assert.Eq (T.Protected_Write_Enabled_History.Get_Count, 1); Natural_Assert.Eq (T.Protected_Write_Disabled_History.Get_Count, 0); Region := (Address => Region_2_Address, Length => Region_2'Length); - Ser_Status_Assert.Eq (T.Commands.Write_Memory ((Region.Address, Region.Length, (others => 1)), Cmd), Success); + Ser_Status_Assert.Eq (T.Commands.Write_Memory ((Region.Address, Region.Length, [others => 1]), Cmd), Success); T.Command_T_Send (Cmd); Natural_Assert.Eq (T.Dispatch_All, 1); Natural_Assert.Eq (T.Command_Response_T_Recv_Sync_History.Get_Count, 2); @@ -738,8 +738,8 @@ package body Memory_Stuffer_Tests.Implementation is Natural_Assert.Eq (T.Protected_Write_Enabled_History.Get_Count, 1); -- Check memory: - Byte_Array_Assert.Eq (Region_2, (2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2)); - Byte_Array_Assert.Eq (Region_1, (1, 1, 1, 1, 1, 1, 1, 1, 1, 1)); + Byte_Array_Assert.Eq (Region_2, [2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2]); + Byte_Array_Assert.Eq (Region_1, [1, 1, 1, 1, 1, 1, 1, 1, 1, 1]); -- Send arm command: T.Command_T_Send (T.Commands.Arm_Protected_Write ((Timeout => 2))); @@ -755,7 +755,7 @@ package body Memory_Stuffer_Tests.Implementation is -- Expect system to be disarmed when trying to write: Region := (Address => Region_2_Address, Length => Region_2'Length); - Ser_Status_Assert.Eq (T.Commands.Write_Memory ((Region.Address, Region.Length, (others => 3)), Cmd), Success); + Ser_Status_Assert.Eq (T.Commands.Write_Memory ((Region.Address, Region.Length, [others => 3]), Cmd), Success); T.Command_T_Send (Cmd); Natural_Assert.Eq (T.Dispatch_All, 1); Natural_Assert.Eq (T.Command_Response_T_Recv_Sync_History.Get_Count, 4); @@ -765,8 +765,8 @@ package body Memory_Stuffer_Tests.Implementation is Natural_Assert.Eq (T.Protected_Write_Disabled_History.Get_Count, 1); -- Check memory: - Byte_Array_Assert.Eq (Region_2, (3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3)); - Byte_Array_Assert.Eq (Region_1, (1, 1, 1, 1, 1, 1, 1, 1, 1, 1)); + Byte_Array_Assert.Eq (Region_2, [3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3]); + Byte_Array_Assert.Eq (Region_1, [1, 1, 1, 1, 1, 1, 1, 1, 1, 1]); -- Make sure no memory releases were sent. Natural_Assert.Eq (T.Memory_Region_Release_T_Recv_Sync_History.Get_Count, 0); @@ -785,7 +785,7 @@ package body Memory_Stuffer_Tests.Implementation is -- Write invalid address: Region := (Address => Region_1_Address - Storage_Offset (1), Length => Region_1'Length); - Ser_Status_Assert.Eq (T.Commands.Write_Memory ((Region.Address, Region.Length, (others => 2)), Cmd), Success); + Ser_Status_Assert.Eq (T.Commands.Write_Memory ((Region.Address, Region.Length, [others => 2]), Cmd), Success); T.Command_T_Send (Cmd); Natural_Assert.Eq (T.Dispatch_All, 1); Natural_Assert.Eq (T.Command_Response_T_Recv_Sync_History.Get_Count, 1); @@ -794,12 +794,12 @@ package body Memory_Stuffer_Tests.Implementation is Memory_Region_Assert.Eq (T.Invalid_Memory_Region_History.Get (1), Region); -- Check memory: - Byte_Array_Assert.Eq (Region_2, (3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3)); - Byte_Array_Assert.Eq (Region_1, (1, 1, 1, 1, 1, 1, 1, 1, 1, 1)); + Byte_Array_Assert.Eq (Region_2, [3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3]); + Byte_Array_Assert.Eq (Region_1, [1, 1, 1, 1, 1, 1, 1, 1, 1, 1]); -- Write invalid address: Region := (Address => Region_1_Address + Storage_Offset (1), Length => Region_1'Length); - Ser_Status_Assert.Eq (T.Commands.Write_Memory ((Region.Address, Region.Length, (others => 2)), Cmd), Success); + Ser_Status_Assert.Eq (T.Commands.Write_Memory ((Region.Address, Region.Length, [others => 2]), Cmd), Success); T.Command_T_Send (Cmd); Natural_Assert.Eq (T.Dispatch_All, 1); Natural_Assert.Eq (T.Command_Response_T_Recv_Sync_History.Get_Count, 2); @@ -808,12 +808,12 @@ package body Memory_Stuffer_Tests.Implementation is Memory_Region_Assert.Eq (T.Invalid_Memory_Region_History.Get (2), Region); -- Check memory: - Byte_Array_Assert.Eq (Region_2, (3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3)); - Byte_Array_Assert.Eq (Region_1, (1, 1, 1, 1, 1, 1, 1, 1, 1, 1)); + Byte_Array_Assert.Eq (Region_2, [3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3]); + Byte_Array_Assert.Eq (Region_1, [1, 1, 1, 1, 1, 1, 1, 1, 1, 1]); -- Write invalid address: Region := (Address => Region_2_Address - Storage_Offset (1), Length => 0); - Ser_Status_Assert.Eq (T.Commands.Write_Memory ((Region.Address, Region.Length, (others => 2)), Cmd), Success); + Ser_Status_Assert.Eq (T.Commands.Write_Memory ((Region.Address, Region.Length, [others => 2]), Cmd), Success); T.Command_T_Send (Cmd); Natural_Assert.Eq (T.Dispatch_All, 1); Natural_Assert.Eq (T.Command_Response_T_Recv_Sync_History.Get_Count, 3); @@ -822,12 +822,12 @@ package body Memory_Stuffer_Tests.Implementation is Memory_Region_Assert.Eq (T.Invalid_Memory_Region_History.Get (3), Region); -- Check memory: - Byte_Array_Assert.Eq (Region_2, (3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3)); - Byte_Array_Assert.Eq (Region_1, (1, 1, 1, 1, 1, 1, 1, 1, 1, 1)); + Byte_Array_Assert.Eq (Region_2, [3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3]); + Byte_Array_Assert.Eq (Region_1, [1, 1, 1, 1, 1, 1, 1, 1, 1, 1]); -- Write valid address, zero length: Region := (Address => Region_1_Address, Length => 0); - Ser_Status_Assert.Eq (T.Commands.Write_Memory ((Region.Address, Region.Length, (others => 2)), Cmd), Success); + Ser_Status_Assert.Eq (T.Commands.Write_Memory ((Region.Address, Region.Length, [others => 2]), Cmd), Success); T.Command_T_Send (Cmd); Natural_Assert.Eq (T.Dispatch_All, 1); Natural_Assert.Eq (T.Command_Response_T_Recv_Sync_History.Get_Count, 4); @@ -836,12 +836,12 @@ package body Memory_Stuffer_Tests.Implementation is Memory_Region_Assert.Eq (T.Invalid_Memory_Region_History.Get (4), Region); -- Check memory: - Byte_Array_Assert.Eq (Region_2, (3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3)); - Byte_Array_Assert.Eq (Region_1, (1, 1, 1, 1, 1, 1, 1, 1, 1, 1)); + Byte_Array_Assert.Eq (Region_2, [3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3]); + Byte_Array_Assert.Eq (Region_1, [1, 1, 1, 1, 1, 1, 1, 1, 1, 1]); -- Write valid address, zero length: Region := (Address => Region_1_Address, Length => Region_1'Length); - Ser_Status_Assert.Eq (T.Commands.Write_Memory ((Region.Address, Region.Length, (others => 4)), Cmd), Success); + Ser_Status_Assert.Eq (T.Commands.Write_Memory ((Region.Address, Region.Length, [others => 4]), Cmd), Success); T.Command_T_Send (Cmd); Natural_Assert.Eq (T.Dispatch_All, 1); Natural_Assert.Eq (T.Command_Response_T_Recv_Sync_History.Get_Count, 5); @@ -849,8 +849,8 @@ package body Memory_Stuffer_Tests.Implementation is Natural_Assert.Eq (T.Invalid_Memory_Region_History.Get_Count, 4); -- Check memory: - Byte_Array_Assert.Eq (Region_2, (3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3)); - Byte_Array_Assert.Eq (Region_1, (4, 4, 4, 4, 4, 4, 4, 4, 4, 4)); + Byte_Array_Assert.Eq (Region_2, [3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3]); + Byte_Array_Assert.Eq (Region_1, [4, 4, 4, 4, 4, 4, 4, 4, 4, 4]); -- Make sure no memory releases were sent. Natural_Assert.Eq (T.Memory_Region_Release_T_Recv_Sync_History.Get_Count, 0); @@ -863,7 +863,7 @@ package body Memory_Stuffer_Tests.Implementation is Cmd : Command.T; begin -- Make the command invalid by modifying its length. - Ser_Status_Assert.Eq (T.Commands.Write_Memory ((Region.Address, Region.Length, (others => 4)), Cmd), Success); + Ser_Status_Assert.Eq (T.Commands.Write_Memory ((Region.Address, Region.Length, [others => 4]), Cmd), Success); Cmd.Header.Arg_Buffer_Length := 0; -- Send bad command and expect bad response: @@ -875,7 +875,7 @@ package body Memory_Stuffer_Tests.Implementation is -- Make sure some events were thrown: Natural_Assert.Eq (T.Event_T_Recv_Sync_History.Get_Count, 2); Natural_Assert.Eq (T.Invalid_Command_Received_History.Get_Count, 1); - Invalid_Command_Info_Assert.Eq (T.Invalid_Command_Received_History.Get (1), (Id => T.Commands.Get_Write_Memory_Id, Errant_Field_Number => Interfaces.Unsigned_32'Last, Errant_Field => (0, 0, 0, 0, 0, 0, 0, 0))); + Invalid_Command_Info_Assert.Eq (T.Invalid_Command_Received_History.Get (1), (Id => T.Commands.Get_Write_Memory_Id, Errant_Field_Number => Interfaces.Unsigned_32'Last, Errant_Field => [0, 0, 0, 0, 0, 0, 0, 0])); Natural_Assert.Eq (T.Protected_Write_Disabled_History.Get_Count, 1); -- Make sure no memory releases were sent. @@ -889,8 +889,8 @@ package body Memory_Stuffer_Tests.Implementation is T : Component.Memory_Stuffer.Implementation.Tester.Instance_Access renames Self.Tester; begin -- Reset memory regions: - Region_1 := (1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - Region_2 := (98, 97, 96, 95, 94, 93, 92, 91, 90, 89, 88, 87, 86, 85, 84, 83, 82, 81, 80, 79); + Region_1 := [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; + Region_2 := [98, 97, 96, 95, 94, 93, 92, 91, 90, 89, 88, 87, 86, 85, 84, 83, 82, 81, 80, 79]; -- Init both regions with no protection: T.Component_Instance.Init (Regions'Access, null); @@ -924,7 +924,7 @@ package body Memory_Stuffer_Tests.Implementation is -- Check memory: Put_Line (Basic_Types.Representation.Image (Region_1)); - Byte_Array_Assert.Eq (Region_1, (66, 67, 68, 69, 70, 71, 72, 73, 74, 75)); + Byte_Array_Assert.Eq (Region_1, [66, 67, 68, 69, 70, 71, 72, 73, 74, 75]); -- Send a command to stuff a memory region: Put_Line ("Copying to region 1 from region 2:"); @@ -951,10 +951,10 @@ package body Memory_Stuffer_Tests.Implementation is -- Check memory: Put_Line (Basic_Types.Representation.Image (Region_2)); - Byte_Array_Assert.Eq (Region_2, (66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 86, 85, 84, 83, 82, 81, 80, 79)); + Byte_Array_Assert.Eq (Region_2, [66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 86, 85, 84, 83, 82, 81, 80, 79]); -- Send a command to stuff a memory region: - Region_1 := (1, 1, 1, 1, 1, 1, 1, 1, 1, 1); + Region_1 := [1, 1, 1, 1, 1, 1, 1, 1, 1, 1]; Put_Line ("Copying to region 2 from region 1:"); Put_Line (Basic_Types.Representation.Image (Region_2)); Region := (Address => Region_1_Address, Length => Region_1'Length); @@ -979,7 +979,7 @@ package body Memory_Stuffer_Tests.Implementation is -- Check memory: Put_Line (Basic_Types.Representation.Image (Region_2)); - Byte_Array_Assert.Eq (Region_2, (1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 76, 77, 86, 85, 84, 83, 82, 81, 80, 79)); + Byte_Array_Assert.Eq (Region_2, [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 76, 77, 86, 85, 84, 83, 82, 81, 80, 79]); end Test_Memory_Region_Copy; overriding procedure Test_Memory_Region_Copy_Invalid_Address (Self : in out Instance) is @@ -989,8 +989,8 @@ package body Memory_Stuffer_Tests.Implementation is T : Component.Memory_Stuffer.Implementation.Tester.Instance_Access renames Self.Tester; begin -- Reset memory regions: - Region_1 := (1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - Region_2 := (98, 97, 96, 95, 94, 93, 92, 91, 90, 89, 88, 87, 86, 85, 84, 83, 82, 81, 80, 79); + Region_1 := [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; + Region_2 := [98, 97, 96, 95, 94, 93, 92, 91, 90, 89, 88, 87, 86, 85, 84, 83, 82, 81, 80, 79]; -- Init both regions with no protection: T.Component_Instance.Init (Regions'Access, null); @@ -1020,8 +1020,8 @@ package body Memory_Stuffer_Tests.Implementation is Memory_Region_Assert.Eq (T.Invalid_Copy_Destination_History.Get (1), (Region_3_Address, Region_1'Length)); -- Check memory, make sure its the same: - Byte_Array_Assert.Eq (Region_1, (1, 2, 3, 4, 5, 6, 7, 8, 9, 10)); - Byte_Array_Assert.Eq (Region_2, (98, 97, 96, 95, 94, 93, 92, 91, 90, 89, 88, 87, 86, 85, 84, 83, 82, 81, 80, 79)); + Byte_Array_Assert.Eq (Region_1, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]); + Byte_Array_Assert.Eq (Region_2, [98, 97, 96, 95, 94, 93, 92, 91, 90, 89, 88, 87, 86, 85, 84, 83, 82, 81, 80, 79]); -- Send a command to stuff a memory region, invalid: Put_Line ("Copying to region 1 from region 3:"); @@ -1044,8 +1044,8 @@ package body Memory_Stuffer_Tests.Implementation is Memory_Region_Assert.Eq (T.Invalid_Copy_Destination_History.Get (2), (Region_1_Address, Region_3'Length)); -- Check memory, make sure its the same: - Byte_Array_Assert.Eq (Region_1, (1, 2, 3, 4, 5, 6, 7, 8, 9, 10)); - Byte_Array_Assert.Eq (Region_2, (98, 97, 96, 95, 94, 93, 92, 91, 90, 89, 88, 87, 86, 85, 84, 83, 82, 81, 80, 79)); + Byte_Array_Assert.Eq (Region_1, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]); + Byte_Array_Assert.Eq (Region_2, [98, 97, 96, 95, 94, 93, 92, 91, 90, 89, 88, 87, 86, 85, 84, 83, 82, 81, 80, 79]); end Test_Memory_Region_Copy_Invalid_Address; end Memory_Stuffer_Tests.Implementation; diff --git a/src/components/parameter_store/test/parameter_store_tests-implementation.adb b/src/components/parameter_store/test/parameter_store_tests-implementation.adb index 6ad9e656..27c05e7f 100644 --- a/src/components/parameter_store/test/parameter_store_tests-implementation.adb +++ b/src/components/parameter_store/test/parameter_store_tests-implementation.adb @@ -26,7 +26,7 @@ package body Parameter_Store_Tests.Implementation is -- Globals: ------------------------------------------------------------------------- -- Declare memory store data: - Bytes : aliased Basic_Types.Byte_Array := (0 .. 99 => 0); + Bytes : aliased Basic_Types.Byte_Array := [0 .. 99 => 0]; ------------------------------------------------------------------------- -- Fixtures: @@ -41,7 +41,7 @@ package body Parameter_Store_Tests.Implementation is Self.Tester.Connect; -- Call component init here. - Bytes := (others => 0); + Bytes := [others => 0]; Bytes (1) := 1; Bytes (2) := 2; Bytes (3) := 3; @@ -121,15 +121,15 @@ package body Parameter_Store_Tests.Implementation is use Parameter_Enums.Parameter_Table_Operation_Type; T : Component.Parameter_Store.Implementation.Tester.Instance_Access renames Self.Tester; -- Create a memory region that holds the parameter table data. - Table : aliased Basic_Types.Byte_Array := (0 .. 99 => 17); + Table : aliased Basic_Types.Byte_Array := [0 .. 99 => 17]; Crc : Crc_16.Crc_16_Type; Region : constant Memory_Region.T := (Address => Table'Address, Length => Table'Length); Pkt : Packet.T; Expected_Packet_Data : Basic_Types.Byte_Array (0 .. 99) := Table; begin -- Set the version: - Table (Table'First .. Table'First + Parameter_Table_Header.Size_In_Bytes - 1) := Parameter_Table_Header.Serialization.To_Byte_Array ((Crc_Table => (0, 0), Version => 1.0)); - Expected_Packet_Data (Table'First .. Table'First + Parameter_Table_Header.Size_In_Bytes - 1) := Parameter_Table_Header.Serialization.To_Byte_Array ((Crc_Table => (0, 0), Version => 1.0)); + Table (Table'First .. Table'First + Parameter_Table_Header.Size_In_Bytes - 1) := Parameter_Table_Header.Serialization.To_Byte_Array ((Crc_Table => [0, 0], Version => 1.0)); + Expected_Packet_Data (Table'First .. Table'First + Parameter_Table_Header.Size_In_Bytes - 1) := Parameter_Table_Header.Serialization.To_Byte_Array ((Crc_Table => [0, 0], Version => 1.0)); -- Set the CRC: Crc := Crc_16.Compute_Crc_16 (Table (Table'First + Parameter_Table_Header.Crc_Section_Length .. Table'Last)); @@ -172,13 +172,13 @@ package body Parameter_Store_Tests.Implementation is use Parameter_Enums.Parameter_Table_Operation_Type; T : Component.Parameter_Store.Implementation.Tester.Instance_Access renames Self.Tester; -- Create a memory region that will hold the parameter table data. - Memory : aliased Basic_Types.Byte_Array (0 .. 99) := (others => 0); + Memory : aliased Basic_Types.Byte_Array (0 .. 99) := [others => 0]; Region : constant Memory_Region.T := (Address => Memory'Address, Length => Memory'Length); Crc : Crc_16.Crc_16_Type; begin -- Set the version: - Bytes := (others => 17); - Bytes (Bytes'First .. Bytes'First + Parameter_Table_Header.Size_In_Bytes - 1) := Parameter_Table_Header.Serialization.To_Byte_Array ((Crc_Table => (0, 0), Version => 1.0)); + Bytes := [others => 17]; + Bytes (Bytes'First .. Bytes'First + Parameter_Table_Header.Size_In_Bytes - 1) := Parameter_Table_Header.Serialization.To_Byte_Array ((Crc_Table => [0, 0], Version => 1.0)); -- Set the CRC: Crc := Crc_16.Compute_Crc_16 (Bytes (Bytes'First + Parameter_Table_Header.Crc_Section_Length .. Bytes'Last)); @@ -209,7 +209,7 @@ package body Parameter_Store_Tests.Implementation is use Parameter_Enums.Parameter_Table_Operation_Type; T : Component.Parameter_Store.Implementation.Tester.Instance_Access renames Self.Tester; -- Create a memory region that holds the parameter table data. - Table : aliased Basic_Types.Byte_Array := (0 .. 99 => 17); + Table : aliased Basic_Types.Byte_Array := [0 .. 99 => 17]; Region : Memory_Region.T := (Address => Table'Address, Length => Table'Length - 1); Before_Bytes : Basic_Types.Byte_Array (0 .. 99); begin @@ -263,7 +263,7 @@ package body Parameter_Store_Tests.Implementation is use Parameter_Enums.Parameter_Table_Operation_Type; T : Component.Parameter_Store.Implementation.Tester.Instance_Access renames Self.Tester; -- Create a memory region that holds the parameter table data. - Table : aliased Basic_Types.Byte_Array := (0 .. 99 => 17); + Table : aliased Basic_Types.Byte_Array := [0 .. 99 => 17]; Crc : Crc_16.Crc_16_Type; Region : constant Memory_Region.T := (Address => Table'Address, Length => Table'Length); Before_Bytes : Basic_Types.Byte_Array (0 .. 99); @@ -272,9 +272,9 @@ package body Parameter_Store_Tests.Implementation is Before_Bytes := Bytes; -- Calculate and set an invalid crc: - Table (Table'First .. Table'First + Parameter_Table_Header.Size_In_Bytes - 1) := Parameter_Table_Header.Serialization.To_Byte_Array ((Crc_Table => (0, 0), Version => 1.0)); + Table (Table'First .. Table'First + Parameter_Table_Header.Size_In_Bytes - 1) := Parameter_Table_Header.Serialization.To_Byte_Array ((Crc_Table => [0, 0], Version => 1.0)); Crc := Crc_16.Compute_Crc_16 (Table (Table'First + Parameter_Table_Header.Crc_Section_Length .. Table'Last)); - Table (Table'First .. Table'First + Parameter_Table_Header.Size_In_Bytes - 1) := Parameter_Table_Header.Serialization.To_Byte_Array ((Crc_Table => (98, 97), Version => 1.0)); + Table (Table'First .. Table'First + Parameter_Table_Header.Size_In_Bytes - 1) := Parameter_Table_Header.Serialization.To_Byte_Array ((Crc_Table => [98, 97], Version => 1.0)); -- Send the memory region to the component: T.Parameters_Memory_Region_T_Send ((Region => Region, Operation => Set)); @@ -284,7 +284,7 @@ package body Parameter_Store_Tests.Implementation is Natural_Assert.Eq (T.Event_T_Recv_Sync_History.Get_Count, 1); Natural_Assert.Eq (T.Memory_Region_Crc_Invalid_History.Get_Count, 1); Invalid_Parameters_Memory_Region_Crc_Assert.Eq - (T.Memory_Region_Crc_Invalid_History.Get (1), (Parameters_Region => (Region => (Address => Table'Address, Length => Table'Length), Operation => Set), Header => (Crc_Table => (98, 97), Version => 1.0), Computed_Crc => Crc)); + (T.Memory_Region_Crc_Invalid_History.Get (1), (Parameters_Region => (Region => (Address => Table'Address, Length => Table'Length), Operation => Set), Header => (Crc_Table => [98, 97], Version => 1.0), Computed_Crc => Crc)); -- A packet should not have been automatically dumped. Natural_Assert.Eq (T.Packet_T_Recv_Sync_History.Get_Count, 0); @@ -303,7 +303,7 @@ package body Parameter_Store_Tests.Implementation is use Parameter_Enums.Parameter_Table_Operation_Type; T : Component.Parameter_Store.Implementation.Tester.Instance_Access renames Self.Tester; -- Create a memory region that holds the parameter table data. - Table : aliased Basic_Types.Byte_Array := (0 .. 99 => 17); + Table : aliased Basic_Types.Byte_Array := [0 .. 99 => 17]; Region : Memory_Region.T := (Address => Table'Address, Length => Table'Length - 1); Before_Bytes : Basic_Types.Byte_Array (0 .. 99); begin @@ -357,7 +357,7 @@ package body Parameter_Store_Tests.Implementation is use Parameter_Enums.Parameter_Table_Operation_Type; T : Component.Parameter_Store.Implementation.Tester.Instance_Access renames Self.Tester; -- Create a memory region that holds the parameter table data. - Table : aliased Basic_Types.Byte_Array := (0 .. 99 => 17); + Table : aliased Basic_Types.Byte_Array := [0 .. 99 => 17]; Crc : Crc_16.Crc_16_Type; Region : constant Memory_Region.T := (Address => Table'Address, Length => Table'Length); Expected_Packet_Data : Basic_Types.Byte_Array (0 .. 99) := Table; @@ -366,8 +366,8 @@ package body Parameter_Store_Tests.Implementation is Self.Tester.Component_Instance.Init (Bytes => Bytes'Access, Dump_Parameters_On_Change => False); -- Set the version: - Table (Table'First .. Table'First + Parameter_Table_Header.Size_In_Bytes - 1) := Parameter_Table_Header.Serialization.To_Byte_Array ((Crc_Table => (0, 0), Version => 1.0)); - Expected_Packet_Data (Table'First .. Table'First + Parameter_Table_Header.Size_In_Bytes - 1) := Parameter_Table_Header.Serialization.To_Byte_Array ((Crc_Table => (0, 0), Version => 1.0)); + Table (Table'First .. Table'First + Parameter_Table_Header.Size_In_Bytes - 1) := Parameter_Table_Header.Serialization.To_Byte_Array ((Crc_Table => [0, 0], Version => 1.0)); + Expected_Packet_Data (Table'First .. Table'First + Parameter_Table_Header.Size_In_Bytes - 1) := Parameter_Table_Header.Serialization.To_Byte_Array ((Crc_Table => [0, 0], Version => 1.0)); -- Set the CRC: Crc := Crc_16.Compute_Crc_16 (Table (Table'First + Parameter_Table_Header.Crc_Section_Length .. Table'Last)); @@ -400,7 +400,7 @@ package body Parameter_Store_Tests.Implementation is T : Component.Parameter_Store.Implementation.Tester.Instance_Access renames Self.Tester; Cmd : Command.T; -- Create a memory region that will hold the parameter table data. - Memory : aliased Basic_Types.Byte_Array (0 .. 99) := (others => 0); + Memory : aliased Basic_Types.Byte_Array (0 .. 99) := [others => 0]; Region : constant Memory_Region.T := (Address => Memory'Address, Length => Memory'Length); begin -- Send 3 commands to fill up queue. @@ -449,7 +449,7 @@ package body Parameter_Store_Tests.Implementation is -- Make sure some events were thrown: Natural_Assert.Eq (T.Event_T_Recv_Sync_History.Get_Count, 1); Natural_Assert.Eq (T.Invalid_Command_Received_History.Get_Count, 1); - Invalid_Command_Info_Assert.Eq (T.Invalid_Command_Received_History.Get (1), (Id => T.Commands.Get_Dump_Parameter_Store_Id, Errant_Field_Number => Interfaces.Unsigned_32'Last, Errant_Field => (0, 0, 0, 0, 0, 0, 0, 22))); + Invalid_Command_Info_Assert.Eq (T.Invalid_Command_Received_History.Get (1), (Id => T.Commands.Get_Dump_Parameter_Store_Id, Errant_Field_Number => Interfaces.Unsigned_32'Last, Errant_Field => [0, 0, 0, 0, 0, 0, 0, 22])); end Test_Invalid_Command; end Parameter_Store_Tests.Implementation; diff --git a/src/components/parameters/component-parameters-implementation.adb b/src/components/parameters/component-parameters-implementation.adb index 209ae622..b0a402e4 100644 --- a/src/components/parameters/component-parameters-implementation.adb +++ b/src/components/parameters/component-parameters-implementation.adb @@ -97,7 +97,7 @@ package body Component.Parameters.Implementation is Param_Update : Parameter_Update.T := ( Operation => Fetch, Status => Success, - Param => (Header => (Id => Param_Entry.Id, Buffer_Length => 0), Buffer => (others => 0) + Param => (Header => (Id => Param_Entry.Id, Buffer_Length => 0), Buffer => [others => 0] )); -- Calculate expected parameter length: Param_Length : constant Parameter_Types.Parameter_Buffer_Length_Type := Param_Entry.End_Index - Param_Entry.Start_Index + 1; @@ -266,7 +266,7 @@ package body Component.Parameters.Implementation is Param_Update : Parameter_Update.T := ( Operation => Stage, Status => Success, - Param => (Header => (Id => Param_Entry.Id, Buffer_Length => Param_Length), Buffer => (others => 0) + Param => (Header => (Id => Param_Entry.Id, Buffer_Length => Param_Length), Buffer => [others => 0] )); -- Component index: Idx : constant Parameter_Update_T_Provide_Index := Parameter_Update_T_Provide_Index (Param_Entry.Component_Id); @@ -298,7 +298,7 @@ package body Component.Parameters.Implementation is Param_Update : Parameter_Update.T := ( Operation => Update, Status => Success, - Param => (Header => (Id => 0, Buffer_Length => 0), Buffer => (others => 0) + Param => (Header => (Id => 0, Buffer_Length => 0), Buffer => [others => 0] )); -- Component index: Idx : constant Parameter_Update_T_Provide_Index := Parameter_Update_T_Provide_Index (Component_Id); @@ -354,7 +354,7 @@ package body Component.Parameters.Implementation is End_Index => Param_Entry.End_Index ); -- Create a temporary buffer to hold the parameter value: - Value : Parameter_Types.Parameter_Buffer_Type := (others => 0); + Value : Parameter_Types.Parameter_Buffer_Type := [others => 0]; begin -- Copy the bytes from the pointer into a temporary buffer that is the maximum -- size of a parameter buffer: diff --git a/src/components/parameters/component-parameters-implementation.ads b/src/components/parameters/component-parameters-implementation.ads index 66795bab..1f7c4b6c 100644 --- a/src/components/parameters/component-parameters-implementation.ads +++ b/src/components/parameters/component-parameters-implementation.ads @@ -29,7 +29,7 @@ private type Instance is new Parameters.Base_Instance with record Entries : Parameters_Component_Types.Parameter_Table_Entry_List_Access := null; Dump_Parameters_On_Change : Boolean := False; - Stored_Crc : Crc_16.Crc_16_Type := (0, 0); + Stored_Crc : Crc_16.Crc_16_Type := [0, 0]; Table_Version : Short_Float := 0.0; -- Some useful constants calculated in Init: Parameter_Table_Data_Length : Natural := 0; diff --git a/src/components/parameters/gen/templates/parameter_table/name.ads b/src/components/parameters/gen/templates/parameter_table/name.ads index 10f8af25..ddd1ac69 100644 --- a/src/components/parameters/gen/templates/parameter_table/name.ads +++ b/src/components/parameters/gen/templates/parameter_table/name.ads @@ -11,7 +11,7 @@ package {{ name[0]|upper }}{{ name[1:] }} is Parameter_Table_Size_In_Bytes : constant Natural := {{ size }}; -- A list of the parameter table entries for use by the {{ parameters_instance_name }} component. - Parameter_Table_Entries : aliased Parameter_Table_Entry_List := ( + Parameter_Table_Entries : aliased Parameter_Table_Entry_List := [ {% for table_entry in parameters.values() %} -- Parameter {{ table_entry.name }}, size of {{ (table_entry.size/8)|int }} byte(s). {{ loop.index0 }} => ( @@ -21,6 +21,6 @@ package {{ name[0]|upper }}{{ name[1:] }} is End_Index => {{ table_entry.end_index}} ){{ "," if not loop.last }} {% endfor %} - ); + ]; end {{ name[0]|upper }}{{ name[1:] }}; diff --git a/src/components/parameters/test/parameters_tests-implementation.adb b/src/components/parameters/test/parameters_tests-implementation.adb index 03c386bf..564e595c 100644 --- a/src/components/parameters/test/parameters_tests-implementation.adb +++ b/src/components/parameters/test/parameters_tests-implementation.adb @@ -68,8 +68,8 @@ package body Parameters_Tests.Implementation is procedure Init_Nominal is -- A list of the parameter table entries for use by the component. Parameter_Table_Entries : aliased Parameters_Component_Types.Parameter_Table_Entry_List := - ((Id => 2, Component_Id => 1, Start_Index => 0, End_Index => 3), (Id => 5, Component_Id => 3, Start_Index => 4, End_Index => 15), (Id => 1, Component_Id => 1, Start_Index => 16, End_Index => 17), - (Id => 3, Component_Id => 2, Start_Index => 18, End_Index => 19), (Id => 4, Component_Id => 2, Start_Index => 20, End_Index => 23)); + [(Id => 2, Component_Id => 1, Start_Index => 0, End_Index => 3), (Id => 5, Component_Id => 3, Start_Index => 4, End_Index => 15), (Id => 1, Component_Id => 1, Start_Index => 16, End_Index => 17), + (Id => 3, Component_Id => 2, Start_Index => 18, End_Index => 19), (Id => 4, Component_Id => 2, Start_Index => 20, End_Index => 23)]; begin T.Component_Instance.Init (Parameter_Table_Entries'Unchecked_Access, False); exception @@ -81,8 +81,8 @@ package body Parameters_Tests.Implementation is procedure Init_Nonunique_Ids is -- A list of the parameter table entries for use by the component. Parameter_Table_Entries : aliased Parameters_Component_Types.Parameter_Table_Entry_List := - ((Id => 2, Component_Id => 1, Start_Index => 0, End_Index => 3), (Id => 5, Component_Id => 3, Start_Index => 4, End_Index => 15), (Id => 1, Component_Id => 1, Start_Index => 16, End_Index => 17), - (Id => 3, Component_Id => 2, Start_Index => 18, End_Index => 19), (Id => 2, Component_Id => 2, Start_Index => 20, End_Index => 23)); + [(Id => 2, Component_Id => 1, Start_Index => 0, End_Index => 3), (Id => 5, Component_Id => 3, Start_Index => 4, End_Index => 15), (Id => 1, Component_Id => 1, Start_Index => 16, End_Index => 17), + (Id => 3, Component_Id => 2, Start_Index => 18, End_Index => 19), (Id => 2, Component_Id => 2, Start_Index => 20, End_Index => 23)]; begin T.Component_Instance.Init (Parameter_Table_Entries'Unchecked_Access, False); Assert (False, "Unique Id init failed!"); @@ -95,8 +95,8 @@ package body Parameters_Tests.Implementation is procedure Init_Bad_Component_Id is -- A list of the parameter table entries for use by the component. Parameter_Table_Entries : aliased Parameters_Component_Types.Parameter_Table_Entry_List := - ((Id => 2, Component_Id => 1, Start_Index => 0, End_Index => 3), (Id => 5, Component_Id => 3, Start_Index => 4, End_Index => 15), (Id => 1, Component_Id => 1, Start_Index => 16, End_Index => 17), - (Id => 3, Component_Id => 2, Start_Index => 18, End_Index => 19), (Id => 4, Component_Id => 5, Start_Index => 20, End_Index => 23)); + [(Id => 2, Component_Id => 1, Start_Index => 0, End_Index => 3), (Id => 5, Component_Id => 3, Start_Index => 4, End_Index => 15), (Id => 1, Component_Id => 1, Start_Index => 16, End_Index => 17), + (Id => 3, Component_Id => 2, Start_Index => 18, End_Index => 19), (Id => 4, Component_Id => 5, Start_Index => 20, End_Index => 23)]; begin T.Component_Instance.Init (Parameter_Table_Entries'Unchecked_Access, False); Assert (False, "Component Id init failed!"); @@ -109,8 +109,8 @@ package body Parameters_Tests.Implementation is procedure Init_Unconnected_Component_Id is -- A list of the parameter table entries for use by the component. Parameter_Table_Entries : aliased Parameters_Component_Types.Parameter_Table_Entry_List := - ((Id => 2, Component_Id => 1, Start_Index => 0, End_Index => 3), (Id => 5, Component_Id => 3, Start_Index => 4, End_Index => 15), (Id => 1, Component_Id => 1, Start_Index => 16, End_Index => 17), - (Id => 3, Component_Id => 2, Start_Index => 18, End_Index => 19), (Id => 4, Component_Id => 4, Start_Index => 20, End_Index => 23)); + [(Id => 2, Component_Id => 1, Start_Index => 0, End_Index => 3), (Id => 5, Component_Id => 3, Start_Index => 4, End_Index => 15), (Id => 1, Component_Id => 1, Start_Index => 16, End_Index => 17), + (Id => 3, Component_Id => 2, Start_Index => 18, End_Index => 19), (Id => 4, Component_Id => 4, Start_Index => 20, End_Index => 23)]; begin T.Component_Instance.Init (Parameter_Table_Entries'Unchecked_Access, False); Assert (False, "Unconnected Component Id init failed!"); @@ -123,8 +123,8 @@ package body Parameters_Tests.Implementation is procedure Init_Bad_Layout_1 is -- A list of the parameter table entries for use by the component. Parameter_Table_Entries : aliased Parameters_Component_Types.Parameter_Table_Entry_List := - ((Id => 2, Component_Id => 1, Start_Index => 2, End_Index => 0), (Id => 5, Component_Id => 3, Start_Index => 4, End_Index => 15), (Id => 1, Component_Id => 1, Start_Index => 16, End_Index => 17), - (Id => 3, Component_Id => 2, Start_Index => 18, End_Index => 19), (Id => 4, Component_Id => 2, Start_Index => 20, End_Index => 23)); + [(Id => 2, Component_Id => 1, Start_Index => 2, End_Index => 0), (Id => 5, Component_Id => 3, Start_Index => 4, End_Index => 15), (Id => 1, Component_Id => 1, Start_Index => 16, End_Index => 17), + (Id => 3, Component_Id => 2, Start_Index => 18, End_Index => 19), (Id => 4, Component_Id => 2, Start_Index => 20, End_Index => 23)]; begin T.Component_Instance.Init (Parameter_Table_Entries'Unchecked_Access, False); Assert (False, "Bad Layout 2 init failed!"); @@ -137,8 +137,8 @@ package body Parameters_Tests.Implementation is procedure Init_Bad_Layout_2 is -- A list of the parameter table entries for use by the component. Parameter_Table_Entries : aliased Parameters_Component_Types.Parameter_Table_Entry_List := - ((Id => 2, Component_Id => 1, Start_Index => 0, End_Index => 3), (Id => 5, Component_Id => 3, Start_Index => 4, End_Index => 15), (Id => 1, Component_Id => 1, Start_Index => 16, End_Index => 17), - (Id => 3, Component_Id => 2, Start_Index => 18, End_Index => 19), (Id => 4, Component_Id => 2, Start_Index => 21, End_Index => 23)); + [(Id => 2, Component_Id => 1, Start_Index => 0, End_Index => 3), (Id => 5, Component_Id => 3, Start_Index => 4, End_Index => 15), (Id => 1, Component_Id => 1, Start_Index => 16, End_Index => 17), + (Id => 3, Component_Id => 2, Start_Index => 18, End_Index => 19), (Id => 4, Component_Id => 2, Start_Index => 21, End_Index => 23)]; begin T.Component_Instance.Init (Parameter_Table_Entries'Unchecked_Access, False); Assert (False, "Bad Layout 2 init failed!"); @@ -184,12 +184,12 @@ package body Parameters_Tests.Implementation is -- Check packet contents: Table_Bytes := Test_Parameter_Table_Record.Serialization.To_Byte_Array - ((Crc_Calculated => (0, 0), Header => (Crc_Table => (0, 0), Version => 0.0), Component_A_Parameter_I32 => (Value => -56), Component_C_The_Tick => ((1, 2), 3), Component_A_Parameter_U16 => (Value => 15), Component_B_Parameter_U16 => (Value => 15), + ((Crc_Calculated => [0, 0], Header => (Crc_Table => [0, 0], Version => 0.0), Component_A_Parameter_I32 => (Value => -56), Component_C_The_Tick => ((1, 2), 3), Component_A_Parameter_U16 => (Value => 15), Component_B_Parameter_U16 => (Value => 15), Component_B_Parameter_I32 => (Value => -56))); Crc := Crc_16.Compute_Crc_16 (Table_Bytes (Table_Bytes'First + Crc_16.Crc_16_Type'Length + Parameter_Table_Header.Crc_Section_Length .. Table_Bytes'Last)); Table_Bytes := Test_Parameter_Table_Record.Serialization.To_Byte_Array - ((Crc_Calculated => Crc, Header => (Crc_Table => (0, 0), Version => 0.0), Component_A_Parameter_I32 => (Value => -56), Component_C_The_Tick => ((1, 2), 3), Component_A_Parameter_U16 => (Value => 15), Component_B_Parameter_U16 => (Value => 15), + ((Crc_Calculated => Crc, Header => (Crc_Table => [0, 0], Version => 0.0), Component_A_Parameter_I32 => (Value => -56), Component_C_The_Tick => ((1, 2), 3), Component_A_Parameter_U16 => (Value => 15), Component_B_Parameter_U16 => (Value => 15), Component_B_Parameter_I32 => (Value => -56))); Byte_Array_Assert.Eq (Pkt.Buffer (0 .. Pkt.Header.Buffer_Length - 1), Table_Bytes); @@ -225,7 +225,7 @@ package body Parameters_Tests.Implementation is overriding procedure Test_Nominal_Update_Parameters (Self : in out Instance) is T : Component.Parameters.Implementation.Tester.Instance_Access renames Self.Tester; Pkt : Packet.T; - Param : Parameter.T := (Header => (Id => 3, Buffer_Length => 2), Buffer => (0 => 0, 1 => 17, others => 0)); + Param : Parameter.T := (Header => (Id => 3, Buffer_Length => 2), Buffer => [0 => 0, 1 => 17, others => 0]); Cmd : Command.T; Table_Bytes : Test_Parameter_Table_Record.Serialization.Byte_Array; Crc : Crc_16.Crc_16_Type; @@ -256,17 +256,17 @@ package body Parameters_Tests.Implementation is -- Check packet contents: Table_Bytes := Test_Parameter_Table_Record.Serialization.To_Byte_Array - ((Crc_Calculated => (0, 0), Header => (Crc_Table => (0, 0), Version => 0.0), Component_A_Parameter_I32 => (Value => -56), Component_C_The_Tick => ((1, 2), 3), Component_A_Parameter_U16 => (Value => 15), Component_B_Parameter_U16 => (Value => 17), + ((Crc_Calculated => [0, 0], Header => (Crc_Table => [0, 0], Version => 0.0), Component_A_Parameter_I32 => (Value => -56), Component_C_The_Tick => ((1, 2), 3), Component_A_Parameter_U16 => (Value => 15), Component_B_Parameter_U16 => (Value => 17), Component_B_Parameter_I32 => (Value => -56))); Crc := Crc_16.Compute_Crc_16 (Table_Bytes (Table_Bytes'First + Crc_16.Crc_16_Type'Length + Parameter_Table_Header.Crc_Section_Length .. Table_Bytes'Last)); Table_Bytes := Test_Parameter_Table_Record.Serialization.To_Byte_Array - ((Crc_Calculated => Crc, Header => (Crc_Table => (0, 0), Version => 0.0), Component_A_Parameter_I32 => (Value => -56), Component_C_The_Tick => ((1, 2), 3), Component_A_Parameter_U16 => (Value => 15), Component_B_Parameter_U16 => (Value => 17), + ((Crc_Calculated => Crc, Header => (Crc_Table => [0, 0], Version => 0.0), Component_A_Parameter_I32 => (Value => -56), Component_C_The_Tick => ((1, 2), 3), Component_A_Parameter_U16 => (Value => 15), Component_B_Parameter_U16 => (Value => 17), Component_B_Parameter_I32 => (Value => -56))); Byte_Array_Assert.Eq (Pkt.Buffer (0 .. Pkt.Header.Buffer_Length - 1), Table_Bytes); -- Send another command to update a parameter value: - Param := (Header => (Id => 2, Buffer_Length => 4), Buffer => (0 => 0, 1 => 0, 2 => 0, 3 => 99, others => 0)); + Param := (Header => (Id => 2, Buffer_Length => 4), Buffer => [0 => 0, 1 => 0, 2 => 0, 3 => 99, others => 0]); pragma Assert (T.Commands.Update_Parameter (Param, Cmd) = Success); T.Command_T_Send (Cmd); Natural_Assert.Eq (T.Dispatch_All, 1); @@ -292,12 +292,12 @@ package body Parameters_Tests.Implementation is -- Check packet contents: Table_Bytes := Test_Parameter_Table_Record.Serialization.To_Byte_Array - ((Crc_Calculated => (0, 0), Header => (Crc_Table => (0, 0), Version => 0.0), Component_A_Parameter_I32 => (Value => 99), Component_C_The_Tick => ((1, 2), 3), Component_A_Parameter_U16 => (Value => 15), Component_B_Parameter_U16 => (Value => 17), + ((Crc_Calculated => [0, 0], Header => (Crc_Table => [0, 0], Version => 0.0), Component_A_Parameter_I32 => (Value => 99), Component_C_The_Tick => ((1, 2), 3), Component_A_Parameter_U16 => (Value => 15), Component_B_Parameter_U16 => (Value => 17), Component_B_Parameter_I32 => (Value => -56))); Crc := Crc_16.Compute_Crc_16 (Table_Bytes (Table_Bytes'First + Crc_16.Crc_16_Type'Length + Parameter_Table_Header.Crc_Section_Length .. Table_Bytes'Last)); Table_Bytes := Test_Parameter_Table_Record.Serialization.To_Byte_Array - ((Crc_Calculated => Crc, Header => (Crc_Table => (0, 0), Version => 0.0), Component_A_Parameter_I32 => (Value => 99), Component_C_The_Tick => ((1, 2), 3), Component_A_Parameter_U16 => (Value => 15), Component_B_Parameter_U16 => (Value => 17), + ((Crc_Calculated => Crc, Header => (Crc_Table => [0, 0], Version => 0.0), Component_A_Parameter_I32 => (Value => 99), Component_C_The_Tick => ((1, 2), 3), Component_A_Parameter_U16 => (Value => 15), Component_B_Parameter_U16 => (Value => 17), Component_B_Parameter_I32 => (Value => -56))); Byte_Array_Assert.Eq (Pkt.Buffer (0 .. Pkt.Header.Buffer_Length - 1), Table_Bytes); end Test_Nominal_Update_Parameters; @@ -309,7 +309,7 @@ package body Parameters_Tests.Implementation is -- Create a memory region that holds the parameter table data. Table : aliased Test_Parameter_Table_Record.Serialization.Byte_Array := Test_Parameter_Table_Record.Serialization.To_Byte_Array - ((Crc_Calculated => (0, 0), Header => (Crc_Table => (0, 0), Version => 1.0), Component_A_Parameter_I32 => (Value => 99), Component_C_The_Tick => ((3, 2), 8), Component_A_Parameter_U16 => (Value => 19), Component_B_Parameter_U16 => (Value => 12), + ((Crc_Calculated => [0, 0], Header => (Crc_Table => [0, 0], Version => 1.0), Component_A_Parameter_I32 => (Value => 99), Component_C_The_Tick => ((3, 2), 8), Component_A_Parameter_U16 => (Value => 19), Component_B_Parameter_U16 => (Value => 12), Component_B_Parameter_I32 => (Value => -22))); Crc : constant Crc_16.Crc_16_Type := Crc_16.Compute_Crc_16 (Table (Table'First + Crc_16.Crc_16_Type'Length + Parameter_Table_Header.Crc_Section_Length .. Table'Last)); Region : constant Memory_Region.T := (Address => Table'Address + Crc_16.Crc_16_Type'Length, Length => Test_Parameter_Table_Record.Serialization.Serialized_Length - Crc_16.Crc_16_Type'Length); @@ -359,15 +359,15 @@ package body Parameters_Tests.Implementation is -- A variable that contains the expected table values to compare against Dump : constant Test_Parameter_Table_Record.Serialization.Byte_Array := Test_Parameter_Table_Record.Serialization.To_Byte_Array - ((Crc_Calculated => (0, 0), Header => (Crc_Table => (0, 0), Version => 0.0), Component_A_Parameter_I32 => (Value => -56), Component_C_The_Tick => ((1, 2), 3), Component_A_Parameter_U16 => (Value => 15), Component_B_Parameter_U16 => (Value => 15), + ((Crc_Calculated => [0, 0], Header => (Crc_Table => [0, 0], Version => 0.0), Component_A_Parameter_I32 => (Value => -56), Component_C_The_Tick => ((1, 2), 3), Component_A_Parameter_U16 => (Value => 15), Component_B_Parameter_U16 => (Value => 15), Component_B_Parameter_I32 => (Value => -56))); Table : Basic_Types.Byte_Array (0 .. Test_Parameter_Table_Record.Size_In_Bytes - Crc_16.Crc_16_Type'Length - 1) := Dump (Dump'First + Crc_16.Crc_16_Type'Length .. Dump'Last); -- Create a memory region that will hold the parameter table data. - Memory : aliased Basic_Types.Byte_Array (0 .. Test_Parameter_Table_Record.Serialization.Serialized_Length - Crc_16.Crc_16_Type'Length - 1) := (others => 0); + Memory : aliased Basic_Types.Byte_Array (0 .. Test_Parameter_Table_Record.Serialization.Serialized_Length - Crc_16.Crc_16_Type'Length - 1) := [others => 0]; Region : constant Memory_Region.T := (Address => Memory'Address, Length => Memory'Length); begin -- Set the CRC: - Table (Table'First .. Table'First + Parameter_Table_Header.Size_In_Bytes - 1) := Parameter_Table_Header.Serialization.To_Byte_Array ((Crc_Table => (0, 0), Version => 0.0)); + Table (Table'First .. Table'First + Parameter_Table_Header.Size_In_Bytes - 1) := Parameter_Table_Header.Serialization.To_Byte_Array ((Crc_Table => [0, 0], Version => 0.0)); -- Send the memory region to the component with a get request: T.Parameters_Memory_Region_T_Send ((Region => Region, Operation => Get)); @@ -422,7 +422,7 @@ package body Parameters_Tests.Implementation is Byte_Array_Assert.Neq (Pkt.Buffer (0 .. Pkt.Header.Buffer_Length - 1), Test_Parameter_Table_Record.Serialization.To_Byte_Array - ((Crc_Calculated => (0, 0), Header => (Crc_Table => (0, 0), Version => 0.0), Component_A_Parameter_I32 => (Value => -56), Component_C_The_Tick => ((1, 2), 3), Component_A_Parameter_U16 => (Value => 15), Component_B_Parameter_U16 => (Value => 15), + ((Crc_Calculated => [0, 0], Header => (Crc_Table => [0, 0], Version => 0.0), Component_A_Parameter_I32 => (Value => -56), Component_C_The_Tick => ((1, 2), 3), Component_A_Parameter_U16 => (Value => 15), Component_B_Parameter_U16 => (Value => 15), Component_B_Parameter_I32 => (Value => -56)))); -- Check events: @@ -455,7 +455,7 @@ package body Parameters_Tests.Implementation is Byte_Array_Assert.Neq (Pkt.Buffer (0 .. Pkt.Header.Buffer_Length - 1), Test_Parameter_Table_Record.Serialization.To_Byte_Array - ((Crc_Calculated => (0, 0), Header => (Crc_Table => (0, 0), Version => 0.0), Component_A_Parameter_I32 => (Value => -56), Component_C_The_Tick => ((1, 2), 3), Component_A_Parameter_U16 => (Value => 15), Component_B_Parameter_U16 => (Value => 15), + ((Crc_Calculated => [0, 0], Header => (Crc_Table => [0, 0], Version => 0.0), Component_A_Parameter_I32 => (Value => -56), Component_C_The_Tick => ((1, 2), 3), Component_A_Parameter_U16 => (Value => 15), Component_B_Parameter_U16 => (Value => 15), Component_B_Parameter_I32 => (Value => -56)))); -- Check events: @@ -476,7 +476,7 @@ package body Parameters_Tests.Implementation is use Parameter_Enums.Parameter_Operation_Type; T : Component.Parameters.Implementation.Tester.Instance_Access renames Self.Tester; Pkt : Packet.T; - Param : Parameter.T := (Header => (Id => 99, Buffer_Length => 2), Buffer => (0 => 0, 1 => 17, others => 0)); + Param : Parameter.T := (Header => (Id => 99, Buffer_Length => 2), Buffer => [0 => 0, 1 => 17, others => 0]); Cmd : Command.T; begin -- Send a command to update a parameter value with bad ID. @@ -580,7 +580,7 @@ package body Parameters_Tests.Implementation is -- Create a memory region that holds the parameter table data. Dump : constant Test_Parameter_Table_Record.Serialization.Byte_Array := Test_Parameter_Table_Record.Serialization.To_Byte_Array - ((Crc_Calculated => (0, 0), Header => (Crc_Table => (0, 0), Version => 1.0), Component_A_Parameter_I32 => (Value => 99), Component_C_The_Tick => ((3, 2), 8), Component_A_Parameter_U16 => (Value => 19), Component_B_Parameter_U16 => (Value => 12), + ((Crc_Calculated => [0, 0], Header => (Crc_Table => [0, 0], Version => 1.0), Component_A_Parameter_I32 => (Value => 99), Component_C_The_Tick => ((3, 2), 8), Component_A_Parameter_U16 => (Value => 19), Component_B_Parameter_U16 => (Value => 12), Component_B_Parameter_I32 => (Value => -22))); Table : aliased Basic_Types.Byte_Array (0 .. Test_Parameter_Table_Record.Size_In_Bytes - Crc_16.Crc_16_Type'Length - 1) := Dump (Dump'First + Crc_16.Crc_16_Type'Length .. Dump'Last); Crc : constant Crc_16.Crc_16_Type := Crc_16.Compute_Crc_16 (Table (Table'First + Parameter_Table_Header.Crc_Section_Length .. Table'Last)); @@ -630,7 +630,7 @@ package body Parameters_Tests.Implementation is -- -- Send the memory region to the component with a get request, but with bad CRC: -- - Table (Table'First .. Table'First + Parameter_Table_Header.Size_In_Bytes - 1) := Parameter_Table_Header.Serialization.To_Byte_Array ((Crc_Table => (6, 7), Version => 1.0)); + Table (Table'First .. Table'First + Parameter_Table_Header.Size_In_Bytes - 1) := Parameter_Table_Header.Serialization.To_Byte_Array ((Crc_Table => [6, 7], Version => 1.0)); T.Parameters_Memory_Region_T_Send ((Region => (Address => Table'Address, Length => Table'Length), Operation => Set)); Natural_Assert.Eq (T.Dispatch_All, 1); @@ -638,7 +638,7 @@ package body Parameters_Tests.Implementation is Natural_Assert.Eq (T.Event_T_Recv_Sync_History.Get_Count, 10); Natural_Assert.Eq (T.Memory_Region_Crc_Invalid_History.Get_Count, 1); Invalid_Parameters_Memory_Region_Crc_Assert.Eq - (T.Memory_Region_Crc_Invalid_History.Get (1), (Parameters_Region => (Region => (Address => Table'Address, Length => Table'Length), Operation => Set), Header => (Crc_Table => (6, 7), Version => 1.0), Computed_Crc => Crc)); + (T.Memory_Region_Crc_Invalid_History.Get (1), (Parameters_Region => (Region => (Address => Table'Address, Length => Table'Length), Operation => Set), Header => (Crc_Table => [6, 7], Version => 1.0), Computed_Crc => Crc)); -- A packet should not have been automatically dumped. Natural_Assert.Eq (T.Packet_T_Recv_Sync_History.Get_Count, 1); @@ -657,11 +657,11 @@ package body Parameters_Tests.Implementation is -- A variable that contains the expected table values to compare against Table : aliased Test_Parameter_Table_Record.Serialization.Byte_Array := Test_Parameter_Table_Record.Serialization.To_Byte_Array - ((Crc_Calculated => (0, 0), Header => (Crc_Table => (0, 0), Version => 0.0), Component_A_Parameter_I32 => (Value => -56), Component_C_The_Tick => ((1, 2), 3), Component_A_Parameter_U16 => (Value => 15), Component_B_Parameter_U16 => (Value => 15), + ((Crc_Calculated => [0, 0], Header => (Crc_Table => [0, 0], Version => 0.0), Component_A_Parameter_I32 => (Value => -56), Component_C_The_Tick => ((1, 2), 3), Component_A_Parameter_U16 => (Value => 15), Component_B_Parameter_U16 => (Value => 15), Component_B_Parameter_I32 => (Value => -56))); Crc : constant Crc_16.Crc_16_Type := Crc_16.Compute_Crc_16 (Table (Table'First + Crc_16.Crc_16_Type'Length + Parameter_Table_Header.Crc_Section_Length .. Table'Last)); -- Create a memory region that will hold the parameter table data. - Memory : aliased Basic_Types.Byte_Array (0 .. Test_Parameter_Table_Record.Serialization.Serialized_Length - Crc_16.Crc_16_Type'Length - 1) := (others => 0); + Memory : aliased Basic_Types.Byte_Array (0 .. Test_Parameter_Table_Record.Serialization.Serialized_Length - Crc_16.Crc_16_Type'Length - 1) := [others => 0]; Region : constant Memory_Region.T := (Address => Memory'Address, Length => Memory'Length); begin -- Set the CRC: @@ -753,12 +753,12 @@ package body Parameters_Tests.Implementation is use Parameter_Enums.Parameter_Table_Operation_Type; use Parameter_Enums.Parameter_Table_Update_Status; T : Component.Parameters.Implementation.Tester.Instance_Access renames Self.Tester; - Param : constant Parameter.T := (Header => (Id => 3, Buffer_Length => 2), Buffer => (0 => 0, 1 => 17, others => 0)); + Param : constant Parameter.T := (Header => (Id => 3, Buffer_Length => 2), Buffer => [0 => 0, 1 => 17, others => 0]); Cmd : Command.T; -- Create a memory region that holds the parameter table data. Dump : constant Test_Parameter_Table_Record.Serialization.Byte_Array := Test_Parameter_Table_Record.Serialization.To_Byte_Array - ((Crc_Calculated => (0, 0), Header => (Crc_Table => (0, 0), Version => 0.0), Component_A_Parameter_I32 => (Value => 99), Component_C_The_Tick => ((3, 2), 8), Component_A_Parameter_U16 => (Value => 19), Component_B_Parameter_U16 => (Value => 12), + ((Crc_Calculated => [0, 0], Header => (Crc_Table => [0, 0], Version => 0.0), Component_A_Parameter_I32 => (Value => 99), Component_C_The_Tick => ((3, 2), 8), Component_A_Parameter_U16 => (Value => 19), Component_B_Parameter_U16 => (Value => 12), Component_B_Parameter_I32 => (Value => -22))); Table : aliased Basic_Types.Byte_Array (0 .. Test_Parameter_Table_Record.Size_In_Bytes - Crc_16.Crc_16_Type'Length - 1) := Dump (Dump'First + Crc_16.Crc_16_Type'Length .. Dump'Last); Crc : constant Crc_16.Crc_16_Type := Crc_16.Compute_Crc_16 (Table (Table'First + Parameter_Table_Header.Crc_Section_Length .. Table'Last)); @@ -809,10 +809,10 @@ package body Parameters_Tests.Implementation is use Parameter_Enums.Parameter_Table_Operation_Type; T : Component.Parameters.Implementation.Tester.Instance_Access renames Self.Tester; -- Create maximum size parameter to fill queue. - Param : constant Parameter.T := (Header => (Id => 3, Buffer_Length => Parameter_Types.Parameter_Buffer_Length_Type'Last), Buffer => (0 => 0, 1 => 17, others => 0)); + Param : constant Parameter.T := (Header => (Id => 3, Buffer_Length => Parameter_Types.Parameter_Buffer_Length_Type'Last), Buffer => [0 => 0, 1 => 17, others => 0]); Cmd : Command.T; -- Create a memory region that will hold the parameter table data. - Memory : aliased Basic_Types.Byte_Array (0 .. Test_Parameter_Table_Record.Serialization.Serialized_Length - Crc_16.Crc_16_Type'Length - 1) := (others => 0); + Memory : aliased Basic_Types.Byte_Array (0 .. Test_Parameter_Table_Record.Serialization.Serialized_Length - Crc_16.Crc_16_Type'Length - 1) := [others => 0]; Region : constant Memory_Region.T := (Address => Memory'Address + Crc_16.Crc_16_Type'Length, Length => Memory'Length); begin -- Send 3 commands to fill up queue. @@ -862,7 +862,7 @@ package body Parameters_Tests.Implementation is -- Make sure some events were thrown: Natural_Assert.Eq (T.Event_T_Recv_Sync_History.Get_Count, 1); Natural_Assert.Eq (T.Invalid_Command_Received_History.Get_Count, 1); - Invalid_Command_Info_Assert.Eq (T.Invalid_Command_Received_History.Get (1), (Id => T.Commands.Get_Dump_Parameters_Id, Errant_Field_Number => Interfaces.Unsigned_32'Last, Errant_Field => (0, 0, 0, 0, 0, 0, 0, 22))); + Invalid_Command_Info_Assert.Eq (T.Invalid_Command_Received_History.Get (1), (Id => T.Commands.Get_Dump_Parameters_Id, Errant_Field_Number => Interfaces.Unsigned_32'Last, Errant_Field => [0, 0, 0, 0, 0, 0, 0, 22])); end Test_Invalid_Command; end Parameters_Tests.Implementation; diff --git a/src/components/pid_controller/component-pid_controller-implementation.adb b/src/components/pid_controller/component-pid_controller-implementation.adb index ad673c36..c02434ac 100644 --- a/src/components/pid_controller/component-pid_controller-implementation.adb +++ b/src/components/pid_controller/component-pid_controller-implementation.adb @@ -70,7 +70,7 @@ package body Component.Pid_Controller.Implementation is end if; -- Set the packet data to a clean packet - Self.Diagnostic_Packet := (Header => (Time => (0, 0), Id => Self.Packets.Get_Pid_Controller_Diagnostic_Packet_Id, Sequence_Count => 0, Buffer_Length => 0), Buffer => (others => 0)); + Self.Diagnostic_Packet := (Header => (Time => (0, 0), Id => Self.Packets.Get_Pid_Controller_Diagnostic_Packet_Id, Sequence_Count => 0, Buffer_Length => 0), Buffer => [others => 0]); end Init; diff --git a/src/components/pid_controller/test/component-pid_controller-implementation-tester.adb b/src/components/pid_controller/test/component-pid_controller-implementation-tester.adb index 319a83fe..39fbf206 100644 --- a/src/components/pid_controller/test/component-pid_controller-implementation-tester.adb +++ b/src/components/pid_controller/test/component-pid_controller-implementation-tester.adb @@ -275,7 +275,7 @@ package body Component.Pid_Controller.Implementation.Tester is not overriding function Fetch_Parameter (Self : in out Instance; Id : in Parameter_Types.Parameter_Id; Par : out Parameter.T) return Parameter_Update_Status.E is use Parameter_Enums.Parameter_Update_Status; use Parameter_Enums.Parameter_Operation_Type; - Param_Update : Parameter_Update.T := (Operation => Fetch, Status => Success, Param => (Header => (Id => Id, Buffer_Length => 0), Buffer => (others => 0))); + Param_Update : Parameter_Update.T := (Operation => Fetch, Status => Success, Param => (Header => (Id => Id, Buffer_Length => 0), Buffer => [others => 0])); begin -- Set the ID to fetch: Param_Update.Param.Header.Id := Id; @@ -287,7 +287,7 @@ package body Component.Pid_Controller.Implementation.Tester is not overriding function Update_Parameters (Self : in out Instance) return Parameter_Update_Status.E is use Parameter_Enums.Parameter_Update_Status; use Parameter_Enums.Parameter_Operation_Type; - Param_Update : Parameter_Update.T := (Operation => Update, Status => Success, Param => ((0, 0), (others => 0))); + Param_Update : Parameter_Update.T := (Operation => Update, Status => Success, Param => ((0, 0), [others => 0])); begin Self.Parameter_Update_T_Provide (Param_Update); return Param_Update.Status; diff --git a/src/components/pid_controller/test/pid_controller_tests-implementation.adb b/src/components/pid_controller/test/pid_controller_tests-implementation.adb index 431d62cb..cb50b211 100644 --- a/src/components/pid_controller/test/pid_controller_tests-implementation.adb +++ b/src/components/pid_controller/test/pid_controller_tests-implementation.adb @@ -85,9 +85,9 @@ package body Pid_Controller_Tests.Implementation is -- Check that we got the count in the buffer and that we got the expected patterns in the two subpackets -- Using a floating point converter we know that 1.0 should be 0x3F800000 or 63, 128, 0, 0 -- Using a floating point converter we know that 2.0 should be 0x40000000 or 64, 0, 0, 0 - Byte_Array_Assert.Eq (T.Pid_Controller_Diagnostic_Packet_History.Get (1).Buffer (0 .. 3), (0, 0, 0, 2)); - Byte_Array_Assert.Eq (T.Pid_Controller_Diagnostic_Packet_History.Get (1).Buffer (4 .. 15), (63, 128, 0, 0, 63, 128, 0, 0, 63, 128, 0, 0)); --subpacket from the first control input - Byte_Array_Assert.Eq (T.Pid_Controller_Diagnostic_Packet_History.Get (1).Buffer (16 .. 27), (64, 0, 0, 0, 64, 0, 0, 0, 64, 0, 0, 0)); --subpacket from the second control input + Byte_Array_Assert.Eq (T.Pid_Controller_Diagnostic_Packet_History.Get (1).Buffer (0 .. 3), [0, 0, 0, 2]); + Byte_Array_Assert.Eq (T.Pid_Controller_Diagnostic_Packet_History.Get (1).Buffer (4 .. 15), [63, 128, 0, 0, 63, 128, 0, 0, 63, 128, 0, 0]); --subpacket from the first control input + Byte_Array_Assert.Eq (T.Pid_Controller_Diagnostic_Packet_History.Get (1).Buffer (16 .. 27), [64, 0, 0, 0, 64, 0, 0, 0, 64, 0, 0, 0]); --subpacket from the second control input -- Start a new packet and this time lets make sure we fill the packet and send. -- Need to find out how many subpackets we should issue to get at least one full packet sent plus a couple more @@ -112,13 +112,13 @@ package body Pid_Controller_Tests.Implementation is T.Control_Input_U_Send (((0, 0), 1.0, 1.0, 1.0, False)); Natural_Assert.Eq (T.Packet_T_Recv_Sync_History.Get_Count, 2); Natural_Assert.Eq (T.Pid_Controller_Diagnostic_Packet_History.Get_Count, 2); - Byte_Array_Assert.Eq (T.Pid_Controller_Diagnostic_Packet_History.Get (2).Buffer (0 .. 3), (0, 0, 0, 103)); + Byte_Array_Assert.Eq (T.Pid_Controller_Diagnostic_Packet_History.Get (2).Buffer (0 .. 3), [0, 0, 0, 103]); -- Now make sure there was one more packet with just a couple sub packets T.Control_Input_U_Send (((0, 0), 1.0, 1.0, 1.0, False)); Natural_Assert.Eq (T.Packet_T_Recv_Sync_History.Get_Count, 3); Natural_Assert.Eq (T.Pid_Controller_Diagnostic_Packet_History.Get_Count, 3); - Byte_Array_Assert.Eq (T.Pid_Controller_Diagnostic_Packet_History.Get (3).Buffer (0 .. 3), (0, 0, 0, 2)); + Byte_Array_Assert.Eq (T.Pid_Controller_Diagnostic_Packet_History.Get (3).Buffer (0 .. 3), [0, 0, 0, 2]); -- Make sure no others are issued T.Control_Input_U_Send (((0, 0), 1.0, 1.0, 1.0, False)); @@ -291,7 +291,7 @@ package body Pid_Controller_Tests.Implementation is -- Make sure some events were thrown: Natural_Assert.Eq (T.Event_T_Recv_Sync_History.Get_Count, 1); Natural_Assert.Eq (T.Invalid_Command_Received_History.Get_Count, 1); - Invalid_Command_Info_Assert.Eq (T.Invalid_Command_Received_History.Get (1), (Id => T.Commands.Get_Start_Diagnostics_Id, Errant_Field_Number => Interfaces.Unsigned_32'Last, Errant_Field => (0, 0, 0, 0, 0, 0, 0, 0))); + Invalid_Command_Info_Assert.Eq (T.Invalid_Command_Received_History.Get (1), (Id => T.Commands.Get_Start_Diagnostics_Id, Errant_Field_Number => Interfaces.Unsigned_32'Last, Errant_Field => [0, 0, 0, 0, 0, 0, 0, 0])); end Test_Invalid_Command; overriding procedure Test_Invalid_Parameter (Self : in out Instance) is @@ -314,7 +314,7 @@ package body Pid_Controller_Tests.Implementation is -- Make sure some events were thrown: Natural_Assert.Eq (T.Event_T_Recv_Sync_History.Get_Count, 1); Natural_Assert.Eq (T.Invalid_Parameter_Received_History.Get_Count, 1); - Invalid_Parameter_Info_Assert.Eq (T.Invalid_Parameter_Received_History.Get (1), (Id => T.Parameters.Get_P_Gain_Id, Errant_Field_Number => Interfaces.Unsigned_32'Last, Errant_Field => (0, 0, 0, 0, 0, 0, 0, 0))); + Invalid_Parameter_Info_Assert.Eq (T.Invalid_Parameter_Received_History.Get (1), (Id => T.Parameters.Get_P_Gain_Id, Errant_Field_Number => Interfaces.Unsigned_32'Last, Errant_Field => [0, 0, 0, 0, 0, 0, 0, 0])); -- Make the parameter invalid by setting a crazy id; Param.Header.Id := 1_001; @@ -325,7 +325,7 @@ package body Pid_Controller_Tests.Implementation is -- Make sure some events were thrown: Natural_Assert.Eq (T.Event_T_Recv_Sync_History.Get_Count, 2); Natural_Assert.Eq (T.Invalid_Parameter_Received_History.Get_Count, 2); - Invalid_Parameter_Info_Assert.Eq (T.Invalid_Parameter_Received_History.Get (2), (Id => 1_001, Errant_Field_Number => Interfaces.Unsigned_32'Last - 1, Errant_Field => (0, 0, 0, 0, 0, 0, 16#03#, 16#E9#))); + Invalid_Parameter_Info_Assert.Eq (T.Invalid_Parameter_Received_History.Get (2), (Id => 1_001, Errant_Field_Number => Interfaces.Unsigned_32'Last - 1, Errant_Field => [0, 0, 0, 0, 0, 0, 16#03#, 16#E9#])); end Test_Invalid_Parameter; overriding procedure Test_Database_Update_Period (Self : in out Instance) is diff --git a/src/components/precision_time_protocol_master/test/precision_time_protocol_master_tests-implementation.adb b/src/components/precision_time_protocol_master/test/precision_time_protocol_master_tests-implementation.adb index 62e6cb25..3396faf6 100644 --- a/src/components/precision_time_protocol_master/test/precision_time_protocol_master_tests-implementation.adb +++ b/src/components/precision_time_protocol_master/test/precision_time_protocol_master_tests-implementation.adb @@ -442,7 +442,7 @@ package body Precision_Time_Protocol_Master_Tests.Implementation is Natural_Assert.Eq (T.Event_T_Recv_Sync_History.Get_Count, 1); Natural_Assert.Eq (T.Ptp_Enabled_History.Get_Count, 0); Natural_Assert.Eq (T.Invalid_Command_Received_History.Get_Count, 1); - Invalid_Command_Info_Assert.Eq (T.Invalid_Command_Received_History.Get (1), (Id => T.Commands.Get_Enable_Precision_Time_Protocol_Id, Errant_Field_Number => Interfaces.Unsigned_32'Last, Errant_Field => (0, 0, 0, 0, 0, 0, 0, 1))); + Invalid_Command_Info_Assert.Eq (T.Invalid_Command_Received_History.Get (1), (Id => T.Commands.Get_Enable_Precision_Time_Protocol_Id, Errant_Field_Number => Interfaces.Unsigned_32'Last, Errant_Field => [0, 0, 0, 0, 0, 0, 0, 1])); end Test_Invalid_Command; overriding procedure Test_Queue_Overflow (Self : in out Instance) is diff --git a/src/components/product_copier/tests/product_copier_tests-implementation.adb b/src/components/product_copier/tests/product_copier_tests-implementation.adb index 8b26b446..964acf59 100644 --- a/src/components/product_copier/tests/product_copier_tests-implementation.adb +++ b/src/components/product_copier/tests/product_copier_tests-implementation.adb @@ -236,7 +236,7 @@ package body Product_Copier_Tests.Implementation is -- test that the 12 products are: 5 1 4 1 4 5 1 4 3 1 4 3 -- TODO do we care about the order within ticks? Check_Product_Ids : declare - Counts : array (1 .. 5) of Natural := (others => 0); + Counts : array (1 .. 5) of Natural := [others => 0]; Id : Natural; Mod_Id : Natural; begin diff --git a/src/components/product_database/test/tests-implementation.adb b/src/components/product_database/test/tests-implementation.adb index 4bf2a642..b59acc66 100644 --- a/src/components/product_database/test/tests-implementation.adb +++ b/src/components/product_database/test/tests-implementation.adb @@ -63,13 +63,13 @@ package body Tests.Implementation is overriding procedure Test_Nominal_Scenario (Self : in out Instance) is T : Component.Product_Database.Implementation.Tester.Instance_Access renames Self.Tester; - D_Prod : Data_Product.T := (Header => (Time => (1, 17), Id => 1, Buffer_Length => 4), Buffer => (others => 3)); + D_Prod : Data_Product.T := (Header => (Time => (1, 17), Id => 1, Buffer_Length => 4), Buffer => [others => 3]); D_Prod_Return : Data_Product_Return.T; begin -- Store some data: for Id in Min_Id .. Max_Id loop D_Prod.Header.Id := Id; - D_Prod.Buffer := (others => Basic_Types.Byte (Id)); + D_Prod.Buffer := [others => Basic_Types.Byte (Id)]; T.Data_Product_T_Send (D_Prod); end loop; @@ -79,7 +79,7 @@ package body Tests.Implementation is -- Fetch some data: for Id in Min_Id .. Max_Id loop D_Prod.Header.Id := Id; - D_Prod.Buffer := (others => Basic_Types.Byte (Id)); + D_Prod.Buffer := [others => Basic_Types.Byte (Id)]; D_Prod_Return := T.Data_Product_Fetch_T_Request ((Id => Id)); -- Check return data: The_Status_Assert.Eq (D_Prod_Return.The_Status, Fetch_Status.Success); @@ -96,7 +96,7 @@ package body Tests.Implementation is T : Component.Product_Database.Implementation.Tester.Instance_Access renames Self.Tester; Cmd : Command.T; D_Prod_Return : Data_Product_Return.T; - D_Prod : Data_Product.T := (Header => (Time => (1, 17), Id => Min_Id, Buffer_Length => 4), Buffer => (others => 3)); + D_Prod : Data_Product.T := (Header => (Time => (1, 17), Id => Min_Id, Buffer_Length => 4), Buffer => [others => 3]); begin -- Setup the component: Self.Tester.Component_Instance.Set_Up; @@ -117,9 +117,9 @@ package body Tests.Implementation is Id => Min_Id, Buffer_Length => 9 ), - Buffer => ( + Buffer => [ others => 99 - )), Cmd) = Success); + ]), Cmd) = Success); T.Command_T_Send (Cmd); Natural_Assert.Eq (T.Command_Response_T_Recv_Sync_History.Get_Count, 1); Command_Response_Assert.Eq (T.Command_Response_T_Recv_Sync_History.Get (1), (Source_Id => 0, Registration_Id => 0, Command_Id => T.Commands.Get_Override_Id, Status => Success)); @@ -147,9 +147,9 @@ package body Tests.Implementation is Id => Min_Id, Buffer_Length => 9 ), - Buffer => ( + Buffer => [ others => 99 - ) + ] )); -- Update the overridden data product, expect no change in fetch. @@ -164,9 +164,9 @@ package body Tests.Implementation is Id => Min_Id, Buffer_Length => 9 ), - Buffer => ( + Buffer => [ others => 99 - ) + ] )); -- Clear the override status for this ID. @@ -203,9 +203,9 @@ package body Tests.Implementation is Id => Min_Id + 1, Buffer_Length => 12 ), - Buffer => ( + Buffer => [ others => 88 - )), Cmd) = Success); + ]), Cmd) = Success); T.Command_T_Send (Cmd); Natural_Assert.Eq (T.Command_Response_T_Recv_Sync_History.Get_Count, 3); Command_Response_Assert.Eq (T.Command_Response_T_Recv_Sync_History.Get (3), (Source_Id => 0, Registration_Id => 0, Command_Id => T.Commands.Get_Override_Id, Status => Success)); @@ -233,9 +233,9 @@ package body Tests.Implementation is Id => Min_Id + 1, Buffer_Length => 12 ), - Buffer => ( + Buffer => [ others => 88 - ) + ] )); -- Send command to override another data product: @@ -245,9 +245,9 @@ package body Tests.Implementation is Id => Min_Id + 2, Buffer_Length => 11 ), - Buffer => ( + Buffer => [ others => 77 - )), Cmd) = Success); + ]), Cmd) = Success); T.Command_T_Send (Cmd); Natural_Assert.Eq (T.Command_Response_T_Recv_Sync_History.Get_Count, 4); Command_Response_Assert.Eq (T.Command_Response_T_Recv_Sync_History.Get (4), (Source_Id => 0, Registration_Id => 0, Command_Id => T.Commands.Get_Override_Id, Status => Success)); @@ -275,9 +275,9 @@ package body Tests.Implementation is Id => Min_Id + 2, Buffer_Length => 11 ), - Buffer => ( + Buffer => [ others => 77 - ) + ] )); -- Update three data products (last two which are overridden): @@ -303,9 +303,9 @@ package body Tests.Implementation is Id => Min_Id + 1, Buffer_Length => 12 ), - Buffer => ( + Buffer => [ others => 88 - ) + ] )); -- Fetch and check the overridden data product: @@ -317,9 +317,9 @@ package body Tests.Implementation is Id => Min_Id + 2, Buffer_Length => 11 ), - Buffer => ( + Buffer => [ others => 77 - ) + ] )); -- Clear the override condition for all. @@ -366,13 +366,13 @@ package body Tests.Implementation is overriding procedure Test_Nominal_Dump (Self : in out Instance) is T : Component.Product_Database.Implementation.Tester.Instance_Access renames Self.Tester; - D_Prod : Data_Product.T := (Header => (Time => (1, 17), Id => 1, Buffer_Length => 4), Buffer => (others => 3)); + D_Prod : Data_Product.T := (Header => (Time => (1, 17), Id => 1, Buffer_Length => 4), Buffer => [others => 3]); Cnt : Natural := 1; begin -- Store some data: for Id in Min_Id .. Max_Id loop D_Prod.Header.Id := Id; - D_Prod.Buffer := (others => Basic_Types.Byte (Id)); + D_Prod.Buffer := [others => Basic_Types.Byte (Id)]; T.Data_Product_T_Send (D_Prod); end loop; @@ -382,7 +382,7 @@ package body Tests.Implementation is -- Dump some data: for Id in Min_Id .. Max_Id loop D_Prod.Header.Id := Id; - D_Prod.Buffer := (others => Basic_Types.Byte (Id)); + D_Prod.Buffer := [others => Basic_Types.Byte (Id)]; -- Dump data product: T.Command_T_Send (T.Commands.Dump ((Id => Id))); @@ -404,13 +404,13 @@ package body Tests.Implementation is overriding procedure Test_Nominal_Dump_Poly (Self : in out Instance) is T : Component.Product_Database.Implementation.Tester.Instance_Access renames Self.Tester; - D_Prod : Data_Product.T := (Header => (Time => (1, 17), Id => 1, Buffer_Length => 4), Buffer => (others => 3)); + D_Prod : Data_Product.T := (Header => (Time => (1, 17), Id => 1, Buffer_Length => 4), Buffer => [others => 3]); Cnt : Natural := 1; begin -- Store some data: for Id in Min_Id .. Max_Id loop D_Prod.Header.Id := Id; - D_Prod.Buffer := (others => Basic_Types.Byte (Id)); + D_Prod.Buffer := [others => Basic_Types.Byte (Id)]; T.Data_Product_T_Send (D_Prod); end loop; @@ -420,7 +420,7 @@ package body Tests.Implementation is -- Dump some data: for Id in Min_Id .. Max_Id loop D_Prod.Header.Id := Id; - D_Prod.Buffer := (others => Basic_Types.Byte (Id)); + D_Prod.Buffer := [others => Basic_Types.Byte (Id)]; -- Dump data product: T.Command_T_Send (T.Commands.Dump_Poly_Type ((Id => Id, Offset => 8, Size => 8))); @@ -432,12 +432,12 @@ package body Tests.Implementation is Natural_Assert.Eq (T.Dumping_Data_Product_Poly_Type_History.Get_Count, Cnt); Data_Product_Poly_Extract_Assert.Eq (T.Dumping_Data_Product_Poly_Type_History.Get (Cnt), (Id => Id, Offset => 8, Size => 8)); Natural_Assert.Eq (T.Dumped_Data_Product_Poly_Type_History.Get_Count, Cnt); - Data_Product_Poly_Event_Assert.Eq (T.Dumped_Data_Product_Poly_Type_History.Get (Cnt), (Header => D_Prod.Header, Data => (0, 0, 0, Basic_Types.Byte (Id)))); + Data_Product_Poly_Event_Assert.Eq (T.Dumped_Data_Product_Poly_Type_History.Get (Cnt), (Header => D_Prod.Header, Data => [0, 0, 0, Basic_Types.Byte (Id)])); -- Check data product: Natural_Assert.Eq (T.Data_Product_T_Recv_Sync_History.Get_Count, Cnt); Natural_Assert.Eq (T.Data_Product_Poly_Type_Dump_History.Get_Count, Cnt); - Data_Product_Poly_Type_Assert.Eq (T.Data_Product_Poly_Type_Dump_History.Get (Cnt), (Time => D_Prod.Header.Time, Id => Id, Data => (0, 0, 0, Basic_Types.Byte (Id)))); + Data_Product_Poly_Type_Assert.Eq (T.Data_Product_Poly_Type_Dump_History.Get (Cnt), (Time => D_Prod.Header.Time, Id => Id, Data => [0, 0, 0, Basic_Types.Byte (Id)])); Cnt := Cnt + 1; end loop; @@ -457,7 +457,7 @@ package body Tests.Implementation is overriding procedure Test_Data_Not_Available (Self : in out Instance) is T : Component.Product_Database.Implementation.Tester.Instance_Access renames Self.Tester; - D_Prod : Data_Product.T := (Header => (Time => (1, 17), Id => 1, Buffer_Length => 4), Buffer => (others => 3)); + D_Prod : Data_Product.T := (Header => (Time => (1, 17), Id => 1, Buffer_Length => 4), Buffer => [others => 3]); D_Prod_Return : Data_Product_Return.T; Cnt : Natural := 1; begin @@ -467,7 +467,7 @@ package body Tests.Implementation is -- Fetch some data, expect error: for Id in Min_Id .. Max_Id loop D_Prod.Header.Id := Id; - D_Prod.Buffer := (others => Basic_Types.Byte (Id)); + D_Prod.Buffer := [others => Basic_Types.Byte (Id)]; D_Prod_Return := T.Data_Product_Fetch_T_Request ((Id => Id)); -- Check return data: The_Status_Assert.Eq (D_Prod_Return.The_Status, Fetch_Status.Not_Available); @@ -513,7 +513,7 @@ package body Tests.Implementation is -- Store some data: for Id in Min_Id .. Max_Id loop D_Prod.Header.Id := Id; - D_Prod.Buffer := (others => Basic_Types.Byte (Id)); + D_Prod.Buffer := [others => Basic_Types.Byte (Id)]; T.Data_Product_T_Send (D_Prod); end loop; @@ -523,7 +523,7 @@ package body Tests.Implementation is -- Fetch some data and expect to get valid data: for Id in Min_Id .. Max_Id loop D_Prod.Header.Id := Id; - D_Prod.Buffer := (others => Basic_Types.Byte (Id)); + D_Prod.Buffer := [others => Basic_Types.Byte (Id)]; D_Prod_Return := T.Data_Product_Fetch_T_Request ((Id => Id)); -- Check return data: The_Status_Assert.Eq (D_Prod_Return.The_Status, Fetch_Status.Success); @@ -538,13 +538,13 @@ package body Tests.Implementation is use Data_Product_Types; use Serializer_Types; T : Component.Product_Database.Implementation.Tester.Instance_Access renames Self.Tester; - D_Prod : Data_Product.T := (Header => (Time => (1, 17), Id => 1, Buffer_Length => 4), Buffer => (others => 3)); + D_Prod : Data_Product.T := (Header => (Time => (1, 17), Id => 1, Buffer_Length => 4), Buffer => [others => 3]); D_Prod_Return : Data_Product_Return.T; Cmd : Command.T; begin -- Try to store data with bad id: D_Prod.Header.Id := Max_Max_Id + Data_Product_Types.Data_Product_Id (1); - D_Prod.Buffer := (others => Basic_Types.Byte (2)); + D_Prod.Buffer := [others => Basic_Types.Byte (2)]; T.Data_Product_T_Send (D_Prod); T.Data_Product_T_Send (D_Prod); T.Data_Product_T_Send (D_Prod); @@ -598,7 +598,7 @@ package body Tests.Implementation is -- Try to override data with bad id: D_Prod.Header.Id := 1; - D_Prod.Buffer := (others => Basic_Types.Byte (2)); + D_Prod.Buffer := [others => Basic_Types.Byte (2)]; pragma Assert (T.Commands.Override (D_Prod, Cmd) = Success); T.Command_T_Send (Cmd); Natural_Assert.Eq (T.Command_Response_T_Recv_Sync_History.Get_Count, 4); @@ -623,7 +623,7 @@ package body Tests.Implementation is -- Make sure some events were thrown: Natural_Assert.Eq (T.Event_T_Recv_Sync_History.Get_Count, 1); Natural_Assert.Eq (T.Invalid_Command_Received_History.Get_Count, 1); - Invalid_Command_Info_Assert.Eq (T.Invalid_Command_Received_History.Get (1), (Id => T.Commands.Get_Dump_Id, Errant_Field_Number => Interfaces.Unsigned_32'Last, Errant_Field => (0, 0, 0, 0, 0, 0, 0, 0))); + Invalid_Command_Info_Assert.Eq (T.Invalid_Command_Received_History.Get (1), (Id => T.Commands.Get_Dump_Id, Errant_Field_Number => Interfaces.Unsigned_32'Last, Errant_Field => [0, 0, 0, 0, 0, 0, 0, 0])); end Test_Invalid_Command; end Tests.Implementation; diff --git a/src/components/product_packetizer/component-product_packetizer-implementation.adb b/src/components/product_packetizer/component-product_packetizer-implementation.adb index da1a7d15..302c55c3 100644 --- a/src/components/product_packetizer/component-product_packetizer-implementation.adb +++ b/src/components/product_packetizer/component-product_packetizer-implementation.adb @@ -75,7 +75,7 @@ package body Component.Product_Packetizer.Implementation is use Data_Product_Enums.Fetch_Status; -- Initialize the packet with the correct ID and sequence count. - The_Packet : Packet.T := ((Time => Tick_Time, Id => Packet_Desc.Id, Sequence_Count => Packet_Desc.Count, Buffer_Length => 0), Buffer => (others => 0)); + The_Packet : Packet.T := ((Time => Tick_Time, Id => Packet_Desc.Id, Sequence_Count => Packet_Desc.Count, Buffer_Length => 0), Buffer => [others => 0]); -- Other local variables: D_Prod_Ret : Data_Product_Return.T; @@ -103,7 +103,7 @@ package body Component.Product_Packetizer.Implementation is Id => Item.Data_Product_Id, Buffer_Length => Packed_Natural.Size_In_Bytes ), - Buffer => (others => 0) + Buffer => [others => 0] ) ); declare diff --git a/src/components/product_packetizer/gen/templates/product_packets/name.ads b/src/components/product_packetizer/gen/templates/product_packets/name.ads index ca09aef4..b0385ac8 100644 --- a/src/components/product_packetizer/gen/templates/product_packets/name.ads +++ b/src/components/product_packetizer/gen/templates/product_packets/name.ads @@ -15,12 +15,12 @@ package {{ name }} is -- {{ packet.name }} data product items: -- Total packet buffer size: {{ packet.size }} bits - {{ packet["name"] }}_Items : aliased Packet_Items_Type := ( + {{ packet["name"] }}_Items : aliased Packet_Items_Type := [ {% for dp in packet.data_products %} -- Item entry for {{ dp.name }}: {{ loop.index }} => (Data_Product_Id => {% if dp.data_product %}{{ dp.data_product.id }}{% else %}0{% endif %}, Use_Timestamp => {% if dp.use_timestamp %}True{% else %}False{% endif %}, Include_Timestamp => {% if dp.include_timestamp %}True{% else %}False{% endif %}, Event_On_Missing => {% if dp.event_on_missing %}True{% else %}False{% endif %}, Packet_Period_Item => {% if dp.packet_period_item %}True{% else %}False{% endif %}, Size => {{ (dp.size/8)|int }}){{ "," if not loop.last }} {% endfor %} - ); + ]; -- {{ packet.name }} packet description: {{ packet.name }}_Description : Packet_Description_Type := ( @@ -36,10 +36,10 @@ package {{ name }} is {% endfor %} -- List of packets for the packetizer to build: - Packet_List : aliased Packet_Description_List_Type := ( + Packet_List : aliased Packet_Description_List_Type := [ {% for packet in packets.values() %} {{ loop.index }} => {{ packet.name }}_Description{{ "," if not loop.last }} {% endfor %} - ); + ]; end {{ name }}; diff --git a/src/components/product_packetizer/test/tests-implementation.adb b/src/components/product_packetizer/test/tests-implementation.adb index 1ad173e7..54c103fd 100644 --- a/src/components/product_packetizer/test/tests-implementation.adb +++ b/src/components/product_packetizer/test/tests-implementation.adb @@ -61,7 +61,7 @@ package body Tests.Implementation is procedure Check_Packet_1 (Self : in Instance; To_Compare : Packet.T; Expected_Sequence_Count : Packet_Types.Sequence_Count_Mod_Type; Filename : in String := Smart_Assert.Sinfo.File; Line : in Natural := Smart_Assert.Sinfo.Line) is T : Component.Product_Packetizer.Implementation.Tester.Instance_Access renames Self.Tester; - Expected : Packet.T := (Header => (Time => T.System_Time, Id => 7, Sequence_Count => Expected_Sequence_Count, Buffer_Length => 0), Buffer => (others => 0)); + Expected : Packet.T := (Header => (Time => T.System_Time, Id => 7, Sequence_Count => Expected_Sequence_Count, Buffer_Length => 0), Buffer => [others => 0]); Idx : Natural := Expected.Buffer'First; End_Idx : Natural := 0; begin @@ -89,7 +89,7 @@ package body Tests.Implementation is procedure Check_Packet_Zeros (Self : in Instance; To_Compare : Packet.T; Expected_Sequence_Count : Packet_Types.Sequence_Count_Mod_Type; Filename : in String := Smart_Assert.Sinfo.File; Line : in Natural := Smart_Assert.Sinfo.Line) is T : Component.Product_Packetizer.Implementation.Tester.Instance_Access renames Self.Tester; - Expected : Packet.T := (Header => (Time => T.System_Time, Id => 7, Sequence_Count => Expected_Sequence_Count, Buffer_Length => 0), Buffer => (others => 0)); + Expected : Packet.T := (Header => (Time => T.System_Time, Id => 7, Sequence_Count => Expected_Sequence_Count, Buffer_Length => 0), Buffer => [others => 0]); Idx : Natural := Expected.Buffer'First; End_Idx : Natural := 0; begin @@ -117,7 +117,7 @@ package body Tests.Implementation is procedure Check_Packet_2 (Self : in Instance; To_Compare : Packet.T; Expected_Sequence_Count : Packet_Types.Sequence_Count_Mod_Type; Filename : in String := Smart_Assert.Sinfo.File; Line : in Natural := Smart_Assert.Sinfo.Line) is Ignore : Component.Product_Packetizer.Implementation.Tester.Instance_Access renames Self.Tester; - Expected : Packet.T := (Header => (Time => (5, 11), Id => 9, Sequence_Count => Expected_Sequence_Count, Buffer_Length => 0), Buffer => (others => 0)); + Expected : Packet.T := (Header => (Time => (5, 11), Id => 9, Sequence_Count => Expected_Sequence_Count, Buffer_Length => 0), Buffer => [others => 0]); Idx : Natural := Expected.Buffer'First; End_Idx : Natural := 0; begin @@ -140,7 +140,7 @@ package body Tests.Implementation is procedure Check_Packet_3 (Self : in Instance; To_Compare : Packet.T; Expected_Sequence_Count : Packet_Types.Sequence_Count_Mod_Type; Filename : in String := Smart_Assert.Sinfo.File; Line : in Natural := Smart_Assert.Sinfo.Line) is T : Component.Product_Packetizer.Implementation.Tester.Instance_Access renames Self.Tester; - Expected : Packet.T := (Header => (Time => T.System_Time, Id => 8, Sequence_Count => Expected_Sequence_Count, Buffer_Length => 0), Buffer => (others => 0)); + Expected : Packet.T := (Header => (Time => T.System_Time, Id => 8, Sequence_Count => Expected_Sequence_Count, Buffer_Length => 0), Buffer => [others => 0]); Idx : Natural := Expected.Buffer'First; End_Idx : Natural := 0; begin @@ -168,13 +168,13 @@ package body Tests.Implementation is procedure Check_Packet_4 (Self : in Instance; To_Compare : Packet.T; The_Time : Sys_Time.T; Expected_Sequence_Count : Packet_Types.Sequence_Count_Mod_Type; Filename : in String := Smart_Assert.Sinfo.File; Line : in Natural := Smart_Assert.Sinfo.Line) is Ignore : Instance renames Self; - Expected : Packet.T := (Header => (Time => The_Time, Id => 12, Sequence_Count => Expected_Sequence_Count, Buffer_Length => 0), Buffer => (others => 0)); + Expected : Packet.T := (Header => (Time => The_Time, Id => 12, Sequence_Count => Expected_Sequence_Count, Buffer_Length => 0), Buffer => [others => 0]); Idx : Natural := Expected.Buffer'First; End_Idx : Natural := 0; begin -- First serialize 5 pad bytes: End_Idx := Idx + 5 - 1; - Expected.Buffer (Idx .. End_Idx) := (0 .. 5 - 1 => 0); + Expected.Buffer (Idx .. End_Idx) := [0 .. 5 - 1 => 0]; Idx := End_Idx + 1; -- Next Serialize Data product A: @@ -184,7 +184,7 @@ package body Tests.Implementation is -- Next serialize 3 pad bytes: End_Idx := Idx + 3 - 1; - Expected.Buffer (Idx .. End_Idx) := (0 .. 3 - 1 => 0); + Expected.Buffer (Idx .. End_Idx) := [0 .. 3 - 1 => 0]; Idx := End_Idx + 1; -- Calculate packet length: @@ -199,7 +199,7 @@ package body Tests.Implementation is Line : in Natural := Smart_Assert.Sinfo.Line) is T : Component.Product_Packetizer.Implementation.Tester.Instance_Access renames Self.Tester; - Expected : Packet.T := (Header => (Time => T.System_Time, Id => 15, Sequence_Count => Expected_Sequence_Count, Buffer_Length => 0), Buffer => (others => 0)); + Expected : Packet.T := (Header => (Time => T.System_Time, Id => 15, Sequence_Count => Expected_Sequence_Count, Buffer_Length => 0), Buffer => [others => 0]); Idx : Natural := Expected.Buffer'First; End_Idx : Natural := 0; begin @@ -859,8 +859,7 @@ package body Tests.Implementation is Invalid_Packet_Id_Assert.Eq (T.Invalid_Packet_Id_Commanded_History.Get (4), (Packet_Id => 5, Command_Id => Commands.Get_Send_Packet_Id)); -- Send command with packet period over the size of a natural and expect the command argument validation to fail: - --t.Command_T_Send(commands.Send_Packet(Packet_Id.Serialization.From_Byte_Array((255, 255)))); - T.Command_T_Send (Commands.Set_Packet_Period (Packet_Period.Serialization.From_Byte_Array ((255, 255, 255, 255, 255, 255)))); + T.Command_T_Send (Commands.Set_Packet_Period (Packet_Period.Serialization.From_Byte_Array ([255, 255, 255, 255, 255, 255]))); -- Send tick, expect event: T.Tick_T_Send (The_Tick); @@ -868,7 +867,7 @@ package body Tests.Implementation is Command_Response_Assert.Eq (T.Command_Response_T_Recv_Sync_History.Get (5), (Source_Id => 0, Registration_Id => 0, Command_Id => T.Commands.Get_Set_Packet_Period_Id, Status => Validation_Error)); Natural_Assert.Eq (T.Event_T_Recv_Sync_History.Get_Count, 5); Natural_Assert.Eq (T.Invalid_Command_Received_History.Get_Count, 1); - Invalid_Command_Info_Assert.Eq (T.Invalid_Command_Received_History.Get (1), (Id => Commands.Get_Set_Packet_Period_Id, Errant_Field_Number => 2, Errant_Field => (0, 0, 0, 0, 255, 255, 255, 255))); + Invalid_Command_Info_Assert.Eq (T.Invalid_Command_Received_History.Get (1), (Id => Commands.Get_Set_Packet_Period_Id, Errant_Field_Number => 2, Errant_Field => [0, 0, 0, 0, 255, 255, 255, 255])); end Test_Bad_Commands; overriding procedure Test_Send_Packet_Command (Self : in out Instance) is @@ -1120,7 +1119,7 @@ package body Tests.Implementation is overriding procedure Test_Full_Queue (Self : in out Instance) is T : Component.Product_Packetizer.Implementation.Tester.Instance_Access renames Self.Tester; -- Define full sized command: - Buffer : constant Command_Types.Command_Arg_Buffer_Type := (0 => 56, 1 => 57, others => 92); + Buffer : constant Command_Types.Command_Arg_Buffer_Type := [0 => 56, 1 => 57, others => 92]; A_Command : constant Command.T := ((Source_Id => 0, Id => 15, Arg_Buffer_Length => Buffer'Length), Arg_Buffer => Buffer); procedure Fill_Queue (N : in Natural := 3) is diff --git a/src/components/queue_monitor/component-queue_monitor-implementation.adb b/src/components/queue_monitor/component-queue_monitor-implementation.adb index 745831df..4a49ed54 100644 --- a/src/components/queue_monitor/component-queue_monitor-implementation.adb +++ b/src/components/queue_monitor/component-queue_monitor-implementation.adb @@ -30,7 +30,7 @@ package body Component.Queue_Monitor.Implementation is Sequence_Count => 0, Buffer_Length => Self.Queued_Component_List'Length * 2 ), - Buffer => (others => 0) + Buffer => [others => 0] ); -- Initialize the packet period: diff --git a/src/components/queue_monitor/test/queue_monitor_tests-implementation.adb b/src/components/queue_monitor/test/queue_monitor_tests-implementation.adb index 230f7112..57ab5fde 100644 --- a/src/components/queue_monitor/test/queue_monitor_tests-implementation.adb +++ b/src/components/queue_monitor/test/queue_monitor_tests-implementation.adb @@ -19,7 +19,7 @@ package body Queue_Monitor_Tests.Implementation is Queued_Component_2 : aliased Component.Queued_Component.Implementation.Instance; Queued_Component_3 : aliased Component.Queued_Component.Implementation.Instance; - Queued_Component_List : aliased Component.Component_List := (Queued_Component_1'Access, Queued_Component_2'Access, Queued_Component_3'Access); + Queued_Component_List : aliased Component.Component_List := [Queued_Component_1'Access, Queued_Component_2'Access, Queued_Component_3'Access]; ------------------------------------------------------------------------- -- Fixtures: @@ -60,7 +60,7 @@ package body Queue_Monitor_Tests.Implementation is overriding procedure Test_Queue_Monitoring (Self : in out Instance) is T : Component.Queue_Monitor.Implementation.Tester.Instance_Access renames Self.Tester; A_Tick : constant Tick.T := ((0, 0), 0); - Pkt : Packet.T := (Header => (Time => (0, 0), Id => T.Packets.Get_Queue_Usage_Packet_Id, Sequence_Count => 0, Buffer_Length => 6), Buffer => (others => 0)); + Pkt : Packet.T := (Header => (Time => (0, 0), Id => T.Packets.Get_Queue_Usage_Packet_Id, Sequence_Count => 0, Buffer_Length => 6), Buffer => [others => 0]); begin -- Send a tick and expect a packet. T.Tick_T_Send (A_Tick); @@ -273,7 +273,7 @@ package body Queue_Monitor_Tests.Implementation is Natural_Assert.Eq (T.Event_T_Recv_Sync_History.Get_Count, 1); Natural_Assert.Eq (T.Packet_Period_Set_History.Get_Count, 0); Natural_Assert.Eq (T.Invalid_Command_Received_History.Get_Count, 1); - Invalid_Command_Info_Assert.Eq (T.Invalid_Command_Received_History.Get (1), (Id => T.Commands.Get_Set_Packet_Period_Id, Errant_Field_Number => Interfaces.Unsigned_32'Last, Errant_Field => (0, 0, 0, 0, 0, 0, 0, 0))); + Invalid_Command_Info_Assert.Eq (T.Invalid_Command_Received_History.Get (1), (Id => T.Commands.Get_Set_Packet_Period_Id, Errant_Field_Number => Interfaces.Unsigned_32'Last, Errant_Field => [0, 0, 0, 0, 0, 0, 0, 0])); end Test_Invalid_Command; end Queue_Monitor_Tests.Implementation; diff --git a/src/components/register_stuffer/test/register_stuffer_tests-implementation.adb b/src/components/register_stuffer/test/register_stuffer_tests-implementation.adb index b7fe3ed0..9cb35b0e 100644 --- a/src/components/register_stuffer/test/register_stuffer_tests-implementation.adb +++ b/src/components/register_stuffer/test/register_stuffer_tests-implementation.adb @@ -221,7 +221,7 @@ package body Register_Stuffer_Tests.Implementation is -- Make sure some events were thrown: Natural_Assert.Eq (T.Event_T_Recv_Sync_History.Get_Count, 1); Natural_Assert.Eq (T.Invalid_Command_Received_History.Get_Count, 1); - Invalid_Command_Info_Assert.Eq (T.Invalid_Command_Received_History.Get (1), (Id => T.Commands.Get_Write_Register_Id, Errant_Field_Number => Interfaces.Unsigned_32'Last, Errant_Field => (0, 0, 0, 0, 0, 0, 0, 22))); + Invalid_Command_Info_Assert.Eq (T.Invalid_Command_Received_History.Get (1), (Id => T.Commands.Get_Write_Register_Id, Errant_Field_Number => Interfaces.Unsigned_32'Last, Errant_Field => [0, 0, 0, 0, 0, 0, 0, 22])); end Test_Invalid_Command; -- This unit test makes sure the protected register write feature works as intended. diff --git a/src/components/sequence_store/component-sequence_store-implementation.adb b/src/components/sequence_store/component-sequence_store-implementation.adb index 752b34d7..5b1a5474 100644 --- a/src/components/sequence_store/component-sequence_store-implementation.adb +++ b/src/components/sequence_store/component-sequence_store-implementation.adb @@ -222,7 +222,7 @@ package body Component.Sequence_Store.Implementation is -- Create byte array to hold summaries. We know that this byte array will fit into a packet, since we checked at -- initialization. subtype Summary_Byte_Array is Basic_Types.Byte_Array (0 .. Packed_Slot_Summary.Size_In_Bytes * Self.Slots.all'Length - 1); - Summary_Bytes : Summary_Byte_Array := (others => 0); + Summary_Bytes : Summary_Byte_Array := [others => 0]; Idx : Natural := Summary_Bytes'First; begin -- For each slot, grab the header and put relevant data into the diff --git a/src/components/sequence_store/gen/templates/sequence_store/name.ads b/src/components/sequence_store/gen/templates/sequence_store/name.ads index b952bd11..5fe7c6e7 100644 --- a/src/components/sequence_store/gen/templates/sequence_store/name.ads +++ b/src/components/sequence_store/gen/templates/sequence_store/name.ads @@ -26,11 +26,11 @@ package {{ name }} is -- The slots type which is a list of all the slots: -- - Slots : aliased Component.Sequence_Store.Sequence_Slot_Array := ( + Slots : aliased Component.Sequence_Store.Sequence_Slot_Array := [ {% for slot in slots %} {{ loop.index0 }} => Slot_{{ slot.number }}{{ "," if not loop.last }} {% endfor %} - ); + ]; Slots_Access : constant Component.Sequence_Store.Sequence_Slot_Array_Access := Slots'Access; diff --git a/src/components/sequence_store/test/sequence_store_tests-implementation.adb b/src/components/sequence_store/test/sequence_store_tests-implementation.adb index e3d1cd40..6ab71b67 100644 --- a/src/components/sequence_store/test/sequence_store_tests-implementation.adb +++ b/src/components/sequence_store/test/sequence_store_tests-implementation.adb @@ -55,11 +55,11 @@ package body Sequence_Store_Tests.Implementation is Slot_Overlap_2 : constant Memory_Region.T := (Address => Slot_3_Memory'Address + Storage_Offset (6), Length => 90); -- For testing bad initialization conditions: - Slots_Empty : aliased Component.Sequence_Store.Sequence_Slot_Array := (1 .. 0 => Slot_0_Region); - Slots_Weird_Index : aliased Component.Sequence_Store.Sequence_Slot_Array := (1 => Slot_0_Region, 2 => Slot_1_Region, 3 => Slot_2_Region, 4 => Slot_3_Region); - Slots_Too_Small : aliased Component.Sequence_Store.Sequence_Slot_Array := (Slot_0_Region, Slot_Too_Small, Slot_2_Region, Slot_3_Region); - Slots_Overlap_1 : aliased Component.Sequence_Store.Sequence_Slot_Array := (Slot_0_Region, Slot_1_Region, Slot_Overlap_1, Slot_3_Region); - Slots_Overlap_2 : aliased Component.Sequence_Store.Sequence_Slot_Array := (Slot_0_Region, Slot_1_Region, Slot_3_Region, Slot_Overlap_2); + Slots_Empty : aliased Component.Sequence_Store.Sequence_Slot_Array := [1 .. 0 => Slot_0_Region]; + Slots_Weird_Index : aliased Component.Sequence_Store.Sequence_Slot_Array := [1 => Slot_0_Region, 2 => Slot_1_Region, 3 => Slot_2_Region, 4 => Slot_3_Region]; + Slots_Too_Small : aliased Component.Sequence_Store.Sequence_Slot_Array := [Slot_0_Region, Slot_Too_Small, Slot_2_Region, Slot_3_Region]; + Slots_Overlap_1 : aliased Component.Sequence_Store.Sequence_Slot_Array := [Slot_0_Region, Slot_1_Region, Slot_Overlap_1, Slot_3_Region]; + Slots_Overlap_2 : aliased Component.Sequence_Store.Sequence_Slot_Array := [Slot_0_Region, Slot_1_Region, Slot_3_Region, Slot_Overlap_2]; ------------------------------------------------------------------------- -- Fixtures: @@ -99,7 +99,7 @@ package body Sequence_Store_Tests.Implementation is Sequence_Count => Sequence_Count, Buffer_Length => Packed_Slot_Summary.Size_In_Bytes * Test_Sequence_Store.Slots'Length ), - Buffer => (others => 0) + Buffer => [others => 0] ); Idx : Natural := Pkt.Buffer'First; begin @@ -225,9 +225,9 @@ package body Sequence_Store_Tests.Implementation is begin -- Initialize slot headers: -- Garbage - Slot_0_Header := (Slot_Info => (Reserved => 22, State => Inactive, Validity => Unchecked), Seq_Header => (Crc => (0, 0), Version => 0, Category => 0, Id => 33, Length => 18)); + Slot_0_Header := (Slot_Info => (Reserved => 22, State => Inactive, Validity => Unchecked), Seq_Header => (Crc => [0, 0], Version => 0, Category => 0, Id => 33, Length => 18)); -- Garbage - Slot_1_Header := (Slot_Info => (Reserved => 11, State => Active, Validity => Undefined), Seq_Header => (Crc => (0, 0), Version => 0, Category => 0, Id => 44, Length => 18)); + Slot_1_Header := (Slot_Info => (Reserved => 11, State => Active, Validity => Undefined), Seq_Header => (Crc => [0, 0], Version => 0, Category => 0, Id => 44, Length => 18)); -- Good Slot_2_Header := (Slot_Info => (Reserved => 9, State => Active, Validity => Invalid), @@ -241,18 +241,18 @@ package body Sequence_Store_Tests.Implementation is (Crc => Crc_16.Compute_Crc_16 (Slot_2_Memory (Slot_2_Memory'First + Sequence_Store_Slot_Metadata.Size_In_Bytes + 2 .. Slot_2_Memory'First + Sequence_Store_Slot_Metadata.Size_In_Bytes + 18 - 1)), Version => 0, Category => 0, Id => 55, Length => 18)); -- Too long: - Slot_3_Header := (Slot_Info => (Reserved => 12, State => Active, Validity => Valid), Seq_Header => (Crc => (0, 0), Version => 0, Category => 0, Id => 66, Length => 100)); + Slot_3_Header := (Slot_Info => (Reserved => 12, State => Active, Validity => Valid), Seq_Header => (Crc => [0, 0], Version => 0, Category => 0, Id => 66, Length => 100)); -- Call init: Self.Tester.Component_Instance.Init (Sequence_Slots => Test_Sequence_Store.Slots_Access, Check_Slots_At_Startup => True, Dump_Slot_Summary_At_Startup => True); -- Check headers now: - Sequence_Store_Slot_Header_Assert.Eq (Slot_0_Header, (Slot_Info => (Reserved => 22, State => Inactive, Validity => Invalid), Seq_Header => (Crc => (0, 0), Version => 0, Category => 0, Id => 33, Length => 18))); + Sequence_Store_Slot_Header_Assert.Eq (Slot_0_Header, (Slot_Info => (Reserved => 22, State => Inactive, Validity => Invalid), Seq_Header => (Crc => [0, 0], Version => 0, Category => 0, Id => 33, Length => 18))); -- Check headers now: - Sequence_Store_Slot_Header_Assert.Eq (Slot_1_Header, (Slot_Info => (Reserved => 11, State => Active, Validity => Invalid), Seq_Header => (Crc => (0, 0), Version => 0, Category => 0, Id => 44, Length => 18))); + Sequence_Store_Slot_Header_Assert.Eq (Slot_1_Header, (Slot_Info => (Reserved => 11, State => Active, Validity => Invalid), Seq_Header => (Crc => [0, 0], Version => 0, Category => 0, Id => 44, Length => 18))); Sequence_Store_Slot_Header_Assert.Eq (Slot_2_Header, (Slot_Info => (Reserved => 9, State => Active, Validity => Valid), Seq_Header => ( Crc => Crc_16.Compute_Crc_16 (Slot_2_Memory (Slot_2_Memory'First + Sequence_Store_Slot_Metadata.Size_In_Bytes + 2 .. Slot_2_Memory'First + Sequence_Store_Slot_Metadata.Size_In_Bytes + 18 - 1)), Version => 0, Category => 0, Id => 55, Length => 18 ))); - Sequence_Store_Slot_Header_Assert.Eq (Slot_3_Header, (Slot_Info => (Reserved => 12, State => Active, Validity => Invalid), Seq_Header => (Crc => (0, 0), Version => 0, Category => 0, Id => 66, Length => 100))); + Sequence_Store_Slot_Header_Assert.Eq (Slot_3_Header, (Slot_Info => (Reserved => 12, State => Active, Validity => Invalid), Seq_Header => (Crc => [0, 0], Version => 0, Category => 0, Id => 66, Length => 100))); exception -- Should never get here: when others => @@ -264,19 +264,19 @@ package body Sequence_Store_Tests.Implementation is use Sequence_Store_Enums.Slot_Valid_Type; begin -- Initialize slot headers: - Slot_0_Header := (Slot_Info => (Reserved => 22, State => Inactive, Validity => Unchecked), Seq_Header => (Crc => (0, 0), Version => 0, Category => 0, Id => 22, Length => 10)); + Slot_0_Header := (Slot_Info => (Reserved => 22, State => Inactive, Validity => Unchecked), Seq_Header => (Crc => [0, 0], Version => 0, Category => 0, Id => 22, Length => 10)); -- Activated - Slot_1_Header := (Slot_Info => (Reserved => 11, State => Active, Validity => Undefined), Seq_Header => (Crc => (0, 0), Version => 0, Category => 0, Id => 22, Length => 10)); + Slot_1_Header := (Slot_Info => (Reserved => 11, State => Active, Validity => Undefined), Seq_Header => (Crc => [0, 0], Version => 0, Category => 0, Id => 22, Length => 10)); -- Should be deactivated - Slot_2_Header := (Slot_Info => (Reserved => 9, State => Active, Validity => Invalid), Seq_Header => (Crc => (0, 0), Version => 0, Category => 0, Id => 22, Length => 10)); - Slot_3_Header := (Slot_Info => (Reserved => 12, State => Active, Validity => Valid), Seq_Header => (Crc => (0, 0), Version => 0, Category => 0, Id => 23, Length => 100)); + Slot_2_Header := (Slot_Info => (Reserved => 9, State => Active, Validity => Invalid), Seq_Header => (Crc => [0, 0], Version => 0, Category => 0, Id => 22, Length => 10)); + Slot_3_Header := (Slot_Info => (Reserved => 12, State => Active, Validity => Valid), Seq_Header => (Crc => [0, 0], Version => 0, Category => 0, Id => 23, Length => 100)); -- Call init: Self.Tester.Component_Instance.Init (Sequence_Slots => Test_Sequence_Store.Slots_Access, Check_Slots_At_Startup => False, Dump_Slot_Summary_At_Startup => True); -- Check headers now: - Sequence_Store_Slot_Header_Assert.Eq (Slot_0_Header, (Slot_Info => (Reserved => 22, State => Inactive, Validity => Unchecked), Seq_Header => (Crc => (0, 0), Version => 0, Category => 0, Id => 22, Length => 10))); - Sequence_Store_Slot_Header_Assert.Eq (Slot_1_Header, (Slot_Info => (Reserved => 11, State => Active, Validity => Undefined), Seq_Header => (Crc => (0, 0), Version => 0, Category => 0, Id => 22, Length => 10))); - Sequence_Store_Slot_Header_Assert.Eq (Slot_2_Header, (Slot_Info => (Reserved => 9, State => Inactive, Validity => Invalid), Seq_Header => (Crc => (0, 0), Version => 0, Category => 0, Id => 22, Length => 10))); - Sequence_Store_Slot_Header_Assert.Eq (Slot_3_Header, (Slot_Info => (Reserved => 12, State => Active, Validity => Valid), Seq_Header => (Crc => (0, 0), Version => 0, Category => 0, Id => 23, Length => 100))); + Sequence_Store_Slot_Header_Assert.Eq (Slot_0_Header, (Slot_Info => (Reserved => 22, State => Inactive, Validity => Unchecked), Seq_Header => (Crc => [0, 0], Version => 0, Category => 0, Id => 22, Length => 10))); + Sequence_Store_Slot_Header_Assert.Eq (Slot_1_Header, (Slot_Info => (Reserved => 11, State => Active, Validity => Undefined), Seq_Header => (Crc => [0, 0], Version => 0, Category => 0, Id => 22, Length => 10))); + Sequence_Store_Slot_Header_Assert.Eq (Slot_2_Header, (Slot_Info => (Reserved => 9, State => Inactive, Validity => Invalid), Seq_Header => (Crc => [0, 0], Version => 0, Category => 0, Id => 22, Length => 10))); + Sequence_Store_Slot_Header_Assert.Eq (Slot_3_Header, (Slot_Info => (Reserved => 12, State => Active, Validity => Valid), Seq_Header => (Crc => [0, 0], Version => 0, Category => 0, Id => 23, Length => 100))); exception -- Should never get here: when others => @@ -337,10 +337,10 @@ package body Sequence_Store_Tests.Implementation is Natural_Assert.Eq (T.Dumped_Slot_Summary_History.Get_Count, 1); -- Set the slot metadata to something different: - Slot_0_Header := (Slot_Info => (Reserved => 22, State => Inactive, Validity => Unchecked), Seq_Header => (Crc => (0, 0), Version => 0, Category => 0, Id => 22, Length => 10)); - Slot_1_Header := (Slot_Info => (Reserved => 11, State => Active, Validity => Undefined), Seq_Header => (Crc => (0, 0), Version => 0, Category => 0, Id => 15, Length => 10)); - Slot_2_Header := (Slot_Info => (Reserved => 9, State => Active, Validity => Invalid), Seq_Header => (Crc => (0, 0), Version => 0, Category => 0, Id => 33, Length => 10)); - Slot_3_Header := (Slot_Info => (Reserved => 12, State => Active, Validity => Valid), Seq_Header => (Crc => (0, 0), Version => 0, Category => 0, Id => 23, Length => 100)); + Slot_0_Header := (Slot_Info => (Reserved => 22, State => Inactive, Validity => Unchecked), Seq_Header => (Crc => [0, 0], Version => 0, Category => 0, Id => 22, Length => 10)); + Slot_1_Header := (Slot_Info => (Reserved => 11, State => Active, Validity => Undefined), Seq_Header => (Crc => [0, 0], Version => 0, Category => 0, Id => 15, Length => 10)); + Slot_2_Header := (Slot_Info => (Reserved => 9, State => Active, Validity => Invalid), Seq_Header => (Crc => [0, 0], Version => 0, Category => 0, Id => 33, Length => 10)); + Slot_3_Header := (Slot_Info => (Reserved => 12, State => Active, Validity => Valid), Seq_Header => (Crc => [0, 0], Version => 0, Category => 0, Id => 23, Length => 100)); -- Send command to dump summary: T.Command_T_Send (T.Commands.Dump_Summary); @@ -365,10 +365,10 @@ package body Sequence_Store_Tests.Implementation is T : Component.Sequence_Store.Implementation.Tester.Instance_Access renames Self.Tester; begin -- Set the slot metadata to something: - Slot_0_Header := (Slot_Info => (Reserved => 22, State => Inactive, Validity => Unchecked), Seq_Header => (Crc => (0, 0), Version => 0, Category => 0, Id => 22, Length => 10)); - Slot_1_Header := (Slot_Info => (Reserved => 11, State => Active, Validity => Undefined), Seq_Header => (Crc => (0, 0), Version => 0, Category => 0, Id => 15, Length => 10)); - Slot_2_Header := (Slot_Info => (Reserved => 9, State => Inactive, Validity => Invalid), Seq_Header => (Crc => (0, 0), Version => 0, Category => 0, Id => 33, Length => 10)); - Slot_3_Header := (Slot_Info => (Reserved => 12, State => Active, Validity => Valid), Seq_Header => (Crc => (0, 0), Version => 0, Category => 0, Id => 23, Length => 100)); + Slot_0_Header := (Slot_Info => (Reserved => 22, State => Inactive, Validity => Unchecked), Seq_Header => (Crc => [0, 0], Version => 0, Category => 0, Id => 22, Length => 10)); + Slot_1_Header := (Slot_Info => (Reserved => 11, State => Active, Validity => Undefined), Seq_Header => (Crc => [0, 0], Version => 0, Category => 0, Id => 15, Length => 10)); + Slot_2_Header := (Slot_Info => (Reserved => 9, State => Inactive, Validity => Invalid), Seq_Header => (Crc => [0, 0], Version => 0, Category => 0, Id => 33, Length => 10)); + Slot_3_Header := (Slot_Info => (Reserved => 12, State => Active, Validity => Valid), Seq_Header => (Crc => [0, 0], Version => 0, Category => 0, Id => 23, Length => 100)); -- Re-initialize so we start fresh: Self.Tester.Component_Instance.Final; @@ -381,7 +381,7 @@ package body Sequence_Store_Tests.Implementation is Command_Response_Assert.Eq (T.Command_Response_T_Recv_Sync_History.Get (1), (Source_Id => 0, Registration_Id => 0, Command_Id => T.Commands.Get_Activate_Slot_Id, Status => Success)); -- Expect slot_0 to now be active: - Sequence_Store_Slot_Header_Assert.Eq (Slot_0_Header, (Slot_Info => (Reserved => 22, State => Active, Validity => Unchecked), Seq_Header => (Crc => (0, 0), Version => 0, Category => 0, Id => 22, Length => 10))); + Sequence_Store_Slot_Header_Assert.Eq (Slot_0_Header, (Slot_Info => (Reserved => 22, State => Active, Validity => Unchecked), Seq_Header => (Crc => [0, 0], Version => 0, Category => 0, Id => 22, Length => 10))); -- Expect a packet to be produced: Natural_Assert.Eq (T.Packet_T_Recv_Sync_History.Get_Count, 1); @@ -402,7 +402,7 @@ package body Sequence_Store_Tests.Implementation is Command_Response_Assert.Eq (T.Command_Response_T_Recv_Sync_History.Get (2), (Source_Id => 0, Registration_Id => 0, Command_Id => T.Commands.Get_Activate_Slot_Id, Status => Success)); -- Expect slot_0 to now be active: - Sequence_Store_Slot_Header_Assert.Eq (Slot_0_Header, (Slot_Info => (Reserved => 22, State => Active, Validity => Unchecked), Seq_Header => (Crc => (0, 0), Version => 0, Category => 0, Id => 22, Length => 10))); + Sequence_Store_Slot_Header_Assert.Eq (Slot_0_Header, (Slot_Info => (Reserved => 22, State => Active, Validity => Unchecked), Seq_Header => (Crc => [0, 0], Version => 0, Category => 0, Id => 22, Length => 10))); -- Do NOT expect a packet to be produced, since nothing changed: Natural_Assert.Eq (T.Packet_T_Recv_Sync_History.Get_Count, 1); @@ -415,14 +415,14 @@ package body Sequence_Store_Tests.Implementation is -- Test activating another slot: -- First make sure slot 2 unchanged. - Sequence_Store_Slot_Header_Assert.Eq (Slot_2_Header, (Slot_Info => (Reserved => 9, State => Inactive, Validity => Invalid), Seq_Header => (Crc => (0, 0), Version => 0, Category => 0, Id => 33, Length => 10))); + Sequence_Store_Slot_Header_Assert.Eq (Slot_2_Header, (Slot_Info => (Reserved => 9, State => Inactive, Validity => Invalid), Seq_Header => (Crc => [0, 0], Version => 0, Category => 0, Id => 33, Length => 10))); T.Command_T_Send (T.Commands.Activate_Slot ((Slot => 2))); Natural_Assert.Eq (T.Dispatch_All, 1); Natural_Assert.Eq (T.Command_Response_T_Recv_Sync_History.Get_Count, 3); Command_Response_Assert.Eq (T.Command_Response_T_Recv_Sync_History.Get (3), (Source_Id => 0, Registration_Id => 0, Command_Id => T.Commands.Get_Activate_Slot_Id, Status => Success)); -- Expect slot_2 to now be active: - Sequence_Store_Slot_Header_Assert.Eq (Slot_2_Header, (Slot_Info => (Reserved => 9, State => Active, Validity => Invalid), Seq_Header => (Crc => (0, 0), Version => 0, Category => 0, Id => 33, Length => 10))); + Sequence_Store_Slot_Header_Assert.Eq (Slot_2_Header, (Slot_Info => (Reserved => 9, State => Active, Validity => Invalid), Seq_Header => (Crc => [0, 0], Version => 0, Category => 0, Id => 33, Length => 10))); -- Expect a packet to be produced: Natural_Assert.Eq (T.Packet_T_Recv_Sync_History.Get_Count, 2); @@ -443,7 +443,7 @@ package body Sequence_Store_Tests.Implementation is Command_Response_Assert.Eq (T.Command_Response_T_Recv_Sync_History.Get (4), (Source_Id => 0, Registration_Id => 0, Command_Id => T.Commands.Get_Deactivate_Slot_Id, Status => Success)); -- Expect slot_2 to now be inactive: - Sequence_Store_Slot_Header_Assert.Eq (Slot_2_Header, (Slot_Info => (Reserved => 9, State => Inactive, Validity => Invalid), Seq_Header => (Crc => (0, 0), Version => 0, Category => 0, Id => 33, Length => 10))); + Sequence_Store_Slot_Header_Assert.Eq (Slot_2_Header, (Slot_Info => (Reserved => 9, State => Inactive, Validity => Invalid), Seq_Header => (Crc => [0, 0], Version => 0, Category => 0, Id => 33, Length => 10))); -- Expect a packet to be produced: Natural_Assert.Eq (T.Packet_T_Recv_Sync_History.Get_Count, 3); @@ -461,7 +461,7 @@ package body Sequence_Store_Tests.Implementation is -- Test deactivating another slot -- Expect slot_0 to still be active: - Sequence_Store_Slot_Header_Assert.Eq (Slot_0_Header, (Slot_Info => (Reserved => 22, State => Active, Validity => Unchecked), Seq_Header => (Crc => (0, 0), Version => 0, Category => 0, Id => 22, Length => 10))); + Sequence_Store_Slot_Header_Assert.Eq (Slot_0_Header, (Slot_Info => (Reserved => 22, State => Active, Validity => Unchecked), Seq_Header => (Crc => [0, 0], Version => 0, Category => 0, Id => 22, Length => 10))); T.Command_T_Send (T.Commands.Deactivate_Slot ((Slot => 0))); Natural_Assert.Eq (T.Dispatch_All, 1); @@ -469,7 +469,7 @@ package body Sequence_Store_Tests.Implementation is Command_Response_Assert.Eq (T.Command_Response_T_Recv_Sync_History.Get (5), (Source_Id => 0, Registration_Id => 0, Command_Id => T.Commands.Get_Deactivate_Slot_Id, Status => Success)); -- Expect slot_0 to now be inactive: - Sequence_Store_Slot_Header_Assert.Eq (Slot_0_Header, (Slot_Info => (Reserved => 22, State => Inactive, Validity => Unchecked), Seq_Header => (Crc => (0, 0), Version => 0, Category => 0, Id => 22, Length => 10))); + Sequence_Store_Slot_Header_Assert.Eq (Slot_0_Header, (Slot_Info => (Reserved => 22, State => Inactive, Validity => Unchecked), Seq_Header => (Crc => [0, 0], Version => 0, Category => 0, Id => 22, Length => 10))); -- Expect a packet to be produced: Natural_Assert.Eq (T.Packet_T_Recv_Sync_History.Get_Count, 4); @@ -491,7 +491,7 @@ package body Sequence_Store_Tests.Implementation is Command_Response_Assert.Eq (T.Command_Response_T_Recv_Sync_History.Get (6), (Source_Id => 0, Registration_Id => 0, Command_Id => T.Commands.Get_Deactivate_Slot_Id, Status => Success)); -- Expect slot_0 to now be inactive: - Sequence_Store_Slot_Header_Assert.Eq (Slot_0_Header, (Slot_Info => (Reserved => 22, State => Inactive, Validity => Unchecked), Seq_Header => (Crc => (0, 0), Version => 0, Category => 0, Id => 22, Length => 10))); + Sequence_Store_Slot_Header_Assert.Eq (Slot_0_Header, (Slot_Info => (Reserved => 22, State => Inactive, Validity => Unchecked), Seq_Header => (Crc => [0, 0], Version => 0, Category => 0, Id => 22, Length => 10))); -- Do not expect a packet to be produced: Natural_Assert.Eq (T.Packet_T_Recv_Sync_History.Get_Count, 4); @@ -508,10 +508,10 @@ package body Sequence_Store_Tests.Implementation is T : Component.Sequence_Store.Implementation.Tester.Instance_Access renames Self.Tester; begin -- Set the slot metadata to something: - Slot_0_Header := (Slot_Info => (Reserved => 22, State => Active, Validity => Unchecked), Seq_Header => (Crc => (0, 0), Version => 0, Category => 0, Id => 22, Length => 10)); - Slot_1_Header := (Slot_Info => (Reserved => 11, State => Active, Validity => Undefined), Seq_Header => (Crc => (0, 0), Version => 0, Category => 0, Id => 15, Length => 10)); - Slot_2_Header := (Slot_Info => (Reserved => 9, State => Inactive, Validity => Invalid), Seq_Header => (Crc => (0, 0), Version => 0, Category => 0, Id => 22, Length => 10)); - Slot_3_Header := (Slot_Info => (Reserved => 12, State => Active, Validity => Valid), Seq_Header => (Crc => (0, 0), Version => 0, Category => 0, Id => 23, Length => 100)); + Slot_0_Header := (Slot_Info => (Reserved => 22, State => Active, Validity => Unchecked), Seq_Header => (Crc => [0, 0], Version => 0, Category => 0, Id => 22, Length => 10)); + Slot_1_Header := (Slot_Info => (Reserved => 11, State => Active, Validity => Undefined), Seq_Header => (Crc => [0, 0], Version => 0, Category => 0, Id => 15, Length => 10)); + Slot_2_Header := (Slot_Info => (Reserved => 9, State => Inactive, Validity => Invalid), Seq_Header => (Crc => [0, 0], Version => 0, Category => 0, Id => 22, Length => 10)); + Slot_3_Header := (Slot_Info => (Reserved => 12, State => Active, Validity => Valid), Seq_Header => (Crc => [0, 0], Version => 0, Category => 0, Id => 23, Length => 100)); -- Re-initialize so we start fresh: Self.Tester.Component_Instance.Final; @@ -554,7 +554,7 @@ package body Sequence_Store_Tests.Implementation is Packed_Sequence_Id_Assert.Eq (T.Cannot_Activate_Duplicate_Sequence_Id_History.Get (1), (Id => 22)); -- Make sure slot 2 still inactive: - Sequence_Store_Slot_Header_Assert.Eq (Slot_2_Header, (Slot_Info => (Reserved => 9, State => Inactive, Validity => Invalid), Seq_Header => (Crc => (0, 0), Version => 0, Category => 0, Id => 22, Length => 10))); + Sequence_Store_Slot_Header_Assert.Eq (Slot_2_Header, (Slot_Info => (Reserved => 9, State => Inactive, Validity => Invalid), Seq_Header => (Crc => [0, 0], Version => 0, Category => 0, Id => 22, Length => 10))); -- OK now let's deactivate the first duplicate and try again. T.Command_T_Send (T.Commands.Deactivate_Slot ((Slot => 0))); @@ -571,7 +571,7 @@ package body Sequence_Store_Tests.Implementation is Natural_Assert.Eq (T.Dumped_Slot_Summary_History.Get_Count, 1); -- Make sure slot 0 still inactive: - Sequence_Store_Slot_Header_Assert.Eq (Slot_0_Header, (Slot_Info => (Reserved => 22, State => Inactive, Validity => Unchecked), Seq_Header => (Crc => (0, 0), Version => 0, Category => 0, Id => 22, Length => 10))); + Sequence_Store_Slot_Header_Assert.Eq (Slot_0_Header, (Slot_Info => (Reserved => 22, State => Inactive, Validity => Unchecked), Seq_Header => (Crc => [0, 0], Version => 0, Category => 0, Id => 22, Length => 10))); -- OK now we should be able to activate slot 2: T.Command_T_Send (T.Commands.Activate_Slot ((Slot => 2))); @@ -587,7 +587,7 @@ package body Sequence_Store_Tests.Implementation is Natural_Assert.Eq (T.Dumped_Slot_Summary_History.Get_Count, 2); -- Make sure slot 2 active: - Sequence_Store_Slot_Header_Assert.Eq (Slot_2_Header, (Slot_Info => (Reserved => 9, State => Active, Validity => Invalid), Seq_Header => (Crc => (0, 0), Version => 0, Category => 0, Id => 22, Length => 10))); + Sequence_Store_Slot_Header_Assert.Eq (Slot_2_Header, (Slot_Info => (Reserved => 9, State => Active, Validity => Invalid), Seq_Header => (Crc => [0, 0], Version => 0, Category => 0, Id => 22, Length => 10))); -- OK now we should fail to activate slot 0. T.Command_T_Send (T.Commands.Activate_Slot ((Slot => 0))); @@ -602,7 +602,7 @@ package body Sequence_Store_Tests.Implementation is Packed_Sequence_Id_Assert.Eq (T.Cannot_Activate_Duplicate_Sequence_Id_History.Get (2), (Id => 22)); -- Make sure slot 0 inctive: - Sequence_Store_Slot_Header_Assert.Eq (Slot_0_Header, (Slot_Info => (Reserved => 22, State => Inactive, Validity => Unchecked), Seq_Header => (Crc => (0, 0), Version => 0, Category => 0, Id => 22, Length => 10))); + Sequence_Store_Slot_Header_Assert.Eq (Slot_0_Header, (Slot_Info => (Reserved => 22, State => Inactive, Validity => Unchecked), Seq_Header => (Crc => [0, 0], Version => 0, Category => 0, Id => 22, Length => 10))); end Test_Activate_Deactivate_Slot_Fail; overriding procedure Test_Check_Slot (Self : in out Instance) is @@ -612,9 +612,9 @@ package body Sequence_Store_Tests.Implementation is begin -- Initialize slot headers: -- Garbage - Slot_0_Header := (Slot_Info => (Reserved => 22, State => Inactive, Validity => Unchecked), Seq_Header => (Crc => (0, 0), Version => 0, Category => 0, Id => 33, Length => 10)); + Slot_0_Header := (Slot_Info => (Reserved => 22, State => Inactive, Validity => Unchecked), Seq_Header => (Crc => [0, 0], Version => 0, Category => 0, Id => 33, Length => 10)); -- Garbage - Slot_1_Header := (Slot_Info => (Reserved => 11, State => Active, Validity => Undefined), Seq_Header => (Crc => (0, 0), Version => 0, Category => 0, Id => 44, Length => 10)); + Slot_1_Header := (Slot_Info => (Reserved => 11, State => Active, Validity => Undefined), Seq_Header => (Crc => [0, 0], Version => 0, Category => 0, Id => 44, Length => 10)); -- Good Slot_2_Header := (Slot_Info => (Reserved => 9, State => Active, Validity => Invalid), @@ -628,7 +628,7 @@ package body Sequence_Store_Tests.Implementation is (Crc => Crc_16.Compute_Crc_16 (Slot_2_Memory (Slot_2_Memory'First + Sequence_Store_Slot_Metadata.Size_In_Bytes + 2 .. Slot_2_Memory'First + Sequence_Store_Slot_Metadata.Size_In_Bytes + Sequence_Header.Size_In_Bytes + 10 - 1)), Version => 0, Category => 0, Id => 55, Length => 10 + Sequence_Header.Size_In_Bytes)); -- Too long: - Slot_3_Header := (Slot_Info => (Reserved => 12, State => Active, Validity => Valid), Seq_Header => (Crc => (0, 0), Version => 0, Category => 0, Id => 66, Length => 100)); + Slot_3_Header := (Slot_Info => (Reserved => 12, State => Active, Validity => Valid), Seq_Header => (Crc => [0, 0], Version => 0, Category => 0, Id => 66, Length => 100)); -- Send command to check first slot: T.Command_T_Send (T.Commands.Check_Slot ((Slot => 0))); @@ -637,7 +637,7 @@ package body Sequence_Store_Tests.Implementation is Command_Response_Assert.Eq (T.Command_Response_T_Recv_Sync_History.Get (1), (Source_Id => 0, Registration_Id => 0, Command_Id => T.Commands.Get_Check_Slot_Id, Status => Success)); -- Check slot: - Sequence_Store_Slot_Header_Assert.Eq (Slot_0_Header, (Slot_Info => (Reserved => 22, State => Inactive, Validity => Invalid), Seq_Header => (Crc => (0, 0), Version => 0, Category => 0, Id => 33, Length => 10))); + Sequence_Store_Slot_Header_Assert.Eq (Slot_0_Header, (Slot_Info => (Reserved => 22, State => Inactive, Validity => Invalid), Seq_Header => (Crc => [0, 0], Version => 0, Category => 0, Id => 33, Length => 10))); -- Check packet: Natural_Assert.Eq (T.Packet_T_Recv_Sync_History.Get_Count, 1); @@ -652,7 +652,7 @@ package body Sequence_Store_Tests.Implementation is Natural_Assert.Eq (T.Dumped_Slot_Summary_History.Get_Count, 1); -- Make sure second slot unchanged: - Sequence_Store_Slot_Header_Assert.Eq (Slot_1_Header, (Slot_Info => (Reserved => 11, State => Active, Validity => Undefined), Seq_Header => (Crc => (0, 0), Version => 0, Category => 0, Id => 44, Length => 10))); + Sequence_Store_Slot_Header_Assert.Eq (Slot_1_Header, (Slot_Info => (Reserved => 11, State => Active, Validity => Undefined), Seq_Header => (Crc => [0, 0], Version => 0, Category => 0, Id => 44, Length => 10))); -- Send command to check second slot: T.Command_T_Send (T.Commands.Check_Slot ((Slot => 1))); @@ -661,7 +661,7 @@ package body Sequence_Store_Tests.Implementation is Command_Response_Assert.Eq (T.Command_Response_T_Recv_Sync_History.Get (2), (Source_Id => 0, Registration_Id => 0, Command_Id => T.Commands.Get_Check_Slot_Id, Status => Success)); -- Check slot: - Sequence_Store_Slot_Header_Assert.Eq (Slot_1_Header, (Slot_Info => (Reserved => 11, State => Active, Validity => Invalid), Seq_Header => (Crc => (0, 0), Version => 0, Category => 0, Id => 44, Length => 10))); + Sequence_Store_Slot_Header_Assert.Eq (Slot_1_Header, (Slot_Info => (Reserved => 11, State => Active, Validity => Invalid), Seq_Header => (Crc => [0, 0], Version => 0, Category => 0, Id => 44, Length => 10))); -- Check packet: Natural_Assert.Eq (T.Packet_T_Recv_Sync_History.Get_Count, 2); @@ -708,7 +708,7 @@ package body Sequence_Store_Tests.Implementation is Command_Response_Assert.Eq (T.Command_Response_T_Recv_Sync_History.Get (4), (Source_Id => 0, Registration_Id => 0, Command_Id => T.Commands.Get_Check_Slot_Id, Status => Success)); -- Check slot: - Sequence_Store_Slot_Header_Assert.Eq (Slot_3_Header, (Slot_Info => (Reserved => 12, State => Active, Validity => Invalid), Seq_Header => (Crc => (0, 0), Version => 0, Category => 0, Id => 66, Length => 100))); + Sequence_Store_Slot_Header_Assert.Eq (Slot_3_Header, (Slot_Info => (Reserved => 12, State => Active, Validity => Invalid), Seq_Header => (Crc => [0, 0], Version => 0, Category => 0, Id => 66, Length => 100))); -- Check packet: Natural_Assert.Eq (T.Packet_T_Recv_Sync_History.Get_Count, 4); @@ -744,9 +744,9 @@ package body Sequence_Store_Tests.Implementation is begin -- Initialize slot headers: -- Garbage - Slot_0_Header := (Slot_Info => (Reserved => 22, State => Inactive, Validity => Unchecked), Seq_Header => (Crc => (0, 0), Version => 0, Category => 0, Id => 33, Length => 10)); + Slot_0_Header := (Slot_Info => (Reserved => 22, State => Inactive, Validity => Unchecked), Seq_Header => (Crc => [0, 0], Version => 0, Category => 0, Id => 33, Length => 10)); -- Garbage - Slot_1_Header := (Slot_Info => (Reserved => 11, State => Active, Validity => Undefined), Seq_Header => (Crc => (0, 0), Version => 0, Category => 0, Id => 44, Length => 10)); + Slot_1_Header := (Slot_Info => (Reserved => 11, State => Active, Validity => Undefined), Seq_Header => (Crc => [0, 0], Version => 0, Category => 0, Id => 44, Length => 10)); -- Good Slot_2_Header := (Slot_Info => (Reserved => 9, State => Active, Validity => Invalid), @@ -760,7 +760,7 @@ package body Sequence_Store_Tests.Implementation is (Crc => Crc_16.Compute_Crc_16 (Slot_2_Memory (Slot_2_Memory'First + Sequence_Store_Slot_Metadata.Size_In_Bytes + 2 .. Slot_2_Memory'First + Sequence_Store_Slot_Metadata.Size_In_Bytes + Sequence_Header.Size_In_Bytes + 10 - 1)), Version => 0, Category => 0, Id => 55, Length => 10 + Sequence_Header.Size_In_Bytes)); -- Too long: - Slot_3_Header := (Slot_Info => (Reserved => 12, State => Active, Validity => Valid), Seq_Header => (Crc => (0, 0), Version => 0, Category => 0, Id => 66, Length => 100)); + Slot_3_Header := (Slot_Info => (Reserved => 12, State => Active, Validity => Valid), Seq_Header => (Crc => [0, 0], Version => 0, Category => 0, Id => 66, Length => 100)); -- Send command to check all slots: T.Command_T_Send (T.Commands.Check_All_Slots); @@ -769,10 +769,10 @@ package body Sequence_Store_Tests.Implementation is Command_Response_Assert.Eq (T.Command_Response_T_Recv_Sync_History.Get (1), (Source_Id => 0, Registration_Id => 0, Command_Id => T.Commands.Get_Check_All_Slots_Id, Status => Success)); -- Check slot: - Sequence_Store_Slot_Header_Assert.Eq (Slot_0_Header, (Slot_Info => (Reserved => 22, State => Inactive, Validity => Invalid), Seq_Header => (Crc => (0, 0), Version => 0, Category => 0, Id => 33, Length => 10))); + Sequence_Store_Slot_Header_Assert.Eq (Slot_0_Header, (Slot_Info => (Reserved => 22, State => Inactive, Validity => Invalid), Seq_Header => (Crc => [0, 0], Version => 0, Category => 0, Id => 33, Length => 10))); -- Check slot: - Sequence_Store_Slot_Header_Assert.Eq (Slot_1_Header, (Slot_Info => (Reserved => 11, State => Active, Validity => Invalid), Seq_Header => (Crc => (0, 0), Version => 0, Category => 0, Id => 44, Length => 10))); + Sequence_Store_Slot_Header_Assert.Eq (Slot_1_Header, (Slot_Info => (Reserved => 11, State => Active, Validity => Invalid), Seq_Header => (Crc => [0, 0], Version => 0, Category => 0, Id => 44, Length => 10))); -- Check slot: Sequence_Store_Slot_Header_Assert.Eq @@ -783,7 +783,7 @@ package body Sequence_Store_Tests.Implementation is Category => 0, Id => 55, Length => 10 + Sequence_Header.Size_In_Bytes))); -- Check slot: - Sequence_Store_Slot_Header_Assert.Eq (Slot_3_Header, (Slot_Info => (Reserved => 12, State => Active, Validity => Invalid), Seq_Header => (Crc => (0, 0), Version => 0, Category => 0, Id => 66, Length => 100))); + Sequence_Store_Slot_Header_Assert.Eq (Slot_3_Header, (Slot_Info => (Reserved => 12, State => Active, Validity => Invalid), Seq_Header => (Crc => [0, 0], Version => 0, Category => 0, Id => 66, Length => 100))); -- Check packet: Natural_Assert.Eq (T.Packet_T_Recv_Sync_History.Get_Count, 1); @@ -804,7 +804,7 @@ package body Sequence_Store_Tests.Implementation is T : Component.Sequence_Store.Implementation.Tester.Instance_Access renames Self.Tester; -- Create a sequence to send: - Sequence_Source_Memory : Basic_Types.Byte_Array (0 .. 999) := (others => 88); + Sequence_Source_Memory : Basic_Types.Byte_Array (0 .. 999) := [others => 88]; -- Sequence header: Seq_Header : Sequence_Header.T with Import, @@ -814,11 +814,11 @@ package body Sequence_Store_Tests.Implementation is Seq_Region : Memory_Region.T := (Address => Sequence_Source_Memory'Address, Length => 0); begin -- Initialize slot headers: - Slot_0_Header := (Slot_Info => (Reserved => 22, State => Inactive, Validity => Unchecked), Seq_Header => (Crc => (0, 0), Version => 0, Category => 0, Id => 33, Length => 10 + Sequence_Header.Size_In_Bytes)); + Slot_0_Header := (Slot_Info => (Reserved => 22, State => Inactive, Validity => Unchecked), Seq_Header => (Crc => [0, 0], Version => 0, Category => 0, Id => 33, Length => 10 + Sequence_Header.Size_In_Bytes)); -- OK let's set the sequence header such that it looks like a valid -- sequence: - Seq_Header := (Crc => (0, 0), Version => 0, Category => 0, Id => 77, Length => 10 + Sequence_Header.Size_In_Bytes); + Seq_Header := (Crc => [0, 0], Version => 0, Category => 0, Id => 77, Length => 10 + Sequence_Header.Size_In_Bytes); Seq_Header.Crc := Crc_16.Compute_Crc_16 (Sequence_Source_Memory (Sequence_Source_Memory'First + 2 .. Sequence_Source_Memory'First + Sequence_Header.Size_In_Bytes + 10 - 1)); -- Set the slot region length correctly: @@ -858,13 +858,13 @@ package body Sequence_Store_Tests.Implementation is -- -- Initialize slot headers: - Slot_3_Header := (Slot_Info => (Reserved => 22, State => Inactive, Validity => Invalid), Seq_Header => (Crc => (0, 0), Version => 0, Category => 0, Id => 33, Length => 70 - Sequence_Store_Slot_Header.Size_In_Bytes + Sequence_Header.Size_In_Bytes)); + Slot_3_Header := (Slot_Info => (Reserved => 22, State => Inactive, Validity => Invalid), Seq_Header => (Crc => [0, 0], Version => 0, Category => 0, Id => 33, Length => 70 - Sequence_Store_Slot_Header.Size_In_Bytes + Sequence_Header.Size_In_Bytes)); -- OK let's set the sequence header such that it looks like a valid -- sequence: Seq_Header := (Crc => - (0, 0), Version => 14, Category => 3, Id => 1_008, Length => 70 - Sequence_Store_Slot_Header.Size_In_Bytes -- maximum size that should fit + [0, 0], Version => 14, Category => 3, Id => 1_008, Length => 70 - Sequence_Store_Slot_Header.Size_In_Bytes -- maximum size that should fit ); Seq_Header.Crc := Crc_16.Compute_Crc_16 (Sequence_Source_Memory (Sequence_Source_Memory'First + 2 .. Sequence_Source_Memory'First + (70 - Sequence_Store_Slot_Header.Size_In_Bytes) - 1)); @@ -908,7 +908,7 @@ package body Sequence_Store_Tests.Implementation is T : Component.Sequence_Store.Implementation.Tester.Instance_Access renames Self.Tester; -- Create a sequence to send: - Sequence_Source_Memory : Basic_Types.Byte_Array (0 .. 999) := (others => 88); + Sequence_Source_Memory : Basic_Types.Byte_Array (0 .. 999) := [others => 88]; -- Sequence header: Seq_Header : Sequence_Header.T with Import, @@ -919,7 +919,7 @@ package body Sequence_Store_Tests.Implementation is begin -- OK let's set the sequence header such that it looks like a valid -- sequence: - Seq_Header := (Crc => (0, 0), Version => 0, Category => 0, Id => 77, Length => 10 + Sequence_Header.Size_In_Bytes); + Seq_Header := (Crc => [0, 0], Version => 0, Category => 0, Id => 77, Length => 10 + Sequence_Header.Size_In_Bytes); Seq_Header.Crc := Crc_16.Compute_Crc_16 (Sequence_Source_Memory (Sequence_Source_Memory'First + 2 .. Sequence_Source_Memory'First + Sequence_Header.Size_In_Bytes + 10 - 1)); -- Set the slot region length correctly: @@ -970,7 +970,7 @@ package body Sequence_Store_Tests.Implementation is (Slot_Info => (Reserved => 22, State => Active, -- in use - Validity => Invalid), Seq_Header => (Crc => (0, 0), Version => 0, Category => 0, Id => 33, Length => 12)); + Validity => Invalid), Seq_Header => (Crc => [0, 0], Version => 0, Category => 0, Id => 33, Length => 12)); -- OK, first let's try to send a sequence with an: T.Sequence_Store_Memory_Region_Store_T_Send ((Slot => 2, Sequence_Region => Seq_Region)); @@ -996,7 +996,7 @@ package body Sequence_Store_Tests.Implementation is (Slot_Info => (Reserved => 22, State => Active, -- in use - Validity => Invalid), Seq_Header => (Crc => (0, 0), Version => 0, Category => 0, Id => 33, Length => 12))); + Validity => Invalid), Seq_Header => (Crc => [0, 0], Version => 0, Category => 0, Id => 33, Length => 12))); -- Again @@ -1005,7 +1005,7 @@ package body Sequence_Store_Tests.Implementation is (Slot_Info => (Reserved => 11, State => Active, -- in use - Validity => Undefined), Seq_Header => (Crc => (0, 0), Version => 0, Category => 0, Id => 54, Length => 12)); + Validity => Undefined), Seq_Header => (Crc => [0, 0], Version => 0, Category => 0, Id => 54, Length => 12)); -- OK, first let's try to send a sequence: T.Sequence_Store_Memory_Region_Store_T_Send ((Slot => 1, Sequence_Region => Seq_Region)); @@ -1031,7 +1031,7 @@ package body Sequence_Store_Tests.Implementation is (Slot_Info => (Reserved => 11, State => Active, -- in use - Validity => Undefined), Seq_Header => (Crc => (0, 0), Version => 0, Category => 0, Id => 54, Length => 12))); + Validity => Undefined), Seq_Header => (Crc => [0, 0], Version => 0, Category => 0, Id => 54, Length => 12))); -- -- OK, now let's test a CRC error. @@ -1042,7 +1042,7 @@ package body Sequence_Store_Tests.Implementation is (Slot_Info => (Reserved => 11, State => Inactive, -- not in use - Validity => Undefined), Seq_Header => (Crc => (0, 0), Version => 0, Category => 0, Id => 54, Length => 12)); + Validity => Undefined), Seq_Header => (Crc => [0, 0], Version => 0, Category => 0, Id => 54, Length => 12)); -- Corrupt CRC Seq_Header.Crc (1) := Seq_Header.Crc (1) + 1; @@ -1073,7 +1073,7 @@ package body Sequence_Store_Tests.Implementation is (Slot_Info => (Reserved => 11, State => Inactive, -- not in use - Validity => Undefined), Seq_Header => (Crc => (0, 0), Version => 0, Category => 0, Id => 54, Length => 12))); + Validity => Undefined), Seq_Header => (Crc => [0, 0], Version => 0, Category => 0, Id => 54, Length => 12))); -- Again -- Fix CRC @@ -1108,7 +1108,7 @@ package body Sequence_Store_Tests.Implementation is (Slot_Info => (Reserved => 11, State => Inactive, -- not in use - Validity => Undefined), Seq_Header => (Crc => (0, 0), Version => 0, Category => 0, Id => 54, Length => 12))); + Validity => Undefined), Seq_Header => (Crc => [0, 0], Version => 0, Category => 0, Id => 54, Length => 12))); -- -- OK, now we need to check for length error handling @@ -1142,7 +1142,7 @@ package body Sequence_Store_Tests.Implementation is Natural_Assert.Eq (T.Writing_Sequence_To_Slot_History.Get_Count, 7); Sequence_Store_Memory_Region_Store_Assert.Eq (T.Writing_Sequence_To_Slot_History.Get (7), (Slot => 1, Sequence_Region => Seq_Region)); Natural_Assert.Eq (T.Invalid_Sequence_Crc_History.Get_Count, 3); - Invalid_Sequence_Crc_Info_Assert.Eq (T.Invalid_Sequence_Crc_History.Get (3), (Store => (Slot => 1, Sequence_Region => Seq_Region), Header => Seq_Header, Computed_Crc => (0, 0))); + Invalid_Sequence_Crc_Info_Assert.Eq (T.Invalid_Sequence_Crc_History.Get (3), (Store => (Slot => 1, Sequence_Region => Seq_Region), Header => Seq_Header, Computed_Crc => [0, 0])); -- Check packet: Natural_Assert.Eq (T.Packet_T_Recv_Sync_History.Get_Count, 0); @@ -1153,7 +1153,7 @@ package body Sequence_Store_Tests.Implementation is (Slot_Info => (Reserved => 11, State => Inactive, -- not in use - Validity => Undefined), Seq_Header => (Crc => (0, 0), Version => 0, Category => 0, Id => 54, Length => 12))); + Validity => Undefined), Seq_Header => (Crc => [0, 0], Version => 0, Category => 0, Id => 54, Length => 12))); -- OK, now set the sequence region so small that it cannot hold a header. Seq_Region.Length := 2; @@ -1177,7 +1177,7 @@ package body Sequence_Store_Tests.Implementation is Natural_Assert.Eq (T.Writing_Sequence_To_Slot_History.Get_Count, 8); Sequence_Store_Memory_Region_Store_Assert.Eq (T.Writing_Sequence_To_Slot_History.Get (8), (Slot => 1, Sequence_Region => Seq_Region)); Natural_Assert.Eq (T.Invalid_Sequence_Crc_History.Get_Count, 4); - Invalid_Sequence_Crc_Info_Assert.Eq (T.Invalid_Sequence_Crc_History.Get (4), (Store => (Slot => 1, Sequence_Region => Seq_Region), Header => (Crc => (0, 0), Version => 0, Category => 0, Id => 0, Length => 0), Computed_Crc => (0, 0))); + Invalid_Sequence_Crc_Info_Assert.Eq (T.Invalid_Sequence_Crc_History.Get (4), (Store => (Slot => 1, Sequence_Region => Seq_Region), Header => (Crc => [0, 0], Version => 0, Category => 0, Id => 0, Length => 0), Computed_Crc => [0, 0])); -- Check packet: Natural_Assert.Eq (T.Packet_T_Recv_Sync_History.Get_Count, 0); @@ -1188,7 +1188,7 @@ package body Sequence_Store_Tests.Implementation is (Slot_Info => (Reserved => 11, State => Inactive, -- not in use - Validity => Undefined), Seq_Header => (Crc => (0, 0), Version => 0, Category => 0, Id => 54, Length => 12))); + Validity => Undefined), Seq_Header => (Crc => [0, 0], Version => 0, Category => 0, Id => 54, Length => 12))); -- -- Ok now we test a different class of length errors, where @@ -1200,12 +1200,11 @@ package body Sequence_Store_Tests.Implementation is (Slot_Info => (Reserved => 11, State => Inactive, -- not in use - Validity => Undefined), Seq_Header => (Crc => (0, 0), Version => 0, Category => 0, Id => 54, Length => 12)); + Validity => Undefined), Seq_Header => (Crc => [0, 0], Version => 0, Category => 0, Id => 54, Length => 12)); Seq_Header := (Crc => - (0, - 0), Version => 0, Category => 0, Id => 77, Length => Slot_2_Memory'Length - Sequence_Store_Slot_Header.Size_In_Bytes + Sequence_Header.Size_In_Bytes + 1 -- one byte too large to fit + [0, 0], Version => 0, Category => 0, Id => 77, Length => Slot_2_Memory'Length - Sequence_Store_Slot_Header.Size_In_Bytes + Sequence_Header.Size_In_Bytes + 1 -- one byte too large to fit ); Seq_Header.Crc := Crc_16.Compute_Crc_16 (Sequence_Source_Memory (Sequence_Source_Memory'First + 2 .. Sequence_Source_Memory'First + Seq_Header.Length - 1)); @@ -1236,12 +1235,12 @@ package body Sequence_Store_Tests.Implementation is (Slot_Info => (Reserved => 11, State => Inactive, -- not in use - Validity => Undefined), Seq_Header => (Crc => (0, 0), Version => 0, Category => 0, Id => 54, Length => 12))); + Validity => Undefined), Seq_Header => (Crc => [0, 0], Version => 0, Category => 0, Id => 54, Length => 12))); -- Again with larger length Seq_Header := (Crc => - (0, 0), Version => + [0, 0], Version => 0, Category => 0, Id => 77, Length => @@ -1276,14 +1275,14 @@ package body Sequence_Store_Tests.Implementation is (Slot_Info => (Reserved => 11, State => Inactive, -- not in use - Validity => Undefined), Seq_Header => (Crc => (0, 0), Version => 0, Category => 0, Id => 54, Length => 12))); + Validity => Undefined), Seq_Header => (Crc => [0, 0], Version => 0, Category => 0, Id => 54, Length => 12))); -- Test where region is larger than slot, but sequence is small enough -- that it will still fit, this should work fine. Seq_Header := (Crc => - (0, 0), Version => + [0, 0], Version => 0, Category => 0, Id => 77, Length => 10 + Sequence_Header.Size_In_Bytes -- one byte too large to fit @@ -1331,10 +1330,10 @@ package body Sequence_Store_Tests.Implementation is T : Component.Sequence_Store.Implementation.Tester.Instance_Access renames Self.Tester; begin -- Set the slot metadata to something: - Slot_0_Header := (Slot_Info => (Reserved => 22, State => Inactive, Validity => Unchecked), Seq_Header => (Crc => (0, 0), Version => 0, Category => 0, Id => 22, Length => 10)); - Slot_1_Header := (Slot_Info => (Reserved => 11, State => Active, Validity => Undefined), Seq_Header => (Crc => (0, 0), Version => 0, Category => 0, Id => 22, Length => 10)); - Slot_2_Header := (Slot_Info => (Reserved => 9, State => Inactive, Validity => Invalid), Seq_Header => (Crc => (0, 0), Version => 0, Category => 0, Id => 33, Length => 10)); - Slot_3_Header := (Slot_Info => (Reserved => 12, State => Active, Validity => Valid), Seq_Header => (Crc => (0, 0), Version => 0, Category => 0, Id => 23, Length => 100)); + Slot_0_Header := (Slot_Info => (Reserved => 22, State => Inactive, Validity => Unchecked), Seq_Header => (Crc => [0, 0], Version => 0, Category => 0, Id => 22, Length => 10)); + Slot_1_Header := (Slot_Info => (Reserved => 11, State => Active, Validity => Undefined), Seq_Header => (Crc => [0, 0], Version => 0, Category => 0, Id => 22, Length => 10)); + Slot_2_Header := (Slot_Info => (Reserved => 9, State => Inactive, Validity => Invalid), Seq_Header => (Crc => [0, 0], Version => 0, Category => 0, Id => 33, Length => 10)); + Slot_3_Header := (Slot_Info => (Reserved => 12, State => Active, Validity => Valid), Seq_Header => (Crc => [0, 0], Version => 0, Category => 0, Id => 23, Length => 100)); -- Re-initialize so we start fresh: Self.Tester.Component_Instance.Final; @@ -1361,7 +1360,7 @@ package body Sequence_Store_Tests.Implementation is Command_Response_Assert.Eq (T.Command_Response_T_Recv_Sync_History.Get (1), (Source_Id => 0, Registration_Id => 0, Command_Id => T.Commands.Get_Activate_Slot_Id, Status => Success)); -- Expect slot_2 to now be active: - Sequence_Store_Slot_Header_Assert.Eq (Slot_2_Header, (Slot_Info => (Reserved => 9, State => Active, Validity => Invalid), Seq_Header => (Crc => (0, 0), Version => 0, Category => 0, Id => 33, Length => 10))); + Sequence_Store_Slot_Header_Assert.Eq (Slot_2_Header, (Slot_Info => (Reserved => 9, State => Active, Validity => Invalid), Seq_Header => (Crc => [0, 0], Version => 0, Category => 0, Id => 33, Length => 10))); -- Expect a packet to be produced: Natural_Assert.Eq (T.Packet_T_Recv_Sync_History.Get_Count, 1); @@ -1386,7 +1385,7 @@ package body Sequence_Store_Tests.Implementation is Command_Response_Assert.Eq (T.Command_Response_T_Recv_Sync_History.Get (2), (Source_Id => 0, Registration_Id => 0, Command_Id => T.Commands.Get_Deactivate_Slot_Id, Status => Success)); -- Expect slot_1 to now be inactive: - Sequence_Store_Slot_Header_Assert.Eq (Slot_1_Header, (Slot_Info => (Reserved => 11, State => Inactive, Validity => Undefined), Seq_Header => (Crc => (0, 0), Version => 0, Category => 0, Id => 22, Length => 10))); + Sequence_Store_Slot_Header_Assert.Eq (Slot_1_Header, (Slot_Info => (Reserved => 11, State => Inactive, Validity => Undefined), Seq_Header => (Crc => [0, 0], Version => 0, Category => 0, Id => 22, Length => 10))); -- Expect a packet to be produced: Natural_Assert.Eq (T.Packet_T_Recv_Sync_History.Get_Count, 2); @@ -1455,7 +1454,7 @@ package body Sequence_Store_Tests.Implementation is -- Make sure some events were thrown: Natural_Assert.Eq (T.Event_T_Recv_Sync_History.Get_Count, 1); Natural_Assert.Eq (T.Invalid_Command_Received_History.Get_Count, 1); - Invalid_Command_Info_Assert.Eq (T.Invalid_Command_Received_History.Get (1), (Id => T.Commands.Get_Activate_Slot_Id, Errant_Field_Number => Interfaces.Unsigned_32'Last, Errant_Field => (0, 0, 0, 0, 0, 0, 0, 0))); + Invalid_Command_Info_Assert.Eq (T.Invalid_Command_Received_History.Get (1), (Id => T.Commands.Get_Activate_Slot_Id, Errant_Field_Number => Interfaces.Unsigned_32'Last, Errant_Field => [0, 0, 0, 0, 0, 0, 0, 0])); end Test_Invalid_Command; end Sequence_Store_Tests.Implementation; diff --git a/src/components/stack_monitor/component-stack_monitor-implementation.adb b/src/components/stack_monitor/component-stack_monitor-implementation.adb index 2f4293c6..d1a578dc 100644 --- a/src/components/stack_monitor/component-stack_monitor-implementation.adb +++ b/src/components/stack_monitor/component-stack_monitor-implementation.adb @@ -28,7 +28,7 @@ package body Component.Stack_Monitor.Implementation is -- Dynamically create a list of cached indexes to speed up the calculation of the stack size. This -- list is the same size as the task list passed in. Self.Stack_Indexes := new Index_Array_Type (Task_List.all'First .. Task_List.all'Last); - Self.Stack_Indexes.all := (others => 0); + Self.Stack_Indexes.all := [others => 0]; -- Set the packet length. Each data point for -- stack usage is a percentage that is 1 byte large. We store 2 of these per @@ -40,7 +40,7 @@ package body Component.Stack_Monitor.Implementation is Sequence_Count => 0, Buffer_Length => 2 * Self.Tasks.all'Length ), - Buffer => (others => 0) + Buffer => [others => 0] ); end Init; diff --git a/src/components/stack_monitor/test/stack_monitor_tests-implementation.adb b/src/components/stack_monitor/test/stack_monitor_tests-implementation.adb index bd1cbfa2..cd88ea1e 100644 --- a/src/components/stack_monitor/test/stack_monitor_tests-implementation.adb +++ b/src/components/stack_monitor/test/stack_monitor_tests-implementation.adb @@ -23,7 +23,7 @@ package body Stack_Monitor_Tests.Implementation is -- Fixtures: ------------------------------------------------------------------------- - Task_1_Stack : aliased Basic_Types.Byte_Array (0 .. 999) := (others => 16#CC#); + Task_1_Stack : aliased Basic_Types.Byte_Array (0 .. 999) := [others => 16#CC#]; Task_1_Info : aliased Task_Types.Task_Info := ( Number => 1, Id => Ada.Task_Identification.Null_Task_Id, @@ -34,7 +34,7 @@ package body Stack_Monitor_Tests.Implementation is Secondary_Stack_Max_Usage => 0 ); - Task_2_Stack : aliased Basic_Types.Byte_Array (0 .. 1_999) := (others => 16#CC#); + Task_2_Stack : aliased Basic_Types.Byte_Array (0 .. 1_999) := [others => 16#CC#]; Task_2_Info : aliased Task_Types.Task_Info := ( Number => 2, Id => Ada.Task_Identification.Null_Task_Id, @@ -46,7 +46,7 @@ package body Stack_Monitor_Tests.Implementation is Secondary_Stack_Max_Usage => 0 ); - Task_List : aliased Task_Types.Task_Info_List := (0 => Task_1_Info'Access, 1 => Task_2_Info'Access); + Task_List : aliased Task_Types.Task_Info_List := [0 => Task_1_Info'Access, 1 => Task_2_Info'Access]; overriding procedure Set_Up_Test (Self : in out Instance) is begin @@ -57,8 +57,8 @@ package body Stack_Monitor_Tests.Implementation is Self.Tester.Connect; -- Make sure the stacks are pristine: - Task_1_Stack := (others => 16#CC#); - Task_2_Stack := (others => 16#CC#); + Task_1_Stack := [others => 16#CC#]; + Task_2_Stack := [others => 16#CC#]; Task_1_Info.Secondary_Stack_Max_Usage := 0; Task_2_Info.Secondary_Stack_Max_Usage := 0; @@ -82,7 +82,7 @@ package body Stack_Monitor_Tests.Implementation is overriding procedure Test_Stack_Monitoring (Self : in out Instance) is T : Component.Stack_Monitor.Implementation.Tester.Instance_Access renames Self.Tester; A_Tick : constant Tick.T := ((0, 0), 0); - Pkt : Packet.T := (Header => (Time => (0, 0), Id => T.Packets.Get_Stack_Usage_Packet_Id, Sequence_Count => 0, Buffer_Length => 4), Buffer => (others => 0)); + Pkt : Packet.T := (Header => (Time => (0, 0), Id => T.Packets.Get_Stack_Usage_Packet_Id, Sequence_Count => 0, Buffer_Length => 4), Buffer => [others => 0]); begin -- Send a tick and expect a packet. T.Tick_T_Send (A_Tick); @@ -159,7 +159,7 @@ package body Stack_Monitor_Tests.Implementation is -- A little white box testing. The internal index in the component for -- caching should be the last possible index. - T.Check_Stack_Indexes ((Task_1_Stack'Last, Task_2_Stack'Last)); + T.Check_Stack_Indexes ([Task_1_Stack'Last, Task_2_Stack'Last]); -- Send a tick and expect a packet. T.Tick_T_Send (A_Tick); @@ -182,7 +182,7 @@ package body Stack_Monitor_Tests.Implementation is -- A little white box testing. The internal index in the component for -- caching should be at the last location where the stack ended. - T.Check_Stack_Indexes ((Task_1_Stack'Last - 638, Task_2_Stack'Last - 638)); + T.Check_Stack_Indexes ([Task_1_Stack'Last - 638, Task_2_Stack'Last - 638]); -- Send a tick and expect a packet. T.Tick_T_Send (A_Tick); @@ -204,7 +204,7 @@ package body Stack_Monitor_Tests.Implementation is -- A little white box testing. The internal index in the component for -- caching should be at the last location where the stack ended. - T.Check_Stack_Indexes ((Task_1_Stack'Last - 902, Task_2_Stack'Last - 1_002)); + T.Check_Stack_Indexes ([Task_1_Stack'Last - 902, Task_2_Stack'Last - 1_002]); -- Send a tick and expect a packet. T.Tick_T_Send (A_Tick); @@ -218,7 +218,7 @@ package body Stack_Monitor_Tests.Implementation is -- A little white box testing. The internal index in the component for -- caching should be at the last location where the stack ended. - T.Check_Stack_Indexes ((0, 0)); + T.Check_Stack_Indexes ([0, 0]); -- Send a tick and expect a packet. T.Tick_T_Send (A_Tick); @@ -230,7 +230,7 @@ package body Stack_Monitor_Tests.Implementation is -- A little white box testing. The internal index in the component for -- caching should be at the last location where the stack ended. - T.Check_Stack_Indexes ((0, 0)); + T.Check_Stack_Indexes ([0, 0]); -- OK let's test some special cases. Task_1_Info.Stack_Size := 99; @@ -248,7 +248,7 @@ package body Stack_Monitor_Tests.Implementation is -- A little white box testing. The internal index in the component for -- caching should be at the last location where the stack ended. - T.Check_Stack_Indexes ((0, 0)); + T.Check_Stack_Indexes ([0, 0]); -- No events should have been sent unless a command was sent. No commands were sent. Natural_Assert.Eq (T.Event_T_Recv_Sync_History.Get_Count, 0); @@ -344,7 +344,7 @@ package body Stack_Monitor_Tests.Implementation is Natural_Assert.Eq (T.Event_T_Recv_Sync_History.Get_Count, 1); Natural_Assert.Eq (T.Packet_Period_Set_History.Get_Count, 0); Natural_Assert.Eq (T.Invalid_Command_Received_History.Get_Count, 1); - Invalid_Command_Info_Assert.Eq (T.Invalid_Command_Received_History.Get (1), (Id => T.Commands.Get_Set_Packet_Period_Id, Errant_Field_Number => Interfaces.Unsigned_32'Last, Errant_Field => (0, 0, 0, 0, 0, 0, 0, 0))); + Invalid_Command_Info_Assert.Eq (T.Invalid_Command_Received_History.Get (1), (Id => T.Commands.Get_Set_Packet_Period_Id, Errant_Field_Number => Interfaces.Unsigned_32'Last, Errant_Field => [0, 0, 0, 0, 0, 0, 0, 0])); end Test_Invalid_Command; end Stack_Monitor_Tests.Implementation; diff --git a/src/components/task_watchdog/gen/templates/task_watchdog_list/name.ads b/src/components/task_watchdog/gen/templates/task_watchdog_list/name.ads index 8d9f1dd6..39c80917 100644 --- a/src/components/task_watchdog/gen/templates/task_watchdog_list/name.ads +++ b/src/components/task_watchdog/gen/templates/task_watchdog_list/name.ads @@ -7,7 +7,7 @@ with Task_Watchdog_Enums; use Task_Watchdog_Enums; {% endif %} package {{ name }} is -- The initial list for the task watchdog component - Task_Watchdog_Entry_Init_List : aliased Task_Watchdog_Init_List := ( + Task_Watchdog_Entry_Init_List : aliased Task_Watchdog_Init_List := [ {% for petter in watchdog_list.values() %} {% if petter.description %} {{ printMultiLine(petter.description, ' -- ') }} @@ -24,6 +24,6 @@ package {{ name }} is Petter_Has_Fault => {{ petter.has_fault }} ){{ "," if not loop.last }} {% endfor %} - ); + ]; end {{ name }}; diff --git a/src/components/task_watchdog/test/task_watchdog_tests-implementation.adb b/src/components/task_watchdog/test/task_watchdog_tests-implementation.adb index 692c566d..de01214d 100644 --- a/src/components/task_watchdog/test/task_watchdog_tests-implementation.adb +++ b/src/components/task_watchdog/test/task_watchdog_tests-implementation.adb @@ -55,7 +55,7 @@ package body Task_Watchdog_Tests.Implementation is -- Helper function to build the limit DPs to compare to the output function Test_Create_Dp_Limit_Type (Id : in Data_Product_Types.Data_Product_Id; Limit_Value : in Interfaces.Unsigned_16) return Data_Product.T is - Dp : Data_Product.T := (Header => (Id => Id, Time => (0, 0), Buffer_Length => Packed_U16.Serialization.Serialized_Length), Buffer => (others => 0)); + Dp : Data_Product.T := (Header => (Id => Id, Time => (0, 0), Buffer_Length => Packed_U16.Serialization.Serialized_Length), Buffer => [others => 0]); begin Dp.Buffer (Dp.Buffer'First .. Dp.Buffer'First + Packed_U16.Serialization.Serialized_Length - 1) := Packed_U16.Serialization.To_Byte_Array ((Value => Limit_Value)); return Dp; @@ -63,7 +63,7 @@ package body Task_Watchdog_Tests.Implementation is -- Helper function to build the limit DPs to compare to the output function Test_Create_Fault (Id : in Fault_Types.Fault_Id; Idx : in Connector_Types.Connector_Index_Type) return Fault.T is - New_Fault : Fault.T := (Header => (Id => Id, Time => (0, 0), Param_Buffer_Length => Packed_Connector_Index.Serialization.Serialized_Length), Param_Buffer => (others => 16#FF#)); + New_Fault : Fault.T := (Header => (Id => Id, Time => (0, 0), Param_Buffer_Length => Packed_Connector_Index.Serialization.Serialized_Length), Param_Buffer => [others => 16#FF#]); begin New_Fault.Param_Buffer (New_Fault.Param_Buffer'First .. New_Fault.Param_Buffer'First + Packed_Connector_Index.Serialization.Serialized_Length - 1) := Packed_Connector_Index.Serialization.To_Byte_Array ((Index => Idx)); return New_Fault; @@ -173,7 +173,7 @@ package body Task_Watchdog_Tests.Implementation is T : Component.Task_Watchdog.Implementation.Tester.Instance_Access renames Self.Tester; Input_Tick : constant Tick.T := ((0, 0), 0); Input_Pet : constant Pet.T := (Count => 0); - Test_State_Data_Product : Data_Product.T := (Header => (Id => 0, Time => (0, 0), Buffer_Length => Packed_Byte.Serialization.Serialized_Length), Buffer => (others => 16#FF#)); + Test_State_Data_Product : Data_Product.T := (Header => (Id => 0, Time => (0, 0), Buffer_Length => Packed_Byte.Serialization.Serialized_Length), Buffer => [others => 16#FF#]); begin Put_Line (""); Put_Line ("----------------------------------"); @@ -306,7 +306,7 @@ package body Task_Watchdog_Tests.Implementation is T : Component.Task_Watchdog.Implementation.Tester.Instance_Access renames Self.Tester; Input_Tick : constant Tick.T := ((0, 0), 0); Input_Pet : constant Pet.T := (Count => 0); - Test_Action_Data_Product : Data_Product.T := (Header => (Id => 1, Time => (0, 0), Buffer_Length => Packed_Byte.Serialization.Serialized_Length), Buffer => (others => 0)); + Test_Action_Data_Product : Data_Product.T := (Header => (Id => 1, Time => (0, 0), Buffer_Length => Packed_Byte.Serialization.Serialized_Length), Buffer => [others => 0]); begin Put_Line (""); Put_Line ("----------------------------------"); @@ -478,7 +478,7 @@ package body Task_Watchdog_Tests.Implementation is T : Component.Task_Watchdog.Implementation.Tester.Instance_Access renames Self.Tester; Input_Tick : constant Tick.T := ((0, 0), 0); Input_Pet : constant Pet.T := (Count => 0); - Test_Limit_Data_Product : Data_Product.T := (Header => (Id => 2, Time => (0, 0), Buffer_Length => Packed_U16.Serialization.Serialized_Length), Buffer => (others => 0)); + Test_Limit_Data_Product : Data_Product.T := (Header => (Id => 2, Time => (0, 0), Buffer_Length => Packed_U16.Serialization.Serialized_Length), Buffer => [others => 0]); begin Put_Line (""); Put_Line ("----------------------------------"); @@ -518,7 +518,7 @@ package body Task_Watchdog_Tests.Implementation is Natural_Assert.Eq (T.Event_T_Recv_Sync_History.Get_Count, 2); Natural_Assert.Eq (T.Watchdog_Limit_Set_History.Get_Count, 1); Natural_Assert.Eq (T.Data_Product_T_Recv_Sync_History.Get_Count, Init_Dp_Count + 1); - Test_Limit_Data_Product.Buffer (0 .. 1) := (0, 5); + Test_Limit_Data_Product.Buffer (0 .. 1) := [0, 5]; Data_Product_Assert.Eq (T.Data_Product_T_Recv_Sync_History.Get (Init_Dp_Count + 1), Test_Limit_Data_Product); -- Reset the critical petter @@ -565,7 +565,7 @@ package body Task_Watchdog_Tests.Implementation is Natural_Assert.Eq (T.Watchdog_Limit_Set_History.Get_Count, 2); Natural_Assert.Eq (T.Data_Product_T_Recv_Sync_History.Get_Count, Init_Dp_Count + 2); Test_Limit_Data_Product.Header.Id := 3; - Test_Limit_Data_Product.Buffer (0 .. 1) := (0, 4); + Test_Limit_Data_Product.Buffer (0 .. 1) := [0, 4]; Data_Product_Assert.Eq (T.Data_Product_T_Recv_Sync_History.Get (Init_Dp_Count + 2), Test_Limit_Data_Product); T.Tick_T_Send (Input_Tick); @@ -624,7 +624,7 @@ package body Task_Watchdog_Tests.Implementation is -- Make sure some events were thrown: Natural_Assert.Eq (T.Event_T_Recv_Sync_History.Get_Count, 1); Natural_Assert.Eq (T.Invalid_Command_Received_History.Get_Count, 1); - Invalid_Command_Info_Assert.Eq (T.Invalid_Command_Received_History.Get (1), (Id => T.Commands.Get_Set_Watchdog_Limit_Id, Errant_Field_Number => Interfaces.Unsigned_32'Last, Errant_Field => (0, 0, 0, 0, 0, 0, 0, 0))); + Invalid_Command_Info_Assert.Eq (T.Invalid_Command_Received_History.Get (1), (Id => T.Commands.Get_Set_Watchdog_Limit_Id, Errant_Field_Number => Interfaces.Unsigned_32'Last, Errant_Field => [0, 0, 0, 0, 0, 0, 0, 0])); end Test_Invalid_Command; end Task_Watchdog_Tests.Implementation; diff --git a/src/components/tick_divider/test/tests-implementation.adb b/src/components/tick_divider/test/tests-implementation.adb index c58a4f2c..1a710467 100644 --- a/src/components/tick_divider/test/tests-implementation.adb +++ b/src/components/tick_divider/test/tests-implementation.adb @@ -38,7 +38,7 @@ package body Tests.Implementation is overriding procedure Nominal (Self : in out Instance) is T : Component.Tick_Divider.Implementation.Tester.Instance_Access renames Self.Tester; Systime : constant Sys_Time.T := (Seconds => 15, Subseconds => 26); - Dividers : aliased Component.Tick_Divider.Divider_Array_Type := (1 => 5, 2 => 0, 3 => 7, 4 => 2); + Dividers : aliased Component.Tick_Divider.Divider_Array_Type := [1 => 5, 2 => 0, 3 => 7, 4 => 2]; begin -- Init component: T.Component_Instance.Init (Dividers'Unchecked_Access); @@ -93,7 +93,7 @@ package body Tests.Implementation is T : Component.Tick_Divider.Implementation.Tester.Instance_Access renames Self.Tester; procedure Init_Nominal is - Dividers : aliased Component.Tick_Divider.Divider_Array_Type := (1 => 0, 2 => 1, 3 => 0, 4 => 67); + Dividers : aliased Component.Tick_Divider.Divider_Array_Type := [1 => 0, 2 => 1, 3 => 0, 4 => 67]; begin T.Component_Instance.Init (Dividers'Unchecked_Access); exception @@ -103,7 +103,7 @@ package body Tests.Implementation is end Init_Nominal; procedure Init_Too_Few_Arguments is - Dividers : aliased Component.Tick_Divider.Divider_Array_Type := (0, 1, 3); + Dividers : aliased Component.Tick_Divider.Divider_Array_Type := [0, 1, 3]; begin T.Component_Instance.Init (Dividers'Unchecked_Access); -- Should never get here: @@ -115,7 +115,7 @@ package body Tests.Implementation is end Init_Too_Few_Arguments; procedure Init_Too_Many_Arguments is - Dividers : aliased Component.Tick_Divider.Divider_Array_Type := (0, 1, 2, 3, 5, 6); + Dividers : aliased Component.Tick_Divider.Divider_Array_Type := [0, 1, 2, 3, 5, 6]; begin T.Component_Instance.Init (Dividers'Unchecked_Access); -- Should never get here: @@ -127,7 +127,7 @@ package body Tests.Implementation is end Init_Too_Many_Arguments; procedure Init_Bad_Index is - Dividers : aliased Component.Tick_Divider.Divider_Array_Type := (2 => 0, 3 => 1, 4 => 0, 5 => 7); + Dividers : aliased Component.Tick_Divider.Divider_Array_Type := [2 => 0, 3 => 1, 4 => 0, 5 => 7]; begin T.Component_Instance.Init (Dividers'Unchecked_Access); -- Should never get here: @@ -148,7 +148,7 @@ package body Tests.Implementation is overriding procedure Full_Queue (Self : in out Instance) is T : Component.Tick_Divider.Implementation.Tester.Instance_Access renames Self.Tester; Thetick1 : constant Tick.T := (Time => (0, 0), Count => 1); - Dividers : aliased Component.Tick_Divider.Divider_Array_Type := (1 => 1, 2 => 0, 3 => 2, 4 => 0); + Dividers : aliased Component.Tick_Divider.Divider_Array_Type := [1 => 1, 2 => 0, 3 => 2, 4 => 0]; begin -- Init component: T.Component_Instance.Init (Dividers'Unchecked_Access); diff --git a/src/components/time_at_tone_master/test/time_at_tone_master_tests-implementation.adb b/src/components/time_at_tone_master/test/time_at_tone_master_tests-implementation.adb index ac76138b..8491e7cc 100644 --- a/src/components/time_at_tone_master/test/time_at_tone_master_tests-implementation.adb +++ b/src/components/time_at_tone_master/test/time_at_tone_master_tests-implementation.adb @@ -255,7 +255,7 @@ package body Time_At_Tone_Master_Tests.Implementation is Natural_Assert.Eq (T.Event_T_Recv_Sync_History.Get_Count, 1); Natural_Assert.Eq (T.Time_At_Tone_Enabled_History.Get_Count, 0); Natural_Assert.Eq (T.Invalid_Command_Received_History.Get_Count, 1); - Invalid_Command_Info_Assert.Eq (T.Invalid_Command_Received_History.Get (1), (Id => T.Commands.Get_Enable_Time_At_Tone_Id, Errant_Field_Number => Interfaces.Unsigned_32'Last, Errant_Field => (0, 0, 0, 0, 0, 0, 0, 1))); + Invalid_Command_Info_Assert.Eq (T.Invalid_Command_Received_History.Get (1), (Id => T.Commands.Get_Enable_Time_At_Tone_Id, Errant_Field_Number => Interfaces.Unsigned_32'Last, Errant_Field => [0, 0, 0, 0, 0, 0, 0, 1])); end Test_Invalid_Command; end Time_At_Tone_Master_Tests.Implementation; diff --git a/src/components/time_of_tone_master/test/time_of_tone_master_tests-implementation.adb b/src/components/time_of_tone_master/test/time_of_tone_master_tests-implementation.adb index 300e5aec..60bd979c 100644 --- a/src/components/time_of_tone_master/test/time_of_tone_master_tests-implementation.adb +++ b/src/components/time_of_tone_master/test/time_of_tone_master_tests-implementation.adb @@ -281,7 +281,7 @@ package body Time_Of_Tone_Master_Tests.Implementation is Natural_Assert.Eq (T.Event_T_Recv_Sync_History.Get_Count, 1); Natural_Assert.Eq (T.Time_At_Tone_Enabled_History.Get_Count, 0); Natural_Assert.Eq (T.Invalid_Command_Received_History.Get_Count, 1); - Invalid_Command_Info_Assert.Eq (T.Invalid_Command_Received_History.Get (1), (Id => T.Commands.Get_Enable_Time_At_Tone_Id, Errant_Field_Number => Interfaces.Unsigned_32'Last, Errant_Field => (0, 0, 0, 0, 0, 0, 0, 1))); + Invalid_Command_Info_Assert.Eq (T.Invalid_Command_Received_History.Get (1), (Id => T.Commands.Get_Enable_Time_At_Tone_Id, Errant_Field_Number => Interfaces.Unsigned_32'Last, Errant_Field => [0, 0, 0, 0, 0, 0, 0, 1])); end Test_Invalid_Command; end Time_Of_Tone_Master_Tests.Implementation; diff --git a/src/components/zero_divider/test/zero_divider_tests-implementation.adb b/src/components/zero_divider/test/zero_divider_tests-implementation.adb index 4dce095a..5610d7f2 100644 --- a/src/components/zero_divider/test/zero_divider_tests-implementation.adb +++ b/src/components/zero_divider/test/zero_divider_tests-implementation.adb @@ -92,7 +92,7 @@ package body Zero_Divider_Tests.Implementation is -- Make sure some events were thrown: Natural_Assert.Eq (T.Event_T_Recv_Sync_History.Get_Count, 1); Natural_Assert.Eq (T.Invalid_Command_Received_History.Get_Count, 1); - Invalid_Command_Info_Assert.Eq (T.Invalid_Command_Received_History.Get (1), (Id => T.Commands.Get_Divide_By_Zero_Id, Errant_Field_Number => Interfaces.Unsigned_32'Last, Errant_Field => (0, 0, 0, 0, 0, 0, 0, 0))); + Invalid_Command_Info_Assert.Eq (T.Invalid_Command_Received_History.Get (1), (Id => T.Commands.Get_Divide_By_Zero_Id, Errant_Field_Number => Interfaces.Unsigned_32'Last, Errant_Field => [0, 0, 0, 0, 0, 0, 0, 0])); end Test_Invalid_Command; end Zero_Divider_Tests.Implementation; diff --git a/src/core/serializer/test/test.adb b/src/core/serializer/test/test.adb index a9a2d9c8..29f686d8 100644 --- a/src/core/serializer/test/test.adb +++ b/src/core/serializer/test/test.adb @@ -129,8 +129,8 @@ procedure Test is procedure Test_Errant_Serialization is package Myserializer is new Serializer (Test_Record.T); - Good_Bytes : constant Byte_Array := (0, 7, 0, 0, 0, 15, 63, 185, 153, 153, 153, 153, 153, 154); - Bad_Bytes : constant Byte_Array := (255, 7, 0, 0, 0, 15, 63, 185, 153, 153, 153, 153, 153, 154); + Good_Bytes : constant Byte_Array := [0, 7, 0, 0, 0, 15, 63, 185, 153, 153, 153, 153, 153, 154]; + Bad_Bytes : constant Byte_Array := [255, 7, 0, 0, 0, 15, 63, 185, 153, 153, 153, 153, 153, 154]; Rec : Test_Record.T; begin Rec := Myserializer.From_Byte_Array (Good_Bytes); @@ -153,9 +153,9 @@ procedure Test is procedure Test_Copy_By_Reference is package Myserializer is new Serializer (Command.T); - Buffer : constant Command_Types.Command_Arg_Buffer_Type := (0 => 56, 1 => 57, others => 19); + Buffer : constant Command_Types.Command_Arg_Buffer_Type := [0 => 56, 1 => 57, others => 19]; A_Command : constant Command.T := ((Source_Id => 0, Id => 15, Arg_Buffer_Length => 2), Arg_Buffer => Buffer); - A_Byte_Array : Myserializer.Byte_Array := (others => 50); + A_Byte_Array : Myserializer.Byte_Array := [others => 50]; procedure Some_Inner_Subprogram (Bytes : in Basic_Types.Byte_Array) is begin @@ -196,10 +196,10 @@ procedure Test is procedure Test_Variable_Serializer is package Myserializer is new Variable_Serializer (Command.T, Command.Serialized_Length, Command.Serialized_Length); Ignore_Stat : Serialization_Status; - Buffer : constant Command_Types.Command_Arg_Buffer_Type := (0 => 56, 1 => 57, others => 19); + Buffer : constant Command_Types.Command_Arg_Buffer_Type := [0 => 56, 1 => 57, others => 19]; A_Command : constant Command.T := ((Source_Id => 0, Id => 15, Arg_Buffer_Length => 2), Arg_Buffer => Buffer); Num_Bytes_Serialized : Natural; - Dest : Basic_Types.Byte_Array := (4 .. 0 => 0); + Dest : Basic_Types.Byte_Array := [4 .. 0 => 0]; begin Put_Line ("now"); Put_Line ("'First " & Integer'Image (Dest'First)); diff --git a/src/data_structures/circular_buffer/circular_buffer.adb b/src/data_structures/circular_buffer/circular_buffer.adb index 07184395..bbc62238 100644 --- a/src/data_structures/circular_buffer/circular_buffer.adb +++ b/src/data_structures/circular_buffer/circular_buffer.adb @@ -161,7 +161,7 @@ package body Circular_Buffer is end; end if; - return (Byte_Array_Pointer.Null_Pointer, Byte_Array_Pointer.Null_Pointer); + return [Byte_Array_Pointer.Null_Pointer, Byte_Array_Pointer.Null_Pointer]; end Dump_Newest; function Dump_Oldest (Self : in Base; Num_Bytes_To_Dump : in Natural) return Pointer_Dump is @@ -182,7 +182,7 @@ package body Circular_Buffer is end; end if; - return (Byte_Array_Pointer.Null_Pointer, Byte_Array_Pointer.Null_Pointer); + return [Byte_Array_Pointer.Null_Pointer, Byte_Array_Pointer.Null_Pointer]; end Dump_Oldest; function Dump_Memory (Self : in Base) return Pointer_Dump is diff --git a/src/data_structures/circular_buffer/test_circular/test.adb b/src/data_structures/circular_buffer/test_circular/test.adb index 14cdb4b4..d2f0fde6 100644 --- a/src/data_structures/circular_buffer/test_circular/test.adb +++ b/src/data_structures/circular_buffer/test_circular/test.adb @@ -8,7 +8,7 @@ with Byte_Array_Pointer; procedure Test is Heap_Buf : Circular_Buffer.Circular; Data_Buf : Circular_Buffer.Circular; - Data : aliased Byte_Array := (0 .. 9 => 0); + Data : aliased Byte_Array := [0 .. 9 => 0]; procedure Go (Buf : in out Circular_Buffer.Circular) is use Circular_Buffer; @@ -115,7 +115,7 @@ procedure Test is Byte_Array_Assert.Eq (Bytes_To_Compare (0 .. Bytes_Dumped - 1), Mem_Bytes, "Checking memory!", Filename, Line); end Super_Dump; - Bytes : Byte_Array (0 .. 9) := (others => 0); + Bytes : Byte_Array (0 .. 9) := [others => 0]; Num_Bytes : Natural := 0; begin Put_Line ("Check initial sizes."); @@ -124,81 +124,81 @@ procedure Test is Put_Line (""); Put_Line ("Small push, peek, and pop."); - Push_Assert.Eq (Buf.Push ((1, 2, 3)), Success); + Push_Assert.Eq (Buf.Push ([1, 2, 3]), Success); Check_Meta (3); Pop_Assert.Eq (Buf.Peek (Bytes (0 .. 2), Num_Bytes), Success); Natural_Assert.Eq (Num_Bytes, 3); - Byte_Array_Assert.Eq (Bytes, (1, 2, 3, 0, 0, 0, 0, 0, 0, 0)); - Super_Peek (Bytes, Bytes_To_Compare => (1, 2, 3)); + Byte_Array_Assert.Eq (Bytes, [1, 2, 3, 0, 0, 0, 0, 0, 0, 0]); + Super_Peek (Bytes, Bytes_To_Compare => [1, 2, 3]); Check_Meta (3); Pop_Assert.Eq (Buf.Pop (Bytes (3 .. 5), Num_Bytes), Success); Natural_Assert.Eq (Num_Bytes, 3); - Byte_Array_Assert.Eq (Bytes, (1, 2, 3, 1, 2, 3, 0, 0, 0, 0)); + Byte_Array_Assert.Eq (Bytes, [1, 2, 3, 1, 2, 3, 0, 0, 0, 0]); Check_Meta (0); Put_Line ("Passed."); Put_Line (""); Put_Line ("Peek and pop empty."); - Bytes := (others => 0); + Bytes := [others => 0]; Pop_Assert.Eq (Buf.Peek (Bytes (1 .. 0), Num_Bytes), Success); Natural_Assert.Eq (Num_Bytes, 0); Pop_Assert.Eq (Buf.Peek (Bytes (0 .. 0), Num_Bytes), Empty); Natural_Assert.Eq (Num_Bytes, 0); - Byte_Array_Assert.Eq (Bytes, (0, 0, 0, 0, 0, 0, 0, 0, 0, 0)); + Byte_Array_Assert.Eq (Bytes, [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]); Check_Meta (0); Pop_Assert.Eq (Buf.Pop (Bytes (4 .. 3), Num_Bytes), Success); Natural_Assert.Eq (Num_Bytes, 0); Pop_Assert.Eq (Buf.Pop (Bytes (3 .. 3), Num_Bytes), Empty); Natural_Assert.Eq (Num_Bytes, 0); - Byte_Array_Assert.Eq (Bytes, (0, 0, 0, 0, 0, 0, 0, 0, 0, 0)); + Byte_Array_Assert.Eq (Bytes, [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]); Check_Meta (0); Put_Line ("Passed."); Put_Line (""); Put_Line ("Push, peek, and pop zero length arrays."); Buf.Clear; - Data := (others => 0); + Data := [others => 0]; Push_Assert.Eq (Buf.Push (Bytes (1 .. 0)), Success); - Byte_Array_Assert.Eq (Data, (0, 0, 0, 0, 0, 0, 0, 0, 0, 0)); + Byte_Array_Assert.Eq (Data, [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]); Check_Meta (0); Pop_Assert.Eq (Buf.Peek (Bytes (1 .. 0), Num_Bytes), Success); Natural_Assert.Eq (Num_Bytes, 0); - Byte_Array_Assert.Eq (Bytes, (0, 0, 0, 0, 0, 0, 0, 0, 0, 0)); + Byte_Array_Assert.Eq (Bytes, [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]); Check_Meta (0); Pop_Assert.Eq (Buf.Pop (Bytes (3 .. 1), Num_Bytes), Success); Natural_Assert.Eq (Num_Bytes, 0); - Byte_Array_Assert.Eq (Bytes, (0, 0, 0, 0, 0, 0, 0, 0, 0, 0)); - Byte_Array_Assert.Eq (Data, (0, 0, 0, 0, 0, 0, 0, 0, 0, 0)); + Byte_Array_Assert.Eq (Bytes, [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]); + Byte_Array_Assert.Eq (Data, [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]); Check_Meta (0); Put_Line ("Passed."); Put_Line (""); Put_Line ("Push full."); Buf.Clear; - Push_Assert.Eq (Buf.Push ((1, 2, 3, 4, 5, 6, 7, 8, 9, 10)), Success); + Push_Assert.Eq (Buf.Push ([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]), Success); Check_Meta (10); Pop_Assert.Eq (Buf.Peek (Bytes (0 .. 9), Num_Bytes), Success); Natural_Assert.Eq (Num_Bytes, 10); - Byte_Array_Assert.Eq (Bytes, (1, 2, 3, 4, 5, 6, 7, 8, 9, 10)); - Super_Peek (Bytes, Bytes_To_Compare => (1, 2, 3, 4, 5, 6, 7, 8, 9, 10)); - Push_Assert.Eq (Buf.Push ((3 => 11)), Too_Full); + Byte_Array_Assert.Eq (Bytes, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]); + Super_Peek (Bytes, Bytes_To_Compare => [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]); + Push_Assert.Eq (Buf.Push ([3 => 11]), Too_Full); Check_Meta (10); -- zero length should be successful still Push_Assert.Eq (Buf.Push (Bytes (1 .. 0)), Success); Check_Meta (10); -- Check dump: - Super_Dump ((1, 2, 3, 4, 5, 6, 7, 8, 9, 10), (1, 2, 3, 4, 5, 6, 7, 8, 9, 10)); + Super_Dump ([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]); Put_Line ("Passed."); Put_Line (""); Put_Line ("Peek and pop too much."); - Bytes := (others => 0); + Bytes := [others => 0]; Pop_Assert.Eq (Buf.Peek (Bytes (1 .. 1), Num_Bytes), Success); Natural_Assert.Eq (Num_Bytes, 1); Check_Meta (10); Pop_Assert.Eq (Buf.Pop (Bytes (2 .. 2), Num_Bytes), Success); Natural_Assert.Eq (Num_Bytes, 1); - Byte_Array_Assert.Eq (Bytes, (0, 1, 1, 0, 0, 0, 0, 0, 0, 0)); + Byte_Array_Assert.Eq (Bytes, [0, 1, 1, 0, 0, 0, 0, 0, 0, 0]); Check_Meta (9); Pop_Assert.Eq (Buf.Peek (Bytes, Num_Bytes), Success); Natural_Assert.Eq (Num_Bytes, 9); @@ -207,7 +207,7 @@ procedure Test is Put_Line (""); Put_Line ("Push too much."); - Push_Assert.Eq (Buf.Push ((1, 2)), Too_Full); + Push_Assert.Eq (Buf.Push ([1, 2]), Too_Full); Check_Meta (9); Put_Line ("Passed."); Put_Line (""); @@ -215,40 +215,40 @@ procedure Test is Put_Line ("Test rollover."); Buf.Clear; Check_Meta (0); - Push_Assert.Eq (Buf.Push ((1, 2, 3, 4, 5, 6, 7)), Success); + Push_Assert.Eq (Buf.Push ([1, 2, 3, 4, 5, 6, 7]), Success); Check_Meta (7); Pop_Assert.Eq (Buf.Pop (Bytes (0 .. 2), Num_Bytes), Success); Natural_Assert.Eq (Num_Bytes, 3); - Byte_Array_Assert.Eq (Bytes (0 .. 2), (1, 2, 3)); + Byte_Array_Assert.Eq (Bytes (0 .. 2), [1, 2, 3]); Check_Meta (4); -- Push, and cause error: Put_Line (Basic_Types.Representation.Image (Data)); - Push_Assert.Eq (Buf.Push ((8, 9, 10, 11, 12, 13, 14)), Too_Full); + Push_Assert.Eq (Buf.Push ([8, 9, 10, 11, 12, 13, 14]), Too_Full); Check_Meta (4); -- Push some: - Push_Assert.Eq (Buf.Push ((8, 9)), Success); + Push_Assert.Eq (Buf.Push ([8, 9]), Success); Check_Meta (6); -- Cause roll over: - Push_Assert.Eq (Buf.Push ((10, 11, 12, 13, 14)), Too_Full); + Push_Assert.Eq (Buf.Push ([10, 11, 12, 13, 14]), Too_Full); Check_Meta (6); - Push_Assert.Eq (Buf.Push ((10, 11, 12)), Success); + Push_Assert.Eq (Buf.Push ([10, 11, 12]), Success); Check_Meta (9); - Bytes := (others => 0); + Bytes := [others => 0]; Pop_Assert.Eq (Buf.Peek (Bytes (0 .. 8), Num_Bytes), Success); Natural_Assert.Eq (Num_Bytes, 9); - Byte_Array_Assert.Eq (Bytes (0 .. 8), (4, 5, 6, 7, 8, 9, 10, 11, 12)); - Byte_Array_Assert.Eq (Bytes, (4, 5, 6, 7, 8, 9, 10, 11, 12, 0)); + Byte_Array_Assert.Eq (Bytes (0 .. 8), [4, 5, 6, 7, 8, 9, 10, 11, 12]); + Byte_Array_Assert.Eq (Bytes, [4, 5, 6, 7, 8, 9, 10, 11, 12, 0]); Put_Line (Basic_Types.Representation.Image (Data)); - Super_Peek (Bytes, Bytes_To_Compare => (4, 5, 6, 7, 8, 9, 10, 11, 12)); + Super_Peek (Bytes, Bytes_To_Compare => [4, 5, 6, 7, 8, 9, 10, 11, 12]); Check_Meta (9); -- Check dump: - Super_Dump ((4, 5, 6, 7, 8, 9, 10, 11, 12), (11, 12, 3, 4, 5, 6, 7, 8, 9, 10)); - Bytes := (others => 0); + Super_Dump ([4, 5, 6, 7, 8, 9, 10, 11, 12], [11, 12, 3, 4, 5, 6, 7, 8, 9, 10]); + Bytes := [others => 0]; Pop_Assert.Eq (Buf.Pop (Bytes (0 .. 8), Num_Bytes), Success); Natural_Assert.Eq (Num_Bytes, 9); - Byte_Array_Assert.Eq (Bytes, (4, 5, 6, 7, 8, 9, 10, 11, 12, 0)); + Byte_Array_Assert.Eq (Bytes, [4, 5, 6, 7, 8, 9, 10, 11, 12, 0]); Check_Meta (0); - Super_Dump (Bytes (1 .. 0), (11, 12, 3, 4, 5, 6, 7, 8, 9, 10)); + Super_Dump (Bytes (1 .. 0), [11, 12, 3, 4, 5, 6, 7, 8, 9, 10]); Put_Line (Basic_Types.Representation.Image (Data)); Put_Line ("Passed."); Put_Line (""); @@ -256,58 +256,58 @@ procedure Test is Put_Line ("Test multiple rollover."); Buf.Clear; Check_Meta (0); - Push_Assert.Eq (Buf.Push ((1, 2, 3, 4, 5, 6, 7, 8, 9)), Success); + Push_Assert.Eq (Buf.Push ([1, 2, 3, 4, 5, 6, 7, 8, 9]), Success); Check_Meta (9); Pop_Assert.Eq (Buf.Pop (Bytes (0 .. 7), Num_Bytes), Success); Natural_Assert.Eq (Num_Bytes, 8); - Byte_Array_Assert.Eq (Bytes (0 .. 7), (1, 2, 3, 4, 5, 6, 7, 8)); + Byte_Array_Assert.Eq (Bytes (0 .. 7), [1, 2, 3, 4, 5, 6, 7, 8]); Check_Meta (1); - Push_Assert.Eq (Buf.Push ((10, 11, 12, 13, 14, 15, 16, 17)), Success); + Push_Assert.Eq (Buf.Push ([10, 11, 12, 13, 14, 15, 16, 17]), Success); Check_Meta (9); Pop_Assert.Eq (Buf.Pop (Bytes (0 .. 7), Num_Bytes), Success); Natural_Assert.Eq (Num_Bytes, 8); - Byte_Array_Assert.Eq (Bytes (0 .. 7), (9, 10, 11, 12, 13, 14, 15, 16)); + Byte_Array_Assert.Eq (Bytes (0 .. 7), [9, 10, 11, 12, 13, 14, 15, 16]); Check_Meta (1); Put_Line (Basic_Types.Representation.Image (Data)); - Push_Assert.Eq (Buf.Push ((18, 19, 20, 21, 22, 23, 24, 25, 26, 27)), Too_Full); - Push_Assert.Eq (Buf.Push ((18, 19, 20, 21, 22, 23, 24)), Success); - Push_Assert.Eq (Buf.Push ((4 .. 0 => 0)), Success); - Push_Assert.Eq (Buf.Push ((4 .. 1 => 0)), Success); + Push_Assert.Eq (Buf.Push ([18, 19, 20, 21, 22, 23, 24, 25, 26, 27]), Too_Full); + Push_Assert.Eq (Buf.Push ([18, 19, 20, 21, 22, 23, 24]), Success); + Push_Assert.Eq (Buf.Push ([4 .. 0 => 0]), Success); + Push_Assert.Eq (Buf.Push ([4 .. 1 => 0]), Success); Check_Meta (8); Pop_Assert.Eq (Buf.Pop (Bytes (0 .. 6), Num_Bytes), Success); Natural_Assert.Eq (Num_Bytes, 7); - Byte_Array_Assert.Eq (Bytes (0 .. 6), (17, 18, 19, 20, 21, 22, 23)); + Byte_Array_Assert.Eq (Bytes (0 .. 6), [17, 18, 19, 20, 21, 22, 23]); Check_Meta (1); Put_Line (Basic_Types.Representation.Image (Data)); - Super_Dump ((0 => 24), (21, 22, 23, 24, 15, 16, 17, 18, 19, 20)); + Super_Dump ([0 => 24], [21, 22, 23, 24, 15, 16, 17, 18, 19, 20]); Put_Line ("Passed."); Put_Line (""); Put_Line ("Test multiple empty."); -- do complete zeroing of internal data: Buf.Clear; - Push_Assert.Eq (Buf.Push ((0, 0, 0, 0, 0, 0, 0, 0, 0, 0), Overwrite => True), Success); + Push_Assert.Eq (Buf.Push ([0, 0, 0, 0, 0, 0, 0, 0, 0, 0], Overwrite => True), Success); Pop_Assert.Eq (Buf.Pop (Bytes, Num_Bytes), Success); Natural_Assert.Eq (Num_Bytes, 10); -- start test: Check_Meta (0); - Push_Assert.Eq (Buf.Push ((1, 2, 3, 4, 5, 6, 7, 8, 9)), Success); + Push_Assert.Eq (Buf.Push ([1, 2, 3, 4, 5, 6, 7, 8, 9]), Success); Check_Meta (9); Pop_Assert.Eq (Buf.Pop (Bytes (0 .. 8), Num_Bytes), Success); Natural_Assert.Eq (Num_Bytes, 9); - Byte_Array_Assert.Eq (Bytes (0 .. 8), (1, 2, 3, 4, 5, 6, 7, 8, 9)); + Byte_Array_Assert.Eq (Bytes (0 .. 8), [1, 2, 3, 4, 5, 6, 7, 8, 9]); Check_Meta (0); - Push_Assert.Eq (Buf.Push ((10, 11, 12, 13, 14, 15, 16, 17)), Success); + Push_Assert.Eq (Buf.Push ([10, 11, 12, 13, 14, 15, 16, 17]), Success); Check_Meta (8); Pop_Assert.Eq (Buf.Pop (Bytes (0 .. 7), Num_Bytes), Success); Natural_Assert.Eq (Num_Bytes, 8); - Byte_Array_Assert.Eq (Bytes (0 .. 7), (10, 11, 12, 13, 14, 15, 16, 17)); + Byte_Array_Assert.Eq (Bytes (0 .. 7), [10, 11, 12, 13, 14, 15, 16, 17]); Check_Meta (0); - Push_Assert.Eq (Buf.Push ((18, 19, 20, 21, 22, 23, 24, 25)), Success); + Push_Assert.Eq (Buf.Push ([18, 19, 20, 21, 22, 23, 24, 25]), Success); Check_Meta (8); Pop_Assert.Eq (Buf.Pop (Bytes (0 .. 7), Num_Bytes), Success); Natural_Assert.Eq (Num_Bytes, 8); - Byte_Array_Assert.Eq (Bytes (0 .. 7), (18, 19, 20, 21, 22, 23, 24, 25)); + Byte_Array_Assert.Eq (Bytes (0 .. 7), [18, 19, 20, 21, 22, 23, 24, 25]); Check_Meta (0); Put_Line (Basic_Types.Representation.Image (Data)); Put_Line ("Passed."); @@ -318,13 +318,13 @@ procedure Test is Check_Meta (10); Pop_Assert.Eq (Buf.Pop (Bytes, Num_Bytes), Success); Natural_Assert.Eq (Num_Bytes, 10); - Byte_Array_Assert.Eq (Bytes, (18, 19, 20, 21, 22, 23, 24, 25, 9, 0)); + Byte_Array_Assert.Eq (Bytes, [18, 19, 20, 21, 22, 23, 24, 25, 9, 0]); Check_Meta (0); Buf.Make_Full (2); Check_Meta (10); Pop_Assert.Eq (Buf.Pop (Bytes, Num_Bytes), Success); Natural_Assert.Eq (Num_Bytes, 10); - Byte_Array_Assert.Eq (Bytes, (20, 21, 22, 23, 24, 25, 9, 0, 18, 19)); + Byte_Array_Assert.Eq (Bytes, [20, 21, 22, 23, 24, 25, 9, 0, 18, 19]); Check_Meta (0); Put_Line ("Passed."); Put_Line (""); @@ -332,131 +332,131 @@ procedure Test is Put_Line ("Test long overwrite."); Buf.Clear; Check_Meta (0); - Push_Assert.Eq (Buf.Push ((1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15), Overwrite => True), Too_Full); + Push_Assert.Eq (Buf.Push ([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15], Overwrite => True), Too_Full); Check_Meta (0); - Push_Assert.Eq (Buf.Push ((1, 2, 3, 4, 5, 6, 7, 8, 9), Overwrite => True), Success); - Push_Assert.Eq (Buf.Push ((10, 11, 12, 13, 14, 15), Overwrite => True), Success); + Push_Assert.Eq (Buf.Push ([1, 2, 3, 4, 5, 6, 7, 8, 9], Overwrite => True), Success); + Push_Assert.Eq (Buf.Push ([10, 11, 12, 13, 14, 15], Overwrite => True), Success); Put_Line (Basic_Types.Representation.Image (Data)); Check_Meta (10); Pop_Assert.Eq (Buf.Peek (Bytes, Num_Bytes), Success); Natural_Assert.Eq (Num_Bytes, 10); Pop_Assert.Eq (Buf.Peek (Bytes (0 .. 9), Num_Bytes), Success); Natural_Assert.Eq (Num_Bytes, 10); - Byte_Array_Assert.Eq (Bytes (0 .. 9), (6, 7, 8, 9, 10, 11, 12, 13, 14, 15)); + Byte_Array_Assert.Eq (Bytes (0 .. 9), [6, 7, 8, 9, 10, 11, 12, 13, 14, 15]); Pop_Assert.Eq (Buf.Peek (Bytes, Num_Bytes), Success); - Super_Peek (Bytes, Bytes_To_Compare => (6, 7, 8, 9, 10, 11, 12, 13, 14, 15)); + Super_Peek (Bytes, Bytes_To_Compare => [6, 7, 8, 9, 10, 11, 12, 13, 14, 15]); Natural_Assert.Eq (Num_Bytes, 10); Pop_Assert.Eq (Buf.Pop (Bytes, Num_Bytes), Success); Natural_Assert.Eq (Num_Bytes, 10); - Byte_Array_Assert.Eq (Bytes (0 .. 9), (6, 7, 8, 9, 10, 11, 12, 13, 14, 15)); + Byte_Array_Assert.Eq (Bytes (0 .. 9), [6, 7, 8, 9, 10, 11, 12, 13, 14, 15]); Check_Meta (0); Put_Line ("Passed."); Put_Line (""); Put_Line ("Test multiple small overwrites."); Buf.Clear; - Data := (others => 0); + Data := [others => 0]; Check_Meta (0); - Push_Assert.Eq (Buf.Push ((1, 2, 3, 4, 5), Overwrite => True), Success); + Push_Assert.Eq (Buf.Push ([1, 2, 3, 4, 5], Overwrite => True), Success); Put_Line (Basic_Types.Representation.Image (Data)); Check_Meta (5); - Push_Assert.Eq (Buf.Push ((6, 7), Overwrite => True), Success); + Push_Assert.Eq (Buf.Push ([6, 7], Overwrite => True), Success); Put_Line (Basic_Types.Representation.Image (Data)); Check_Meta (7); - Push_Assert.Eq (Buf.Push ((10, 11, 12, 13), Overwrite => False), Too_Full); - Push_Assert.Eq (Buf.Push ((10, 11, 12, 13), Overwrite => True), Success); + Push_Assert.Eq (Buf.Push ([10, 11, 12, 13], Overwrite => False), Too_Full); + Push_Assert.Eq (Buf.Push ([10, 11, 12, 13], Overwrite => True), Success); Put_Line (Basic_Types.Representation.Image (Data)); Check_Meta (10); Pop_Assert.Eq (Buf.Peek (Bytes (0 .. 9), Num_Bytes), Success); Natural_Assert.Eq (Num_Bytes, 10); Pop_Assert.Eq (Buf.Peek (Bytes (0 .. 6), Num_Bytes), Success); Natural_Assert.Eq (Num_Bytes, 7); - Byte_Array_Assert.Eq (Bytes (0 .. 6), (2, 3, 4, 5, 6, 7, 10)); + Byte_Array_Assert.Eq (Bytes (0 .. 6), [2, 3, 4, 5, 6, 7, 10]); Put_Line (Basic_Types.Representation.Image (Data)); - Push_Assert.Eq (Buf.Push ((15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 29, 29, 30, 31, 32), Overwrite => True), Too_Full); - Push_Assert.Eq (Buf.Push ((15, 16, 17, 18, 19, 20, 21), Overwrite => True), Success); + Push_Assert.Eq (Buf.Push ([15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 29, 29, 30, 31, 32], Overwrite => True), Too_Full); + Push_Assert.Eq (Buf.Push ([15, 16, 17, 18, 19, 20, 21], Overwrite => True), Success); Put_Line (Basic_Types.Representation.Image (Data)); Check_Meta (10); Pop_Assert.Eq (Buf.Peek (Bytes (0 .. 9), Num_Bytes), Success); Natural_Assert.Eq (Num_Bytes, 10); - Byte_Array_Assert.Eq (Bytes (0 .. 9), (11, 12, 13, 15, 16, 17, 18, 19, 20, 21)); - Push_Assert.Eq (Buf.Push ((21, 22, 23, 24, 25, 26, 27, 28), Overwrite => True), Success); + Byte_Array_Assert.Eq (Bytes (0 .. 9), [11, 12, 13, 15, 16, 17, 18, 19, 20, 21]); + Push_Assert.Eq (Buf.Push ([21, 22, 23, 24, 25, 26, 27, 28], Overwrite => True), Success); Put_Line (Basic_Types.Representation.Image (Data)); Check_Meta (10); Pop_Assert.Eq (Buf.Peek (Bytes (0 .. 9), Num_Bytes), Success); Natural_Assert.Eq (Num_Bytes, 10); - Byte_Array_Assert.Eq (Bytes (0 .. 9), (20, 21, 21, 22, 23, 24, 25, 26, 27, 28)); - Push_Assert.Eq (Buf.Push ((1 => 29), Overwrite => True), Success); + Byte_Array_Assert.Eq (Bytes (0 .. 9), [20, 21, 21, 22, 23, 24, 25, 26, 27, 28]); + Push_Assert.Eq (Buf.Push ([1 => 29], Overwrite => True), Success); Put_Line (Basic_Types.Representation.Image (Data)); - Push_Assert.Eq (Buf.Push ((5 => 30), Overwrite => True), Success); + Push_Assert.Eq (Buf.Push ([5 => 30], Overwrite => True), Success); Put_Line (Basic_Types.Representation.Image (Data)); Check_Meta (10); Pop_Assert.Eq (Buf.Pop (Bytes, Num_Bytes), Success); Natural_Assert.Eq (Num_Bytes, 10); - Byte_Array_Assert.Eq (Bytes, (21, 22, 23, 24, 25, 26, 27, 28, 29, 30)); + Byte_Array_Assert.Eq (Bytes, [21, 22, 23, 24, 25, 26, 27, 28, 29, 30]); Check_Meta (0); Put_Line ("Passed."); Put_Line (""); Put_Line ("Test more overwrites."); - Data := (others => 0); + Data := [others => 0]; Check_Meta (0); -- Lots of overwrites: - Push_Assert.Eq (Buf.Push ((1, 2, 3, 4, 5)), Success); + Push_Assert.Eq (Buf.Push ([1, 2, 3, 4, 5]), Success); Put_Line (Basic_Types.Representation.Image (Data)); Check_Meta (5); - Push_Assert.Eq (Buf.Push ((1, 2, 3, 4, 5, 6)), Too_Full); - Push_Assert.Eq (Buf.Push ((1, 2, 3, 4, 5, 6), Overwrite => True), Success); + Push_Assert.Eq (Buf.Push ([1, 2, 3, 4, 5, 6]), Too_Full); + Push_Assert.Eq (Buf.Push ([1, 2, 3, 4, 5, 6], Overwrite => True), Success); Put_Line (Basic_Types.Representation.Image (Data)); Check_Meta (10); - Push_Assert.Eq (Buf.Push ((1, 2, 3, 4, 5, 6, 7)), Too_Full); - Push_Assert.Eq (Buf.Push ((1, 2, 3, 4, 5, 6, 7), Overwrite => True), Success); + Push_Assert.Eq (Buf.Push ([1, 2, 3, 4, 5, 6, 7]), Too_Full); + Push_Assert.Eq (Buf.Push ([1, 2, 3, 4, 5, 6, 7], Overwrite => True), Success); Put_Line (Basic_Types.Representation.Image (Data)); Check_Meta (10); - Push_Assert.Eq (Buf.Push ((1, 2, 3, 4, 5, 6, 7, 8)), Too_Full); - Push_Assert.Eq (Buf.Push ((1, 2, 3, 4, 5, 6, 7, 8), Overwrite => True), Success); + Push_Assert.Eq (Buf.Push ([1, 2, 3, 4, 5, 6, 7, 8]), Too_Full); + Push_Assert.Eq (Buf.Push ([1, 2, 3, 4, 5, 6, 7, 8], Overwrite => True), Success); Put_Line (Basic_Types.Representation.Image (Data)); Check_Meta (10); - Push_Assert.Eq (Buf.Push ((9, 9, 9, 9)), Too_Full); - Push_Assert.Eq (Buf.Push ((9, 9, 9, 9), Overwrite => True), Success); + Push_Assert.Eq (Buf.Push ([9, 9, 9, 9]), Too_Full); + Push_Assert.Eq (Buf.Push ([9, 9, 9, 9], Overwrite => True), Success); Put_Line (Basic_Types.Representation.Image (Data)); Check_Meta (10); -- Lots of wrapping peeks with offsets. Pop_Assert.Eq (Buf.Peek (Bytes, Num_Bytes), Success); Natural_Assert.Eq (Num_Bytes, 10); - Super_Peek (Bytes, Bytes_To_Compare => (3, 4, 5, 6, 7, 8, 9, 9, 9, 9)); + Super_Peek (Bytes, Bytes_To_Compare => [3, 4, 5, 6, 7, 8, 9, 9, 9, 9]); -- Dealloc some from beginning. Pop_Assert.Eq (Buf.Pop (Bytes (0 .. 1), Num_Bytes), Success); Natural_Assert.Eq (Num_Bytes, 2); - Byte_Array_Assert.Eq (Bytes (0 .. 1), (3, 4)); + Byte_Array_Assert.Eq (Bytes (0 .. 1), [3, 4]); Check_Meta (8); -- Dealloc wrap. Pop_Assert.Eq (Buf.Pop (Bytes (0 .. 4), Num_Bytes), Success); Natural_Assert.Eq (Num_Bytes, 5); - Byte_Array_Assert.Eq (Bytes (0 .. 4), (5, 6, 7, 8, 9)); + Byte_Array_Assert.Eq (Bytes (0 .. 4), [5, 6, 7, 8, 9]); Check_Meta (3); -- Push overwrite - Push_Assert.Eq (Buf.Push ((1, 2, 3, 4, 5, 6, 7, 8)), Too_Full); - Push_Assert.Eq (Buf.Push ((1, 2, 3, 4, 5, 6, 7, 8), Overwrite => True), Success); + Push_Assert.Eq (Buf.Push ([1, 2, 3, 4, 5, 6, 7, 8]), Too_Full); + Push_Assert.Eq (Buf.Push ([1, 2, 3, 4, 5, 6, 7, 8], Overwrite => True), Success); Put_Line (Basic_Types.Representation.Image (Data)); Check_Meta (10); -- Dealloc some from beginning. Pop_Assert.Eq (Buf.Pop (Bytes (0 .. 4), Num_Bytes), Success); Natural_Assert.Eq (Num_Bytes, 5); - Byte_Array_Assert.Eq (Bytes (0 .. 4), (9, 9, 1, 2, 3)); + Byte_Array_Assert.Eq (Bytes (0 .. 4), [9, 9, 1, 2, 3]); Check_Meta (5); - Push_Assert.Eq (Buf.Push ((66, 66, 66, 66)), Success); + Push_Assert.Eq (Buf.Push ([66, 66, 66, 66]), Success); Put_Line (Basic_Types.Representation.Image (Data)); Check_Meta (9); - Super_Peek (Bytes, Bytes_To_Compare => (4, 5, 6, 7, 8, 66, 66, 66, 66)); - Push_Assert.Eq (Buf.Push ((77, 77)), Too_Full); - Push_Assert.Eq (Buf.Push ((77, 77, 77), Overwrite => True), Success); - Push_Assert.Eq (Buf.Push ((4 .. 0 => 0), Overwrite => True), Success); - Push_Assert.Eq (Buf.Push ((4 .. 0 => 0), Overwrite => False), Success); + Super_Peek (Bytes, Bytes_To_Compare => [4, 5, 6, 7, 8, 66, 66, 66, 66]); + Push_Assert.Eq (Buf.Push ([77, 77]), Too_Full); + Push_Assert.Eq (Buf.Push ([77, 77, 77], Overwrite => True), Success); + Push_Assert.Eq (Buf.Push ([4 .. 0 => 0], Overwrite => True), Success); + Push_Assert.Eq (Buf.Push ([4 .. 0 => 0], Overwrite => False), Success); Put_Line (Basic_Types.Representation.Image (Data)); Check_Meta (10); - Super_Peek (Bytes, Bytes_To_Compare => (6, 7, 8, 66, 66, 66, 66, 77, 77, 77)); - Super_Dump ((6, 7, 8, 66, 66, 66, 66, 77, 77, 77), (66, 66, 77, 77, 77, 6, 7, 8, 66, 66)); + Super_Peek (Bytes, Bytes_To_Compare => [6, 7, 8, 66, 66, 66, 66, 77, 77, 77]); + Super_Dump ([6, 7, 8, 66, 66, 66, 66, 77, 77, 77], [66, 66, 77, 77, 77, 6, 7, 8, 66, 66]); Put_Line ("Passed."); Put_Line (""); diff --git a/src/data_structures/circular_buffer/test_labeled_queue/test.adb b/src/data_structures/circular_buffer/test_labeled_queue/test.adb index 95cf4799..06f6de85 100644 --- a/src/data_structures/circular_buffer/test_labeled_queue/test.adb +++ b/src/data_structures/circular_buffer/test_labeled_queue/test.adb @@ -10,13 +10,13 @@ procedure Test is package Labeled_Queue_Package is new Circular_Buffer.Labeled_Queue (Static.T); Heap_Queue : Labeled_Queue_Package.Instance; Data_Queue : Labeled_Queue_Package.Instance; - Data : aliased Byte_Array := (0 .. 29 => 0); + Data : aliased Byte_Array := [0 .. 29 => 0]; procedure Go (Queue : in out Labeled_Queue_Package.Instance) is use Circular_Buffer; package Push_Assert is new Smart_Assert.Basic (Circular_Buffer.Push_Status, Circular_Buffer.Push_Status'Image); package Pop_Assert is new Smart_Assert.Basic (Circular_Buffer.Pop_Status, Circular_Buffer.Pop_Status'Image); - Bytes : Byte_Array (0 .. 29) := (others => 0); + Bytes : Byte_Array (0 .. 29) := [others => 0]; Len : Natural; Max_Count : Natural := 0; @@ -42,7 +42,7 @@ procedure Test is Put_Line (""); Put_Line ("Small push, peek, and pop."); - Push_Assert.Eq (Queue.Push ((4, 5, 6), (1, 2, 3)), Success); + Push_Assert.Eq (Queue.Push ((4, 5, 6), [1, 2, 3]), Success); Put_Line (Static.Representation.Image (Label)); Put_Line (Basic_Types.Representation.Image (Data)); Check_Meta (1); @@ -56,22 +56,22 @@ procedure Test is Pop_Assert.Eq (Queue.Peek (Label, Bytes, Length => Len), Success); Static_Assert.Eq (Label, (4, 5, 6)); Natural_Assert.Eq (Len, 3); - Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), (1, 2, 3)); + Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), [1, 2, 3]); Check_Meta (1); Put_Line ("Passed."); Put_Line (""); Put_Line ("Peek and pop empty."); Queue.Clear; - Bytes := (others => 0); + Bytes := [others => 0]; Pop_Assert.Eq (Queue.Peek (Label, Bytes (1 .. 0), Length => Len), Empty); Natural_Assert.Eq (Len, 0); Pop_Assert.Eq (Queue.Peek (Label, Bytes (0 .. 0), Length => Len), Empty); Natural_Assert.Eq (Len, 0); - Byte_Array_Assert.Eq (Bytes, (0 .. 29 => 0)); + Byte_Array_Assert.Eq (Bytes, [0 .. 29 => 0]); Check_Meta (0); Pop_Assert.Eq (Queue.Pop (Label, Bytes (3 .. 3)), Empty); - Byte_Array_Assert.Eq (Bytes, (0 .. 29 => 0)); + Byte_Array_Assert.Eq (Bytes, [0 .. 29 => 0]); Check_Meta (0); Pop_Assert.Eq (Queue.Pop, Empty); Put_Line ("Passed."); @@ -79,7 +79,7 @@ procedure Test is Put_Line ("Push, peek, and pop zero length arrays."); Queue.Clear; - Data := (others => 0); + Data := [others => 0]; Push_Assert.Eq (Queue.Push ((7, 9, 8), Bytes (1 .. 0)), Success); Check_Meta (1); Pop_Assert.Eq (Queue.Peek_Label (Label), Success); @@ -91,65 +91,65 @@ procedure Test is Pop_Assert.Eq (Queue.Peek (Label, Bytes (1 .. 0), Length => Len), Success); Static_Assert.Eq (Label, (7, 9, 8)); Natural_Assert.Eq (Len, 0); - Byte_Array_Assert.Eq (Bytes, (0 .. 29 => 0)); + Byte_Array_Assert.Eq (Bytes, [0 .. 29 => 0]); Check_Meta (1); Label := (0, 0, 0); Pop_Assert.Eq (Queue.Pop (Label, Bytes (3 .. 1), Length => Len), Success); Static_Assert.Eq (Label, (7, 9, 8)); Natural_Assert.Eq (Len, 0); - Byte_Array_Assert.Eq (Bytes, (0 .. 29 => 0)); + Byte_Array_Assert.Eq (Bytes, [0 .. 29 => 0]); Check_Meta (0); Put_Line ("Passed."); Put_Line (""); Put_Line ("Push full."); Queue.Clear; - Push_Assert.Eq (Queue.Push ((10, 10, 9), (1, 2, 3, 4, 5, 6, 7, 8, 9, 10)), Success); + Push_Assert.Eq (Queue.Push ((10, 10, 9), [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]), Success); Check_Meta (1); Pop_Assert.Eq (Queue.Peek (Label, Bytes (0 .. 9)), Success); - Byte_Array_Assert.Eq (Bytes (0 .. 9), (1, 2, 3, 4, 5, 6, 7, 8, 9, 10)); + Byte_Array_Assert.Eq (Bytes (0 .. 9), [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]); Put_Line ("Num_Bytes_Used: " & Natural'Image (Queue.Num_Bytes_Used)); Natural_Assert.Eq (Queue.Num_Bytes_Used, 18); - Push_Assert.Eq (Queue.Push ((10, 10, 8), (3 .. 6 => 11)), Success); + Push_Assert.Eq (Queue.Push ((10, 10, 8), [3 .. 6 => 11]), Success); Check_Meta (2); Put_Line ("Num_Bytes_Used: " & Natural'Image (Queue.Num_Bytes_Used)); Natural_Assert.Eq (Queue.Num_Bytes_Used, 30); - Push_Assert.Eq (Queue.Push ((10, 10, 7), (0 .. 0 => 5)), Too_Full); + Push_Assert.Eq (Queue.Push ((10, 10, 7), [0 .. 0 => 5]), Too_Full); Put_Line ("Passed."); Put_Line (""); Put_Line ("Peek and pop too much."); - Bytes := (others => 0); + Bytes := [others => 0]; Label := (0, 0, 0); Pop_Assert.Eq (Queue.Peek (Label, Bytes (0 .. 4), Length => Len), Success); Static_Assert.Eq (Label, (10, 10, 9)); Natural_Assert.Eq (Len, 5); - Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), (1, 2, 3, 4, 5)); + Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), [1, 2, 3, 4, 5]); Check_Meta (2); Label := (0, 0, 0); Pop_Assert.Eq (Queue.Peek (Label, Bytes, Length => Len), Success); Static_Assert.Eq (Label, (10, 10, 9)); Static_Assert.Eq (Label, (10, 10, 9)); Natural_Assert.Eq (Len, 10); - Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), (1, 2, 3, 4, 5, 6, 7, 8, 9, 10)); + Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]); Check_Meta (2); Label := (0, 0, 0); Pop_Assert.Eq (Queue.Peek (Label, Bytes, Length => Len, Offset => 2), Success); Static_Assert.Eq (Label, (10, 10, 9)); Natural_Assert.Eq (Len, 8); - Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), (3, 4, 5, 6, 7, 8, 9, 10)); + Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), [3, 4, 5, 6, 7, 8, 9, 10]); Check_Meta (2); Label := (0, 0, 0); Pop_Assert.Eq (Queue.Peek (Label, Bytes (0 .. 1), Length => Len, Offset => 2), Success); Static_Assert.Eq (Label, (10, 10, 9)); Natural_Assert.Eq (Len, 2); - Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), (3, 4)); + Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), [3, 4]); Check_Meta (2); Label := (0, 0, 0); Pop_Assert.Eq (Queue.Peek (Label, Bytes (0 .. 1), Length => Len, Offset => 9), Success); Static_Assert.Eq (Label, (10, 10, 9)); Natural_Assert.Eq (Len, 1); - Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), (1 => 10)); + Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), [1 => 10]); Check_Meta (2); Label := (0, 0, 0); Pop_Assert.Eq (Queue.Peek (Label, Bytes (0 .. 1), Length => Len, Offset => 10), Success); @@ -175,7 +175,7 @@ procedure Test is Pop_Assert.Eq (Queue.Pop (Label, Bytes (0 .. 6), Length => Len), Success); Static_Assert.Eq (Label, (10, 10, 9)); Natural_Assert.Eq (Len, 7); - Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), (1, 2, 3, 4, 5, 6, 7)); + Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), [1, 2, 3, 4, 5, 6, 7]); Check_Meta (1); Put_Line ("Num_Bytes_Used: " & Natural'Image (Queue.Num_Bytes_Used)); Natural_Assert.Eq (Queue.Num_Bytes_Used, 12); @@ -191,19 +191,19 @@ procedure Test is Check_Meta (0); Pop_Assert.Eq (Queue.Pop (Label, Bytes), Empty); Check_Meta (0); - Push_Assert.Eq (Queue.Push ((10, 10, 2), (1, 2, 3, 4, 5, 6, 7, 8, 9, 10)), Success); + Push_Assert.Eq (Queue.Push ((10, 10, 2), [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]), Success); Check_Meta (1); Label := (0, 0, 0); Pop_Assert.Eq (Queue.Pop (Label, Bytes, Length => Len, Offset => 4), Success); Static_Assert.Eq (Label, (10, 10, 2)); Natural_Assert.Eq (Len, 6); - Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), (5, 6, 7, 8, 9, 10)); + Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), [5, 6, 7, 8, 9, 10]); Check_Meta (0); Put_Line ("Passed."); Put_Line (""); Put_Line ("Push too much."); - Push_Assert.Eq (Queue.Push ((10, 10, 10), (0 .. 30 => 5)), Too_Full); + Push_Assert.Eq (Queue.Push ((10, 10, 10), [0 .. 30 => 5]), Too_Full); Check_Meta (0); Put_Line ("Passed."); Put_Line (""); @@ -211,7 +211,7 @@ procedure Test is Put_Line ("Test rollover."); Queue.Clear; Check_Meta (0); - Push_Assert.Eq (Queue.Push ((8, 8, 7), (0 .. 9 => 255, 10 .. 21 => 254)), Success); + Push_Assert.Eq (Queue.Push ((8, 8, 7), [0 .. 9 => 255, 10 .. 21 => 254]), Success); Put_Line ("Num_Bytes_Used: " & Natural'Image (Queue.Num_Bytes_Used)); Natural_Assert.Eq (Queue.Num_Bytes_Used, 30); Put_Line (Basic_Types.Representation.Image (Data)); @@ -221,19 +221,19 @@ procedure Test is Static_Assert.Eq (Label, (8, 8, 7)); Put_Line ("Num_Bytes_Used: " & Natural'Image (Queue.Num_Bytes_Used)); Natural_Assert.Eq (Queue.Num_Bytes_Used, 0); - Byte_Array_Assert.Eq (Bytes (0 .. 8), (0 .. 8 => 255)); + Byte_Array_Assert.Eq (Bytes (0 .. 8), [0 .. 8 => 255]); Check_Meta (0); - Push_Assert.Eq (Queue.Push ((7, 7, 6), (0 .. 9 => 10)), Success); + Push_Assert.Eq (Queue.Push ((7, 7, 6), [0 .. 9 => 10]), Success); Put_Line ("Num_Bytes_Used: " & Natural'Image (Queue.Num_Bytes_Used)); Natural_Assert.Eq (Queue.Num_Bytes_Used, 18); Put_Line (Basic_Types.Representation.Image (Data)); Check_Meta (1); - Push_Assert.Eq (Queue.Push ((6, 6, 5), (0 .. 2 => 11)), Success); + Push_Assert.Eq (Queue.Push ((6, 6, 5), [0 .. 2 => 11]), Success); Put_Line ("Num_Bytes_Used: " & Natural'Image (Queue.Num_Bytes_Used)); Natural_Assert.Eq (Queue.Num_Bytes_Used, 29); Put_Line (Basic_Types.Representation.Image (Data)); Check_Meta (2); - Push_Assert.Eq (Queue.Push ((5, 5, 4), (0 .. 9 => 12)), Too_Full); + Push_Assert.Eq (Queue.Push ((5, 5, 4), [0 .. 9 => 12]), Too_Full); Natural_Assert.Eq (Queue.Num_Bytes_Used, 29); Check_Meta (2); Label := (0, 0, 0); @@ -241,15 +241,15 @@ procedure Test is Static_Assert.Eq (Label, (7, 7, 6)); Put_Line ("Num_Bytes_Used: " & Natural'Image (Queue.Num_Bytes_Used)); Natural_Assert.Eq (Queue.Num_Bytes_Used, 11); - Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), (0 .. Len - 1 => 10)); + Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), [0 .. Len - 1 => 10]); Check_Meta (1); -- Push, and cause rollover: - Push_Assert.Eq (Queue.Push ((4, 4, 3), (0 .. 7 => 12)), Success); + Push_Assert.Eq (Queue.Push ((4, 4, 3), [0 .. 7 => 12]), Success); Put_Line ("Num_Bytes_Used: " & Natural'Image (Queue.Num_Bytes_Used)); Natural_Assert.Eq (Queue.Num_Bytes_Used, 27); Put_Line (Basic_Types.Representation.Image (Data)); Check_Meta (2); - Push_Assert.Eq (Queue.Push ((3, 3, 3), (0 .. 0 => 12)), Too_Full); + Push_Assert.Eq (Queue.Push ((3, 3, 3), [0 .. 0 => 12]), Too_Full); Check_Meta (2); -- Pop and check: Pop_Assert.Eq (Queue.Peek_Label (Label), Success); @@ -266,7 +266,7 @@ procedure Test is Static_Assert.Eq (Label, (4, 4, 3)); Put_Line ("Num_Bytes_Used: " & Natural'Image (Queue.Num_Bytes_Used)); Natural_Assert.Eq (Queue.Num_Bytes_Used, 0); - Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), (0 .. Len - 1 => 12)); + Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), [0 .. Len - 1 => 12]); Check_Meta (0); Put_Line ("Passed."); Put_Line (""); diff --git a/src/data_structures/circular_buffer/test_queue/test.adb b/src/data_structures/circular_buffer/test_queue/test.adb index 9a5bc0ca..08dfc094 100644 --- a/src/data_structures/circular_buffer/test_queue/test.adb +++ b/src/data_structures/circular_buffer/test_queue/test.adb @@ -6,14 +6,14 @@ with Smart_Assert; procedure Test is Data_Queue : Circular_Buffer.Queue; - Data : aliased Byte_Array := (0 .. 29 => 0); + Data : aliased Byte_Array := [0 .. 29 => 0]; Ignore : Natural; procedure Go (Queue : in out Circular_Buffer.Queue) is use Circular_Buffer; package Push_Assert is new Smart_Assert.Basic (Circular_Buffer.Push_Status, Circular_Buffer.Push_Status'Image); package Pop_Assert is new Smart_Assert.Basic (Circular_Buffer.Pop_Status, Circular_Buffer.Pop_Status'Image); - Bytes : Byte_Array (0 .. 29) := (others => 0); + Bytes : Byte_Array (0 .. 29) := [others => 0]; Len : Natural; Max_Count : Natural := 0; @@ -37,7 +37,7 @@ procedure Test is Put_Line (""); Put_Line ("Small push, peek, and pop."); - Push_Assert.Eq (Queue.Push ((1, 2, 3)), Success); + Push_Assert.Eq (Queue.Push ([1, 2, 3]), Success); Put_Line (Basic_Types.Representation.Image (Data)); Check_Meta (1); Pop_Assert.Eq (Queue.Peek_Length (Len), Success); @@ -46,22 +46,22 @@ procedure Test is Len := 0; Pop_Assert.Eq (Queue.Peek (Bytes, Length => Len), Success); Natural_Assert.Eq (Len, 3); - Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), (1, 2, 3)); + Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), [1, 2, 3]); Check_Meta (1); Put_Line ("Passed."); Put_Line (""); Put_Line ("Peek and pop empty."); Queue.Clear; - Bytes := (others => 0); + Bytes := [others => 0]; Pop_Assert.Eq (Queue.Peek (Bytes (1 .. 0), Length => Len), Empty); Natural_Assert.Eq (Len, 0); Pop_Assert.Eq (Queue.Peek (Bytes (0 .. 0), Length => Len), Empty); Natural_Assert.Eq (Len, 0); - Byte_Array_Assert.Eq (Bytes, (0 .. 29 => 0)); + Byte_Array_Assert.Eq (Bytes, [0 .. 29 => 0]); Check_Meta (0); Pop_Assert.Eq (Queue.Pop (Bytes (3 .. 3), Ignore), Empty); - Byte_Array_Assert.Eq (Bytes, (0 .. 29 => 0)); + Byte_Array_Assert.Eq (Bytes, [0 .. 29 => 0]); Check_Meta (0); Pop_Assert.Eq (Queue.Pop, Empty); Put_Line ("Passed."); @@ -69,38 +69,38 @@ procedure Test is Put_Line ("Push, peek, and pop zero length arrays."); Queue.Clear; - Data := (others => 0); + Data := [others => 0]; Push_Assert.Eq (Queue.Push (Bytes (1 .. 0)), Success); - Byte_Array_Assert.Eq (Data, (0 .. 29 => 0)); + Byte_Array_Assert.Eq (Data, [0 .. 29 => 0]); Check_Meta (1); Pop_Assert.Eq (Queue.Peek_Length (Len), Success); Natural_Assert.Eq (Len, 0); Check_Meta (1); Pop_Assert.Eq (Queue.Peek (Bytes (1 .. 0), Length => Len), Success); Natural_Assert.Eq (Len, 0); - Byte_Array_Assert.Eq (Bytes, (0 .. 29 => 0)); + Byte_Array_Assert.Eq (Bytes, [0 .. 29 => 0]); Check_Meta (1); Pop_Assert.Eq (Queue.Pop (Bytes (3 .. 1), Length => Len), Success); Natural_Assert.Eq (Len, 0); - Byte_Array_Assert.Eq (Bytes, (0 .. 29 => 0)); - Byte_Array_Assert.Eq (Data, (0 .. 29 => 0)); + Byte_Array_Assert.Eq (Bytes, [0 .. 29 => 0]); + Byte_Array_Assert.Eq (Data, [0 .. 29 => 0]); Check_Meta (0); Put_Line ("Passed."); Put_Line (""); Put_Line ("Push full."); Queue.Clear; - Push_Assert.Eq (Queue.Push ((1, 2, 3, 4, 5, 6, 7, 8, 9, 10)), Success); + Push_Assert.Eq (Queue.Push ([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]), Success); Check_Meta (1); Pop_Assert.Eq (Queue.Peek (Bytes (0 .. 9), Ignore), Success); - Byte_Array_Assert.Eq (Bytes (0 .. 9), (1, 2, 3, 4, 5, 6, 7, 8, 9, 10)); + Byte_Array_Assert.Eq (Bytes (0 .. 9), [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]); Put_Line ("Num_Bytes_Used: " & Natural'Image (Queue.Num_Bytes_Used)); Natural_Assert.Eq (Queue.Num_Bytes_Used, 14); - Push_Assert.Eq (Queue.Push ((3 .. 10 => 11)), Success); + Push_Assert.Eq (Queue.Push ([3 .. 10 => 11]), Success); Check_Meta (2); Put_Line ("Num_Bytes_Used: " & Natural'Image (Queue.Num_Bytes_Used)); Natural_Assert.Eq (Queue.Num_Bytes_Used, 26); - Push_Assert.Eq (Queue.Push ((0 .. 0 => 5)), Too_Full); + Push_Assert.Eq (Queue.Push ([0 .. 0 => 5]), Too_Full); Push_Assert.Eq (Queue.Push (Bytes (1 .. 0)), Success); Check_Meta (3); Put_Line ("Num_Bytes_Used: " & Natural'Image (Queue.Num_Bytes_Used)); @@ -111,26 +111,26 @@ procedure Test is Put_Line (""); Put_Line ("Peek and pop too much."); - Bytes := (others => 0); + Bytes := [others => 0]; Pop_Assert.Eq (Queue.Peek (Bytes (0 .. 4), Length => Len), Success); Natural_Assert.Eq (Len, 5); - Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), (1, 2, 3, 4, 5)); + Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), [1, 2, 3, 4, 5]); Check_Meta (3); Pop_Assert.Eq (Queue.Peek (Bytes, Length => Len), Success); Natural_Assert.Eq (Len, 10); - Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), (1, 2, 3, 4, 5, 6, 7, 8, 9, 10)); + Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]); Check_Meta (3); Pop_Assert.Eq (Queue.Peek (Bytes, Length => Len, Offset => 2), Success); Natural_Assert.Eq (Len, 8); - Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), (3, 4, 5, 6, 7, 8, 9, 10)); + Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), [3, 4, 5, 6, 7, 8, 9, 10]); Check_Meta (3); Pop_Assert.Eq (Queue.Peek (Bytes (0 .. 1), Length => Len, Offset => 2), Success); Natural_Assert.Eq (Len, 2); - Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), (3, 4)); + Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), [3, 4]); Check_Meta (3); Pop_Assert.Eq (Queue.Peek (Bytes (0 .. 1), Length => Len, Offset => 9), Success); Natural_Assert.Eq (Len, 1); - Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), (1 => 10)); + Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), [1 => 10]); Check_Meta (3); Pop_Assert.Eq (Queue.Peek (Bytes (0 .. 1), Length => Len, Offset => 10), Success); Natural_Assert.Eq (Len, 0); @@ -146,7 +146,7 @@ procedure Test is Check_Meta (3); Pop_Assert.Eq (Queue.Pop (Bytes (0 .. 6), Length => Len), Success); Natural_Assert.Eq (Len, 7); - Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), (1, 2, 3, 4, 5, 6, 7)); + Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), [1, 2, 3, 4, 5, 6, 7]); Check_Meta (2); Put_Line ("Num_Bytes_Used: " & Natural'Image (Queue.Num_Bytes_Used)); Natural_Assert.Eq (Queue.Num_Bytes_Used, 16); @@ -155,7 +155,7 @@ procedure Test is Natural_Assert.Eq (Len, 8); Pop_Assert.Eq (Queue.Pop (Bytes (0 .. 3), Length => Len, Offset => 5), Success); Natural_Assert.Eq (Len, 3); - Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), (11, 11, 11)); + Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), [11, 11, 11]); Check_Meta (1); Put_Line ("Num_Bytes_Used: " & Natural'Image (Queue.Num_Bytes_Used)); Natural_Assert.Eq (Queue.Num_Bytes_Used, 4); @@ -172,7 +172,7 @@ procedure Test is Put_Line (""); Put_Line ("Push too much."); - Push_Assert.Eq (Queue.Push ((0 .. 30 => 5)), Too_Full); + Push_Assert.Eq (Queue.Push ([0 .. 30 => 5]), Too_Full); Check_Meta (0); Put_Line ("Passed."); Put_Line (""); @@ -180,7 +180,7 @@ procedure Test is Put_Line ("Test rollover."); Queue.Clear; Check_Meta (0); - Push_Assert.Eq (Queue.Push ((0 .. 9 => 255, 10 .. 21 => 254)), Success); + Push_Assert.Eq (Queue.Push ([0 .. 9 => 255, 10 .. 21 => 254]), Success); Put_Line ("Num_Bytes_Used: " & Natural'Image (Queue.Num_Bytes_Used)); Natural_Assert.Eq (Queue.Num_Bytes_Used, 26); Put_Line (Basic_Types.Representation.Image (Data)); @@ -188,33 +188,33 @@ procedure Test is Pop_Assert.Eq (Queue.Pop (Bytes (0 .. 8), Ignore), Success); Put_Line ("Num_Bytes_Used: " & Natural'Image (Queue.Num_Bytes_Used)); Natural_Assert.Eq (Queue.Num_Bytes_Used, 0); - Byte_Array_Assert.Eq (Bytes (0 .. 8), (0 .. 8 => 255)); + Byte_Array_Assert.Eq (Bytes (0 .. 8), [0 .. 8 => 255]); Check_Meta (0); - Push_Assert.Eq (Queue.Push ((0 .. 9 => 10)), Success); + Push_Assert.Eq (Queue.Push ([0 .. 9 => 10]), Success); Put_Line ("Num_Bytes_Used: " & Natural'Image (Queue.Num_Bytes_Used)); Natural_Assert.Eq (Queue.Num_Bytes_Used, 14); Put_Line (Basic_Types.Representation.Image (Data)); Check_Meta (1); - Push_Assert.Eq (Queue.Push ((0 .. 9 => 11)), Success); + Push_Assert.Eq (Queue.Push ([0 .. 9 => 11]), Success); Put_Line ("Num_Bytes_Used: " & Natural'Image (Queue.Num_Bytes_Used)); Natural_Assert.Eq (Queue.Num_Bytes_Used, 28); Put_Line (Basic_Types.Representation.Image (Data)); Check_Meta (2); - Push_Assert.Eq (Queue.Push ((0 .. 9 => 12)), Too_Full); + Push_Assert.Eq (Queue.Push ([0 .. 9 => 12]), Too_Full); Natural_Assert.Eq (Queue.Num_Bytes_Used, 28); Check_Meta (2); Pop_Assert.Eq (Queue.Pop (Bytes, Length => Len), Success); Put_Line ("Num_Bytes_Used: " & Natural'Image (Queue.Num_Bytes_Used)); Natural_Assert.Eq (Queue.Num_Bytes_Used, 14); - Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), (0 .. Len - 1 => 10)); + Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), [0 .. Len - 1 => 10]); Check_Meta (1); -- Push, and cause rollover: - Push_Assert.Eq (Queue.Push ((0 .. 7 => 12)), Success); + Push_Assert.Eq (Queue.Push ([0 .. 7 => 12]), Success); Put_Line ("Num_Bytes_Used: " & Natural'Image (Queue.Num_Bytes_Used)); Natural_Assert.Eq (Queue.Num_Bytes_Used, 26); Put_Line (Basic_Types.Representation.Image (Data)); Check_Meta (2); - Push_Assert.Eq (Queue.Push ((0 .. 0 => 12)), Too_Full); + Push_Assert.Eq (Queue.Push ([0 .. 0 => 12]), Too_Full); Check_Meta (2); -- Pop and check: Pop_Assert.Eq (Queue.Pop, Success); @@ -226,7 +226,7 @@ procedure Test is Pop_Assert.Eq (Queue.Pop (Bytes, Length => Len), Success); Put_Line ("Num_Bytes_Used: " & Natural'Image (Queue.Num_Bytes_Used)); Natural_Assert.Eq (Queue.Num_Bytes_Used, 0); - Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), (0 .. Len - 1 => 12)); + Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), [0 .. Len - 1 => 12]); Check_Meta (0); Put_Line ("Passed."); Put_Line (""); diff --git a/src/data_structures/database/database.adb b/src/data_structures/database/database.adb index 0eeb0692..740678e3 100644 --- a/src/data_structures/database/database.adb +++ b/src/data_structures/database/database.adb @@ -7,7 +7,7 @@ package body Database is Self.Db_Table := new Database_Table (Database_Index'First .. Database_Index'First + Max_Num_Values - 1); Self.Index_Table := new Index_Lookup_Table (Minimum_Id .. Maximum_Id); -- Initialize this table to zero, to signify unallocated entries: - Self.Index_Table.all := (others => 0); + Self.Index_Table.all := [others => 0]; end Init; procedure Destroy (Self : in out Instance) is diff --git a/src/data_structures/database/variable_database.ads b/src/data_structures/database/variable_database.ads index 4a817c41..2b510c3c 100644 --- a/src/data_structures/database/variable_database.ads +++ b/src/data_structures/database/variable_database.ads @@ -67,7 +67,7 @@ private -- stored. type Database_Entry is record State : Entry_State := Empty; - Data : T_Serializer.Byte_Array := (others => 0); + Data : T_Serializer.Byte_Array := [others => 0]; end record; -- Database table type which maps the index type (unconstrained) diff --git a/src/data_structures/database/variable_test/simple_variable.record.yaml b/src/data_structures/database/variable_test/simple_variable.record.yaml index fe42b99c..572e5f64 100644 --- a/src/data_structures/database/variable_test/simple_variable.record.yaml +++ b/src/data_structures/database/variable_test/simple_variable.record.yaml @@ -11,5 +11,5 @@ fields: - name: Buffer type: Buffer_Type format: U8x10 - default: (others => 0) + default: "[others => 0]" variable_length: Length diff --git a/src/data_structures/database/variable_test/variable_database_tests-implementation.adb b/src/data_structures/database/variable_test/variable_database_tests-implementation.adb index be6bd3e6..e7b984d4 100644 --- a/src/data_structures/database/variable_test/variable_database_tests-implementation.adb +++ b/src/data_structures/database/variable_test/variable_database_tests-implementation.adb @@ -45,7 +45,7 @@ package body Variable_Database_Tests.Implementation is ------------------------------------------------------------------------- overriding procedure Test_Nominal_Update_Fetch (Self : in out Instance) is - Value : Simple_Variable.T := (0, (others => 0)); + Value : Simple_Variable.T := (0, [others => 0]); Cnt : Unsigned_8 := 0; U_Status : My_Database.Update_Status; F_Status : My_Database.Fetch_Status; @@ -53,7 +53,7 @@ package body Variable_Database_Tests.Implementation is -- Add items to database: for Id in Start_Id .. Stop_Id loop Value.Length := Cnt; - Value.Buffer := (others => Cnt + 7); + Value.Buffer := [others => Cnt + 7]; Cnt := Cnt + 1; Put_Line ("inserting " & Natural'Image (Natural (Id)) & " => " & Simple_Variable.Representation.To_Tuple_String (Value)); U_Status := Self.Db.Update (Id, Value); @@ -63,10 +63,10 @@ package body Variable_Database_Tests.Implementation is -- Fetch items from database and check values: Cnt := 0; for Id in Start_Id .. Stop_Id loop - Value := (0, (others => 0)); + Value := (0, [others => 0]); F_Status := Self.Db.Fetch (Id, Value); Fetch_Status_Assert.Eq (F_Status, My_Database.Success); - Simple_Variable_Assert.Eq (Value, (Cnt, (others => Cnt + 7))); + Simple_Variable_Assert.Eq (Value, (Cnt, [others => Cnt + 7])); Put_Line ("fetching " & Natural'Image (Natural (Id)) & " => " & Simple_Variable.Representation.To_Tuple_String (Value)); Cnt := Cnt + 1; end loop; @@ -75,7 +75,7 @@ package body Variable_Database_Tests.Implementation is Cnt := 0; for Id in reverse Start_Id .. Stop_Id loop Value.Length := Cnt; - Value.Buffer := (others => Cnt + 11); + Value.Buffer := [others => Cnt + 11]; Cnt := Cnt + 1; Put_Line ("inserting " & Natural'Image (Natural (Id)) & " => " & Simple_Variable.Representation.To_Tuple_String (Value)); U_Status := Self.Db.Update (Id, Value); @@ -85,39 +85,39 @@ package body Variable_Database_Tests.Implementation is -- Fetch items from database and check values: Cnt := 0; for Id in reverse Start_Id .. Stop_Id loop - Value := (0, (others => 0)); + Value := (0, [others => 0]); F_Status := Self.Db.Fetch (Id, Value); Fetch_Status_Assert.Eq (F_Status, My_Database.Success); - Simple_Variable_Assert.Eq (Value, (Cnt, (others => Cnt + 11))); + Simple_Variable_Assert.Eq (Value, (Cnt, [others => Cnt + 11])); Put_Line ("fetching " & Natural'Image (Natural (Id)) & " => " & Simple_Variable.Representation.To_Tuple_String (Value)); Cnt := Cnt + 1; end loop; end Test_Nominal_Update_Fetch; overriding procedure Test_Id_Out_Of_Range (Self : in out Instance) is - Value : Simple_Variable.T := (8, (others => 7)); + Value : Simple_Variable.T := (8, [others => 7]); U_Status : My_Database.Update_Status; F_Status : My_Database.Fetch_Status; begin -- Try to update a too high and too low value: U_Status := Self.Db.Update (Id_Type'Last, Value); Update_Status_Assert.Eq (U_Status, My_Database.Id_Out_Of_Range); - Simple_Variable_Assert.Eq (Value, (8, (others => 7))); + Simple_Variable_Assert.Eq (Value, (8, [others => 7])); U_Status := Self.Db.Update (Id_Type'First, Value); Update_Status_Assert.Eq (U_Status, My_Database.Id_Out_Of_Range); - Simple_Variable_Assert.Eq (Value, (8, (others => 7))); + Simple_Variable_Assert.Eq (Value, (8, [others => 7])); -- Fetch with bad id: F_Status := Self.Db.Fetch (Id_Type'Last, Value); Fetch_Status_Assert.Eq (F_Status, My_Database.Id_Out_Of_Range); - Simple_Variable_Assert.Eq (Value, (8, (others => 7))); + Simple_Variable_Assert.Eq (Value, (8, [others => 7])); F_Status := Self.Db.Fetch (Id_Type'First, Value); Fetch_Status_Assert.Eq (F_Status, My_Database.Id_Out_Of_Range); - Simple_Variable_Assert.Eq (Value, (8, (others => 7))); + Simple_Variable_Assert.Eq (Value, (8, [others => 7])); end Test_Id_Out_Of_Range; overriding procedure Test_Data_Not_Available (Self : in out Instance) is - Value : Simple_Variable.T := (5, (others => 1)); + Value : Simple_Variable.T := (5, [others => 1]); U_Status : My_Database.Update_Status; F_Status : My_Database.Fetch_Status; Cnt : Unsigned_8 := 0; @@ -126,13 +126,13 @@ package body Variable_Database_Tests.Implementation is for Id in Start_Id .. Stop_Id loop F_Status := Self.Db.Fetch (Id, Value); Fetch_Status_Assert.Eq (F_Status, My_Database.Data_Not_Available); - Simple_Variable_Assert.Eq (Value, (5, (others => 1))); + Simple_Variable_Assert.Eq (Value, (5, [others => 1])); end loop; -- Add values and the should now be available: for Id in Start_Id .. Stop_Id - 1 loop Value.Length := Cnt; - Value.Buffer := (others => Cnt + 12); + Value.Buffer := [others => Cnt + 12]; Cnt := Cnt + 1; U_Status := Self.Db.Update (Id, Value); Update_Status_Assert.Eq (U_Status, My_Database.Success); @@ -141,22 +141,22 @@ package body Variable_Database_Tests.Implementation is -- Fetch items from database and check values: Cnt := 0; for Id in Start_Id .. Stop_Id - 1 loop - Value := (0, (others => 0)); + Value := (0, [others => 0]); F_Status := Self.Db.Fetch (Id, Value); Fetch_Status_Assert.Eq (F_Status, My_Database.Success); - Simple_Variable_Assert.Eq (Value, (Cnt, (others => Cnt + 12))); + Simple_Variable_Assert.Eq (Value, (Cnt, [others => Cnt + 12])); Cnt := Cnt + 1; end loop; -- Fetching the last item should still be unavailable: - Value := (5, (others => 1)); + Value := (5, [others => 1]); F_Status := Self.Db.Fetch (Stop_Id, Value); Fetch_Status_Assert.Eq (F_Status, My_Database.Data_Not_Available); - Simple_Variable_Assert.Eq (Value, (5, (others => 1))); + Simple_Variable_Assert.Eq (Value, (5, [others => 1])); end Test_Data_Not_Available; overriding procedure Test_Serialization_Failure (Self : in out Instance) is - Value : Simple_Variable.T := (5, (others => 1)); + Value : Simple_Variable.T := (5, [others => 1]); Cnt : Unsigned_8 := 0; U_Status : My_Database.Update_Status; F_Status : My_Database.Fetch_Status; @@ -164,33 +164,33 @@ package body Variable_Database_Tests.Implementation is -- Seed database: for Id in Start_Id .. Stop_Id loop Value.Length := Cnt; - Value.Buffer := (others => Cnt + 7); + Value.Buffer := [others => Cnt + 7]; Cnt := Cnt + 1; U_Status := Self.Db.Update (Id, Value); Update_Status_Assert.Eq (U_Status, My_Database.Success); end loop; -- Try to update with a value that has a length that is too large: - Value := (80, (others => 1)); + Value := (80, [others => 1]); U_Status := Self.Db.Update (Start_Id, Value); Update_Status_Assert.Eq (U_Status, My_Database.Serialization_Failure); - Value := (11, (others => 1)); + Value := (11, [others => 1]); U_Status := Self.Db.Override (Stop_Id, Value); Update_Status_Assert.Eq (U_Status, My_Database.Serialization_Failure); -- Make sure the database values were not overwritten in anyway: Cnt := 0; for Id in Start_Id .. Stop_Id loop - Value := (0, (others => 0)); + Value := (0, [others => 0]); F_Status := Self.Db.Fetch (Id, Value); Fetch_Status_Assert.Eq (F_Status, My_Database.Success); - Simple_Variable_Assert.Eq (Value, (Cnt, (others => Cnt + 7))); + Simple_Variable_Assert.Eq (Value, (Cnt, [others => Cnt + 7])); Cnt := Cnt + 1; end loop; end Test_Serialization_Failure; overriding procedure Test_Override (Self : in out Instance) is - Value : Simple_Variable.T := (0, (others => 0)); + Value : Simple_Variable.T := (0, [others => 0]); Cnt : Unsigned_8 := 0; U_Status : My_Database.Update_Status; C_Status : My_Database.Clear_Override_Status; @@ -199,7 +199,7 @@ package body Variable_Database_Tests.Implementation is -- Add items to database: for Id in Start_Id .. Stop_Id loop Value.Length := Cnt; - Value.Buffer := (others => Cnt + 7); + Value.Buffer := [others => Cnt + 7]; Cnt := Cnt + 1; Put_Line ("inserting " & Natural'Image (Natural (Id)) & " => " & Simple_Variable.Representation.To_Tuple_String (Value)); U_Status := Self.Db.Update (Id, Value); @@ -209,10 +209,10 @@ package body Variable_Database_Tests.Implementation is -- Fetch items from database and check values: Cnt := 0; for Id in Start_Id .. Stop_Id loop - Value := (0, (others => 0)); + Value := (0, [others => 0]); F_Status := Self.Db.Fetch (Id, Value); Fetch_Status_Assert.Eq (F_Status, My_Database.Success); - Simple_Variable_Assert.Eq (Value, (Cnt, (others => Cnt + 7))); + Simple_Variable_Assert.Eq (Value, (Cnt, [others => Cnt + 7])); Put_Line ("fetching " & Natural'Image (Natural (Id)) & " => " & Simple_Variable.Representation.To_Tuple_String (Value)); Cnt := Cnt + 1; end loop; @@ -222,7 +222,7 @@ package body Variable_Database_Tests.Implementation is Cnt := 0; for Id in Start_Id .. Stop_Id loop Value.Length := Cnt; - Value.Buffer := (others => Cnt); + Value.Buffer := [others => Cnt]; Cnt := Cnt + 1; Put_Line ("overriding " & Natural'Image (Natural (Id)) & " => " & Simple_Variable.Representation.To_Tuple_String (Value)); U_Status := Self.Db.Override (Id, Value); @@ -233,10 +233,10 @@ package body Variable_Database_Tests.Implementation is -- Fetch items from database and check values: Cnt := 0; for Id in Start_Id .. Stop_Id loop - Value := (0, (others => 0)); + Value := (0, [others => 0]); F_Status := Self.Db.Fetch (Id, Value); Fetch_Status_Assert.Eq (F_Status, My_Database.Success); - Simple_Variable_Assert.Eq (Value, (Cnt, (others => Cnt))); + Simple_Variable_Assert.Eq (Value, (Cnt, [others => Cnt])); Put_Line ("fetching " & Natural'Image (Natural (Id)) & " => " & Simple_Variable.Representation.To_Tuple_String (Value)); Cnt := Cnt + 1; pragma Assert (Self.Db.Any_Overridden = True); @@ -246,7 +246,7 @@ package body Variable_Database_Tests.Implementation is Cnt := 0; for Id in Start_Id .. Stop_Id loop Value.Length := Cnt; - Value.Buffer := (others => Cnt + 7); + Value.Buffer := [others => Cnt + 7]; Cnt := Cnt + 1; Put_Line ("inserting " & Natural'Image (Natural (Id)) & " => " & Simple_Variable.Representation.To_Tuple_String (Value)); U_Status := Self.Db.Update (Id, Value); @@ -256,10 +256,10 @@ package body Variable_Database_Tests.Implementation is -- Fetch items from database and check values: Cnt := 0; for Id in Start_Id .. Stop_Id loop - Value := (0, (others => 0)); + Value := (0, [others => 0]); F_Status := Self.Db.Fetch (Id, Value); Fetch_Status_Assert.Eq (F_Status, My_Database.Success); - Simple_Variable_Assert.Eq (Value, (Cnt, (others => Cnt))); + Simple_Variable_Assert.Eq (Value, (Cnt, [others => Cnt])); Put_Line ("fetching " & Natural'Image (Natural (Id)) & " => " & Simple_Variable.Representation.To_Tuple_String (Value)); Cnt := Cnt + 1; pragma Assert (Self.Db.Any_Overridden = True); @@ -278,7 +278,7 @@ package body Variable_Database_Tests.Implementation is Cnt := 0; for Id in Start_Id .. Stop_Id loop Value.Length := Cnt; - Value.Buffer := (others => Cnt + 7); + Value.Buffer := [others => Cnt + 7]; Cnt := Cnt + 1; Put_Line ("inserting " & Natural'Image (Natural (Id)) & " => " & Simple_Variable.Representation.To_Tuple_String (Value)); U_Status := Self.Db.Update (Id, Value); @@ -288,13 +288,13 @@ package body Variable_Database_Tests.Implementation is -- Fetch items from database and check values: Cnt := 0; for Id in Start_Id .. Stop_Id loop - Value := (0, (others => 0)); + Value := (0, [others => 0]); F_Status := Self.Db.Fetch (Id, Value); Fetch_Status_Assert.Eq (F_Status, My_Database.Success); if Id mod 2 = 0 then - Simple_Variable_Assert.Eq (Value, (Cnt, (others => Cnt + 7))); + Simple_Variable_Assert.Eq (Value, (Cnt, [others => Cnt + 7])); else - Simple_Variable_Assert.Eq (Value, (Cnt, (others => Cnt))); + Simple_Variable_Assert.Eq (Value, (Cnt, [others => Cnt])); end if; Put_Line ("fetching " & Natural'Image (Natural (Id)) & " => " & Simple_Variable.Representation.To_Tuple_String (Value)); Cnt := Cnt + 1; @@ -309,7 +309,7 @@ package body Variable_Database_Tests.Implementation is Cnt := 0; for Id in Start_Id .. Stop_Id loop Value.Length := Cnt; - Value.Buffer := (others => Cnt + 10); + Value.Buffer := [others => Cnt + 10]; Cnt := Cnt + 1; Put_Line ("inserting " & Natural'Image (Natural (Id)) & " => " & Simple_Variable.Representation.To_Tuple_String (Value)); U_Status := Self.Db.Update (Id, Value); @@ -319,10 +319,10 @@ package body Variable_Database_Tests.Implementation is -- Fetch items from database and check values: Cnt := 0; for Id in Start_Id .. Stop_Id loop - Value := (0, (others => 0)); + Value := (0, [others => 0]); F_Status := Self.Db.Fetch (Id, Value); Fetch_Status_Assert.Eq (F_Status, My_Database.Success); - Simple_Variable_Assert.Eq (Value, (Cnt, (others => Cnt + 10))); + Simple_Variable_Assert.Eq (Value, (Cnt, [others => Cnt + 10])); Put_Line ("fetching " & Natural'Image (Natural (Id)) & " => " & Simple_Variable.Representation.To_Tuple_String (Value)); Cnt := Cnt + 1; pragma Assert (Self.Db.Any_Overridden = False); diff --git a/src/data_structures/labeled_queue/test/global.adb b/src/data_structures/labeled_queue/test/global.adb index b12a4e68..a16103ad 100644 --- a/src/data_structures/labeled_queue/test/global.adb +++ b/src/data_structures/labeled_queue/test/global.adb @@ -26,7 +26,7 @@ package body Global is One_Second_Later : Ada.Real_Time.Time; Len : Natural; Static_Var : Static.T := (others => 0); - Variable_Var : Simple_Variable.T := (Length => 0, Buffer => (others => 0)); + Variable_Var : Simple_Variable.T := (Length => 0, Buffer => [others => 0]); Bytes : Basic_Types.Byte_Array (0 .. 100); use Ada.Real_Time; use Simple_Variable; @@ -49,11 +49,11 @@ package body Global is Pop_Assert.Eq (Queue.Peek (Label, Bytes, Len, Offset => 2), Success); Label_Assert.Eq (Label, Bytes_Type); Natural_Assert.Eq (Len, 8); - Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), (3, 4, 5, 6, 7, 8, 9, 10)); + Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), [3, 4, 5, 6, 7, 8, 9, 10]); Pop_Assert.Eq (Queue.Pop (Label, Bytes, Len, Offset => 1), Success); Label_Assert.Eq (Label, Bytes_Type); Natural_Assert.Eq (Len, 9); - Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), (2, 3, 4, 5, 6, 7, 8, 9, 10)); + Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), [2, 3, 4, 5, 6, 7, 8, 9, 10]); Put_Line (Natural'Image (Queue.Num_Bytes_Free) & " bytes free in queue."); when Pop_Static => The_Action.Set (Nothing); @@ -86,18 +86,18 @@ package body Global is Pop_Type_Assert.Eq (Peek_Simple_Variable (Queue, Label, Variable_Var, Offset => 0), Success); Label_Assert.Eq (Label, Variable_Type); Put_Line ("Peeked: " & Simple_Variable.Representation.Image (Variable_Var)); - Simple_Variable_Assert.Eq (Variable_Var, (6, (10, 9, 8, 7, 6, 5, others => 0))); - Variable_Var := (0, (others => 0)); + Simple_Variable_Assert.Eq (Variable_Var, (6, [10, 9, 8, 7, 6, 5, others => 0])); + Variable_Var := (0, [others => 0]); Pop_Type_Assert.Eq (Pop_Simple_Variable (Queue, Label, Variable_Var, Offset => 0), Success); Label_Assert.Eq (Label, Variable_Type); - Simple_Variable_Assert.Eq (Variable_Var, (6, (10, 9, 8, 7, 6, 5, others => 0))); + Simple_Variable_Assert.Eq (Variable_Var, (6, [10, 9, 8, 7, 6, 5, others => 0])); -- Pop_Assert.eq(queue.Pop, Success); Put_Line (Natural'Image (Queue.Num_Bytes_Free) & " bytes free in queue."); when Push => The_Action.Set (Nothing); delay until One_Second_Later; Put_Line ("Handler adding item to queue."); - Push_Assert.Eq (Queue.Push (Bytes_Type, (4, 4, 4, 4, 4, 5, 5, 5, 5, 5)), Success); + Push_Assert.Eq (Queue.Push (Bytes_Type, [4, 4, 4, 4, 4, 5, 5, 5, 5, 5]), Success); Put_Line (Natural'Image (Queue.Num_Bytes_Free) & " bytes free in queue."); when Push_Static => The_Action.Set (Nothing); @@ -109,7 +109,7 @@ package body Global is The_Action.Set (Nothing); delay until One_Second_Later; Put_Line ("Handler adding variable item to queue."); - Push_Variable_Length_Type_Assert.Eq (Push_Simple_Variable (Queue, Variable_Type, (3, (99, 99, 99, 99, others => 255))), Success); + Push_Variable_Length_Type_Assert.Eq (Push_Simple_Variable (Queue, Variable_Type, (3, [99, 99, 99, 99, others => 255])), Success); Put_Line (Natural'Image (Queue.Num_Bytes_Free) & " bytes free in queue."); when Pop_Error => The_Action.Set (Nothing); @@ -124,14 +124,14 @@ package body Global is Pop_Block_Assert.Eq (Queue.Peek_Length_Block (Len), Error); Pop_Block_Assert.Eq (Queue.Peek_Label_Block (Label), Error); Put_Line ("Error received, now pushing to unblock other task."); - Push_Assert.Eq (Queue.Push (Bytes_Type, (6, 6, 6, 7, 7, 8)), Success); + Push_Assert.Eq (Queue.Push (Bytes_Type, [6, 6, 6, 7, 7, 8]), Success); when Push_Error => The_Action.Set (Nothing); delay until One_Second_Later; Put_Line ("Handler pushing from a queue where another task is already blocked."); - Push_Block_Assert.Eq (Queue.Push_Block (Bytes_Type, (4, 4, 4, 4, 4, 5, 5, 5, 5, 5)), Error); + Push_Block_Assert.Eq (Queue.Push_Block (Bytes_Type, [4, 4, 4, 4, 4, 5, 5, 5, 5, 5]), Error); Push_Block_Assert.Eq (Push_Static_Block (Queue, Static_Type, (One => 7, Two => 8, Three => 9)), Error); - Push_Variable_Length_Type_Block_Assert.Eq (Push_Simple_Variable_Block (Queue, Variable_Type, (3, (99, 99, 99, 99, others => 255))), Error); + Push_Variable_Length_Type_Block_Assert.Eq (Push_Simple_Variable_Block (Queue, Variable_Type, (3, [99, 99, 99, 99, others => 255])), Error); Put_Line ("Error received, now popping to unblock other task."); Pop_Assert.Eq (Queue.Pop, Success); when Quit => diff --git a/src/data_structures/labeled_queue/test/simple_variable.record.yaml b/src/data_structures/labeled_queue/test/simple_variable.record.yaml index 58defc5e..a088bdbe 100644 --- a/src/data_structures/labeled_queue/test/simple_variable.record.yaml +++ b/src/data_structures/labeled_queue/test/simple_variable.record.yaml @@ -11,5 +11,5 @@ fields: - name: Buffer type: Buffer_Type format: U8x20 - default: (others => 0) + default: "[others => 0]" variable_length: Length diff --git a/src/data_structures/labeled_queue/test/test.adb b/src/data_structures/labeled_queue/test/test.adb index 1bd1984a..c078517e 100644 --- a/src/data_structures/labeled_queue/test/test.adb +++ b/src/data_structures/labeled_queue/test/test.adb @@ -16,11 +16,11 @@ procedure Test is Len : Natural; Static_Var : Static.T := (others => 0); Ignore_Static_Var : Static.T := (others => 0); - Variable_Var : constant Simple_Variable.T := (Length => 6, Buffer => (10, 9, 8, 7, 6, 5, others => 255)); - Variable_Var2 : Simple_Variable.T := (Length => 0, Buffer => (others => 0)); - Ignore_Variable_Var2 : Simple_Variable.T := (Length => 0, Buffer => (others => 0)); + Variable_Var : constant Simple_Variable.T := (Length => 6, Buffer => [10, 9, 8, 7, 6, 5, others => 255]); + Variable_Var2 : Simple_Variable.T := (Length => 0, Buffer => [others => 0]); + Ignore_Variable_Var2 : Simple_Variable.T := (Length => 0, Buffer => [others => 0]); Queue_Size : constant Positive := 40; - Queue_Bytes : aliased Basic_Types.Byte_Array := (0 .. Queue_Size - 1 => 0); + Queue_Bytes : aliased Basic_Types.Byte_Array := [0 .. Queue_Size - 1 => 0]; Bytes : Basic_Types.Byte_Array (0 .. 100); Label : Element_Type; Ignore_Label : Element_Type; @@ -44,7 +44,7 @@ begin Put_Line ("Filling queue test... "); Put_Line (Natural'Image (Queue.Num_Bytes_Free) & " bytes free in queue."); - Push_Assert.Eq (Queue.Push (Bytes_Type, (1, 2, 3, 4, 5, 6, 7, 8, 9, 10)), Success); + Push_Assert.Eq (Queue.Push (Bytes_Type, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]), Success); Natural_Assert.Eq (Queue.Num_Elements, 1); Natural_Assert.Eq (Queue.Max_Num_Elements, 1); Put_Line (Natural'Image (Queue.Num_Bytes_Free) & " bytes free in queue."); @@ -56,7 +56,7 @@ begin Put_Line (Natural'Image (Queue.Num_Bytes_Free) & " bytes free in queue."); Put_Line (Basic_Types.Representation.Image (Queue_Bytes)); -- Push a variable type: - Push_Variable_Length_Type_Assert.Eq (Push_Simple_Variable (Queue, Variable_Type, (Length => 21, Buffer => (others => 233))), Serialization_Failure); + Push_Variable_Length_Type_Assert.Eq (Push_Simple_Variable (Queue, Variable_Type, (Length => 21, Buffer => [others => 233])), Serialization_Failure); Push_Variable_Length_Type_Assert.Eq (Push_Simple_Variable (Queue, Variable_Type, Variable_Var), Success); Natural_Assert.Eq (Queue.Num_Elements, 3); Natural_Assert.Eq (Queue.Max_Num_Elements, 3); @@ -67,11 +67,11 @@ begin Put_Line ("Blocking push test... "); -- Push some bytes: - Push_Assert.Eq (Queue.Push (Bytes_Type, (1, 2, 3, 4, 5, 6, 7, 8, 9, 10)), Too_Full); + Push_Assert.Eq (Queue.Push (Bytes_Type, [1, 2, 3, 4, 5, 6, 7, 8, 9, 100]), Too_Full); Put_Line (Natural'Image (Queue.Num_Bytes_Free) & " bytes free in queue."); Put_Line ("Waiting on full queue... "); The_Action.Set (Pop); - Push_Block_Assert.Eq (Queue.Push_Block (Bytes_Type, (11, 12, 13, 14, 15, 16, 17, 18, 19, 20)), Success); + Push_Block_Assert.Eq (Queue.Push_Block (Bytes_Type, [11, 12, 13, 14, 15, 16, 17, 18, 19, 20]), Success); Put_Line ("pushed item."); Put_Line (Natural'Image (Queue.Num_Bytes_Free) & " bytes free in queue."); Natural_Assert.Eq (Queue.Num_Elements, 3); @@ -98,7 +98,7 @@ begin Push_Variable_Length_Type_Assert.Eq (Push_Simple_Variable (Queue, Variable_Type, Variable_Var), Too_Full); Put_Line ("Waiting on full queue... "); The_Action.Set (Pop_Variable); - Push_Variable_Length_Type_Block_Assert.Eq (Push_Simple_Variable_Block (Queue, Variable_Type, (9, (8, 8, 8, 8, 8, 8, 8, 8, 8, others => 255))), Success); + Push_Variable_Length_Type_Block_Assert.Eq (Push_Simple_Variable_Block (Queue, Variable_Type, (9, [8, 8, 8, 8, 8, 8, 8, 8, 8, others => 255])), Success); Put_Line ("pushed item."); Natural_Assert.Eq (Queue.Num_Elements, 3); Natural_Assert.Eq (Queue.Max_Num_Elements, 3); @@ -115,11 +115,11 @@ begin Pop_Assert.Eq (Queue.Peek (Label, Bytes, Len, Offset => 1), Success); Natural_Assert.Eq (Len, 9); Label_Assert.Eq (Label, Bytes_Type); - Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), (12, 13, 14, 15, 16, 17, 18, 19, 20)); + Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), [12, 13, 14, 15, 16, 17, 18, 19, 20]); Pop_Assert.Eq (Queue.Pop (Label, Bytes, Len, Offset => 3), Success); Label_Assert.Eq (Label, Bytes_Type); Natural_Assert.Eq (Len, 7); - Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), (14, 15, 16, 17, 18, 19, 20)); + Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), [14, 15, 16, 17, 18, 19, 20]); Put_Line (Natural'Image (Queue.Num_Bytes_Free) & " bytes free in queue."); Natural_Assert.Eq (Queue.Num_Elements, 2); Natural_Assert.Eq (Queue.Max_Num_Elements, 3); @@ -149,10 +149,10 @@ begin Pop_Type_Assert.Eq (Peek_Simple_Variable (Queue, Label, Variable_Var2, Offset => 1), Success); Label_Assert.Eq (Label, Variable_Type); Put_Line ("Peeked: " & Simple_Variable.Representation.Image (Variable_Var2)); - Simple_Variable_Assert.Eq (Variable_Var2, (8, (8, 8, 8, 8, 8, 8, 8, 8, others => 0))); + Simple_Variable_Assert.Eq (Variable_Var2, (8, [8, 8, 8, 8, 8, 8, 8, 8, others => 0])); Pop_Type_Assert.Eq (Pop_Simple_Variable (Queue, Label, Variable_Var2, Offset => 0), Success); Label_Assert.Eq (Label, Variable_Type); - Simple_Variable_Assert.Eq (Variable_Var2, (9, (8, 8, 8, 8, 8, 8, 8, 8, 8, others => 0))); + Simple_Variable_Assert.Eq (Variable_Var2, (9, [8, 8, 8, 8, 8, 8, 8, 8, 8, others => 0])); Put_Line (Natural'Image (Queue.Num_Bytes_Free) & " bytes free in queue."); Natural_Assert.Eq (Queue.Num_Elements, 0); Natural_Assert.Eq (Queue.Max_Num_Elements, 3); @@ -172,7 +172,7 @@ begin Put_Line ("item popped."); Put_Line ("len: " & Natural'Image (Len)); Natural_Assert.Eq (Len, 10); - Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), (4, 4, 4, 4, 4, 5, 5, 5, 5, 5)); + Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), [4, 4, 4, 4, 4, 5, 5, 5, 5, 5]); Natural_Assert.Eq (Queue.Num_Elements, 0); Natural_Assert.Eq (Queue.Max_Num_Elements, 3); Put_Line (Natural'Image (Queue.Num_Bytes_Free) & " bytes free in queue."); @@ -183,7 +183,7 @@ begin Put_Line ("item peeked."); Put_Line ("len: " & Natural'Image (Len)); Natural_Assert.Eq (Len, 10); - Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), (4, 4, 4, 4, 4, 5, 5, 5, 5, 5)); + Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), [4, 4, 4, 4, 4, 5, 5, 5, 5, 5]); Natural_Assert.Eq (Queue.Num_Elements, 1); Natural_Assert.Eq (Queue.Max_Num_Elements, 3); Put_Line (Natural'Image (Queue.Num_Bytes_Free) & " bytes free in queue."); @@ -193,7 +193,7 @@ begin Put_Line ("item popped."); Put_Line ("len: " & Natural'Image (Len)); Natural_Assert.Eq (Len, 10); - Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), (4, 4, 4, 4, 4, 5, 5, 5, 5, 5)); + Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), [4, 4, 4, 4, 4, 5, 5, 5, 5, 5]); Natural_Assert.Eq (Queue.Num_Elements, 0); Natural_Assert.Eq (Queue.Max_Num_Elements, 3); Put_Line (Natural'Image (Queue.Num_Bytes_Free) & " bytes free in queue."); @@ -209,7 +209,7 @@ begin Put_Line ("item popped."); Put_Line ("len: " & Natural'Image (Len)); Natural_Assert.Eq (Len, 10); - Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), (4, 4, 4, 4, 4, 5, 5, 5, 5, 5)); + Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), [4, 4, 4, 4, 4, 5, 5, 5, 5, 5]); Natural_Assert.Eq (Queue.Num_Elements, 0); Natural_Assert.Eq (Queue.Max_Num_Elements, 3); Put_Line (Natural'Image (Queue.Num_Bytes_Free) & " bytes free in queue."); @@ -228,7 +228,7 @@ begin Put_Line ("item popped."); Put_Line ("len: " & Natural'Image (Len)); Natural_Assert.Eq (Len, 10); - Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), (4, 4, 4, 4, 4, 5, 5, 5, 5, 5)); + Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), [4, 4, 4, 4, 4, 5, 5, 5, 5, 5]); Natural_Assert.Eq (Queue.Num_Elements, 0); Natural_Assert.Eq (Queue.Max_Num_Elements, 3); Put_Line (Natural'Image (Queue.Num_Bytes_Free) & " bytes free in queue."); @@ -244,7 +244,7 @@ begin Put_Line ("item popped."); Put_Line ("len: " & Natural'Image (Len)); Natural_Assert.Eq (Len, 10); - Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), (4, 4, 4, 4, 4, 5, 5, 5, 5, 5)); + Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), [4, 4, 4, 4, 4, 5, 5, 5, 5, 5]); Natural_Assert.Eq (Queue.Num_Elements, 0); Natural_Assert.Eq (Queue.Max_Num_Elements, 3); Put_Line (Natural'Image (Queue.Num_Bytes_Free) & " bytes free in queue."); @@ -262,7 +262,7 @@ begin Put_Line ("item popped."); Put_Line ("len: " & Natural'Image (Len)); Natural_Assert.Eq (Len, 10); - Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), (4, 4, 4, 4, 4, 5, 5, 5, 5, 5)); + Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), [4, 4, 4, 4, 4, 5, 5, 5, 5, 5]); Natural_Assert.Eq (Queue.Num_Elements, 0); Natural_Assert.Eq (Queue.Max_Num_Elements, 3); Put_Line (Natural'Image (Queue.Num_Bytes_Free) & " bytes free in queue."); @@ -307,7 +307,7 @@ begin Pop_Type_Block_Assert.Eq (Pop_Simple_Variable_Block (Queue, Label, Variable_Var2), Success); Label_Assert.Eq (Label, Variable_Type); Put_Line ("item popped."); - Simple_Variable_Assert.Eq (Variable_Var2, (3, (99, 99, 99, others => 0))); + Simple_Variable_Assert.Eq (Variable_Var2, (3, [99, 99, 99, others => 0])); Natural_Assert.Eq (Queue.Num_Elements, 0); Natural_Assert.Eq (Queue.Max_Num_Elements, 3); Put_Line (Natural'Image (Queue.Num_Bytes_Free) & " bytes free in queue."); @@ -316,7 +316,7 @@ begin Pop_Type_Block_Assert.Eq (Peek_Simple_Variable_Block (Queue, Label, Variable_Var2), Success); Label_Assert.Eq (Label, Variable_Type); Put_Line ("item popped."); - Simple_Variable_Assert.Eq (Variable_Var2, (3, (99, 99, 99, others => 0))); + Simple_Variable_Assert.Eq (Variable_Var2, (3, [99, 99, 99, others => 0])); Natural_Assert.Eq (Queue.Num_Elements, 1); Natural_Assert.Eq (Queue.Max_Num_Elements, 3); Put_Line (Natural'Image (Queue.Num_Bytes_Free) & " bytes free in queue."); @@ -324,7 +324,7 @@ begin Pop_Type_Block_Assert.Eq (Pop_Simple_Variable_Block (Queue, Label, Variable_Var2), Success); Label_Assert.Eq (Label, Variable_Type); Put_Line ("item popped."); - Simple_Variable_Assert.Eq (Variable_Var2, (3, (99, 99, 99, others => 0))); + Simple_Variable_Assert.Eq (Variable_Var2, (3, [99, 99, 99, others => 0])); Natural_Assert.Eq (Queue.Num_Elements, 0); Natural_Assert.Eq (Queue.Max_Num_Elements, 3); Put_Line (Natural'Image (Queue.Num_Bytes_Free) & " bytes free in queue."); @@ -344,7 +344,7 @@ begin Put_Line ("item popped."); Put_Line ("len: " & Natural'Image (Len)); Natural_Assert.Eq (Len, 6); - Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), (6, 6, 6, 7, 7, 8)); + Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), [6, 6, 6, 7, 7, 8]); Natural_Assert.Eq (Queue.Num_Elements, 0); Natural_Assert.Eq (Queue.Max_Num_Elements, 3); Put_Line (Natural'Image (Queue.Num_Bytes_Free) & " bytes free in queue."); @@ -353,7 +353,7 @@ begin Put_Line ("Filling queue test 2... "); Put_Line (Natural'Image (Queue.Num_Bytes_Free) & " bytes free in queue."); - Push_Assert.Eq (Queue.Push (Bytes_Type, (1, 2, 3, 4, 5, 6, 7, 8, 9, 10)), Success); + Push_Assert.Eq (Queue.Push (Bytes_Type, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]), Success); Natural_Assert.Eq (Queue.Num_Elements, 1); Natural_Assert.Eq (Queue.Max_Num_Elements, 3); Put_Line (Natural'Image (Queue.Num_Bytes_Free) & " bytes free in queue."); @@ -365,7 +365,7 @@ begin Put_Line (Natural'Image (Queue.Num_Bytes_Free) & " bytes free in queue."); Put_Line (Basic_Types.Representation.Image (Queue_Bytes)); -- Push a variable type: - Push_Variable_Length_Type_Assert.Eq (Push_Simple_Variable (Queue, Variable_Type, (Length => 21, Buffer => (others => 233))), Serialization_Failure); + Push_Variable_Length_Type_Assert.Eq (Push_Simple_Variable (Queue, Variable_Type, (Length => 21, Buffer => [others => 233])), Serialization_Failure); Push_Variable_Length_Type_Assert.Eq (Push_Simple_Variable (Queue, Variable_Type, Variable_Var), Success); Natural_Assert.Eq (Queue.Num_Elements, 3); Natural_Assert.Eq (Queue.Max_Num_Elements, 3); @@ -376,11 +376,11 @@ begin Put_Line ("Blocking push error test... "); -- Push some bytes: - Push_Assert.Eq (Queue.Push (Bytes_Type, (1, 2, 3, 4, 5, 6, 7, 8, 9, 10)), Too_Full); + Push_Assert.Eq (Queue.Push (Bytes_Type, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]), Too_Full); Put_Line (Natural'Image (Queue.Num_Bytes_Free) & " bytes free in queue."); Put_Line ("Waiting on full queue... "); The_Action.Set (Push_Error); - Push_Block_Assert.Eq (Queue.Push_Block (Bytes_Type, (11, 12, 13, 14, 15, 16, 17, 18, 19, 20)), Success); + Push_Block_Assert.Eq (Queue.Push_Block (Bytes_Type, [11, 12, 13, 14, 15, 16, 17, 18, 19, 20]), Success); Put_Line ("pushed item."); Put_Line (Natural'Image (Queue.Num_Bytes_Free) & " bytes free in queue."); Natural_Assert.Eq (Queue.Num_Elements, 3); @@ -408,7 +408,7 @@ begin Push_Variable_Length_Type_Assert.Eq (Push_Simple_Variable (Queue, Variable_Type, Variable_Var), Too_Full); Put_Line ("Waiting on full queue... "); The_Action.Set (Push_Error); - Push_Variable_Length_Type_Block_Assert.Eq (Push_Simple_Variable_Block (Queue, Variable_Type, (9, (8, 8, 8, 8, 8, 8, 8, 8, 8, others => 255))), Success); + Push_Variable_Length_Type_Block_Assert.Eq (Push_Simple_Variable_Block (Queue, Variable_Type, (9, [8, 8, 8, 8, 8, 8, 8, 8, 8, others => 255])), Success); Put_Line ("pushed item."); Natural_Assert.Eq (Queue.Num_Elements, 3); Natural_Assert.Eq (Queue.Max_Num_Elements, 3); diff --git a/src/data_structures/priority_queue/test/test.adb b/src/data_structures/priority_queue/test/test.adb index c8930faa..ef3df9bb 100644 --- a/src/data_structures/priority_queue/test/test.adb +++ b/src/data_structures/priority_queue/test/test.adb @@ -53,7 +53,7 @@ begin Put ("Testing push... "); -- Test no data. - pragma Assert (My_Queue.Push (Priority => (Pri => 0, Value => 15), Bytes => (2 .. 1 => 0)) = Success); + pragma Assert (My_Queue.Push (Priority => (Pri => 0, Value => 15), Bytes => [2 .. 1 => 0]) = Success); pragma Assert (My_Queue.Num_Bytes_Free = 4 * 4); pragma Assert (My_Queue.Num_Bytes_Used = 4 * 1); pragma Assert (My_Queue.Max_Num_Bytes_Used = 4 * 1); @@ -61,7 +61,7 @@ begin pragma Assert (My_Queue.Max_Percent_Used = 100 / 5); pragma Assert (not My_Queue.Is_Empty); pragma Assert (not My_Queue.Is_Full); - pragma Assert (My_Queue.Push (Priority => (Pri => 0, Value => 15), Bytes => (1, 2, 3, 4)) = Success); + pragma Assert (My_Queue.Push (Priority => (Pri => 0, Value => 15), Bytes => [1, 2, 3, 4]) = Success); pragma Assert (My_Queue.Num_Bytes_Free = 4 * 3); pragma Assert (My_Queue.Num_Bytes_Used = 4 * 2); pragma Assert (My_Queue.Max_Num_Bytes_Used = 4 * 2); @@ -69,7 +69,7 @@ begin pragma Assert (My_Queue.Max_Percent_Used = 200 / 5); pragma Assert (not My_Queue.Is_Empty); pragma Assert (not My_Queue.Is_Full); - pragma Assert (My_Queue.Push (Priority => (Pri => 0, Value => 15), Bytes => (1, 2, 3, 4)) = Success); + pragma Assert (My_Queue.Push (Priority => (Pri => 0, Value => 15), Bytes => [1, 2, 3, 4]) = Success); pragma Assert (My_Queue.Num_Bytes_Free = 4 * 2); pragma Assert (My_Queue.Num_Bytes_Used = 4 * 3); pragma Assert (My_Queue.Max_Num_Bytes_Used = 4 * 3); @@ -77,7 +77,7 @@ begin pragma Assert (My_Queue.Max_Percent_Used = Byte (Natural (300 / 5))); pragma Assert (not My_Queue.Is_Empty); pragma Assert (not My_Queue.Is_Full); - pragma Assert (My_Queue.Push (Priority => (Pri => 0, Value => 15), Bytes => (1, 2, 3, 4)) = Success); + pragma Assert (My_Queue.Push (Priority => (Pri => 0, Value => 15), Bytes => [1, 2, 3, 4]) = Success); pragma Assert (My_Queue.Num_Bytes_Free = 4 * 1); pragma Assert (My_Queue.Num_Bytes_Used = 4 * 4); pragma Assert (My_Queue.Max_Num_Bytes_Used = 4 * 4); @@ -85,7 +85,7 @@ begin pragma Assert (My_Queue.Max_Percent_Used = Byte (Natural (400 / 5))); pragma Assert (not My_Queue.Is_Empty); pragma Assert (not My_Queue.Is_Full); - pragma Assert (My_Queue.Push (Priority => (Pri => 0, Value => 15), Bytes => (1, 2, 3, 4)) = Success); + pragma Assert (My_Queue.Push (Priority => (Pri => 0, Value => 15), Bytes => [1, 2, 3, 4]) = Success); pragma Assert (My_Queue.Num_Bytes_Free = 4 * 0); pragma Assert (My_Queue.Num_Bytes_Used = 4 * 5); pragma Assert (My_Queue.Max_Num_Bytes_Used = 4 * 5); @@ -96,7 +96,7 @@ begin Put_Line ("passed."); Put ("Testing full... "); - pragma Assert (My_Queue.Push (Priority => (Pri => 0, Value => 15), Bytes => (1, 2, 3, 4)) = Full); + pragma Assert (My_Queue.Push (Priority => (Pri => 0, Value => 15), Bytes => [1, 2, 3, 4]) = Full); pragma Assert (My_Queue.Num_Bytes_Free = 4 * 0); pragma Assert (My_Queue.Num_Bytes_Used = 4 * 5); pragma Assert (My_Queue.Max_Num_Bytes_Used = 4 * 5); @@ -104,7 +104,7 @@ begin pragma Assert (My_Queue.Max_Percent_Used = 100); pragma Assert (not My_Queue.Is_Empty); pragma Assert (My_Queue.Is_Full); - pragma Assert (My_Queue.Push (Priority => (Pri => 0, Value => 15), Bytes => (1, 2, 3, 4)) = Full); + pragma Assert (My_Queue.Push (Priority => (Pri => 0, Value => 15), Bytes => [1, 2, 3, 4]) = Full); pragma Assert (My_Queue.Num_Bytes_Free = 4 * 0); pragma Assert (My_Queue.Num_Bytes_Used = 4 * 5); pragma Assert (My_Queue.Max_Num_Bytes_Used = 4 * 5); @@ -145,7 +145,7 @@ begin pragma Assert (My_Queue.Pop (Priority => My_Data, Num_Bytes_Returned => Bytes_Returned, Bytes => Bytes) = Success); pragma Assert (My_Data = (Pri => 0, Value => 15)); pragma Assert (Bytes_Returned = 4); - pragma Assert (Bytes = (1, 2, 3, 4)); + pragma Assert (Bytes = [1, 2, 3, 4]); pragma Assert (My_Queue.Num_Bytes_Free = 4 * 2); pragma Assert (My_Queue.Num_Bytes_Used = 4 * 3); pragma Assert (My_Queue.Current_Percent_Used = Byte (Natural (300 / 5))); @@ -164,7 +164,7 @@ begin pragma Assert (My_Queue.Pop (Priority => My_Data, Num_Bytes_Returned => Bytes_Returned, Bytes => Bytes) = Success); pragma Assert (My_Data = (Pri => 0, Value => 15)); pragma Assert (Bytes_Returned = 4); - pragma Assert (Bytes = (1, 2, 3, 4)); + pragma Assert (Bytes = [1, 2, 3, 4]); pragma Assert (My_Queue.Num_Bytes_Free = 4 * 3); pragma Assert (My_Queue.Num_Bytes_Used = 4 * 2); pragma Assert (My_Queue.Current_Percent_Used = Byte (Natural (200 / 5))); @@ -183,7 +183,7 @@ begin pragma Assert (My_Queue.Pop (Priority => My_Data, Num_Bytes_Returned => Bytes_Returned, Bytes => Bytes) = Success); pragma Assert (My_Data = (Pri => 0, Value => 15)); pragma Assert (Bytes_Returned = 4); - pragma Assert (Bytes = (1, 2, 3, 4)); + pragma Assert (Bytes = [1, 2, 3, 4]); pragma Assert (My_Queue.Num_Bytes_Free = 4 * 4); pragma Assert (My_Queue.Num_Bytes_Used = 4 * 1); pragma Assert (My_Queue.Current_Percent_Used = Byte (Natural (100 / 5))); @@ -202,7 +202,7 @@ begin pragma Assert (My_Queue.Pop (Priority => My_Data, Num_Bytes_Returned => Bytes_Returned, Bytes => Bytes) = Success); pragma Assert (My_Data = (Pri => 0, Value => 15)); pragma Assert (Bytes_Returned = 4); - pragma Assert (Bytes = (1, 2, 3, 4)); + pragma Assert (Bytes = [1, 2, 3, 4]); pragma Assert (My_Queue.Num_Bytes_Free = 4 * 5); pragma Assert (My_Queue.Num_Bytes_Used = 4 * 0); pragma Assert (My_Queue.Current_Percent_Used = Byte (Natural (0 / 5))); @@ -226,135 +226,135 @@ begin Put_Line ("passed."); Put ("Testing priority... "); - pragma Assert (My_Queue.Push (Priority => (Pri => 56, Value => 15), Bytes => (1, 2, 3, 4)) = Success); - pragma Assert (My_Queue.Push (Priority => (Pri => 1_000, Value => 14), Bytes => (5, 6, 7)) = Success); - pragma Assert (My_Queue.Push (Priority => (Pri => 9, Value => 13), Bytes => (8, 9)) = Success); + pragma Assert (My_Queue.Push (Priority => (Pri => 56, Value => 15), Bytes => [1, 2, 3, 4]) = Success); + pragma Assert (My_Queue.Push (Priority => (Pri => 1_000, Value => 14), Bytes => [5, 6, 7]) = Success); + pragma Assert (My_Queue.Push (Priority => (Pri => 9, Value => 13), Bytes => [8, 9]) = Success); pragma Assert (My_Queue.Peek (Priority => My_Data, Num_Bytes_Returned => Bytes_Returned) = Success); pragma Assert (My_Data = (Pri => 1_000, Value => 14)); pragma Assert (Bytes_Returned = 3); - pragma Assert (My_Queue.Push (Priority => (Pri => 1_001, Value => 9), Bytes => (0 => 10)) = Success); + pragma Assert (My_Queue.Push (Priority => (Pri => 1_001, Value => 9), Bytes => [0 => 10]) = Success); pragma Assert (My_Queue.Pop (Priority => My_Data, Num_Bytes_Returned => Bytes_Returned, Bytes => Bytes) = Success); pragma Assert (My_Data = (Pri => 1_001, Value => 9)); pragma Assert (Bytes_Returned = 1); - pragma Assert (Bytes (0 .. 0) = (0 => 10)); + pragma Assert (Bytes (0 .. 0) = [0 => 10]); pragma Assert (My_Queue.Peek (Priority => My_Data, Num_Bytes_Returned => Bytes_Returned) = Success); pragma Assert (My_Data = (Pri => 1_000, Value => 14)); pragma Assert (Bytes_Returned = 3); pragma Assert (My_Queue.Pop (Priority => My_Data, Num_Bytes_Returned => Bytes_Returned, Bytes => Bytes) = Success); pragma Assert (My_Data = (Pri => 1_000, Value => 14)); pragma Assert (Bytes_Returned = 3); - pragma Assert (Bytes (0 .. 2) = (5, 6, 7)); + pragma Assert (Bytes (0 .. 2) = [5, 6, 7]); pragma Assert (My_Queue.Peek (Priority => My_Data, Num_Bytes_Returned => Bytes_Returned) = Success); pragma Assert (My_Data = (Pri => 56, Value => 15)); pragma Assert (Bytes_Returned = 4); pragma Assert (My_Queue.Pop (Priority => My_Data, Num_Bytes_Returned => Bytes_Returned, Bytes => Bytes) = Success); pragma Assert (My_Data = (Pri => 56, Value => 15)); pragma Assert (Bytes_Returned = 4); - pragma Assert (Bytes = (1, 2, 3, 4)); - pragma Assert (My_Queue.Push (Priority => (Pri => 8, Value => 1), Bytes => (0 => 10)) = Success); - pragma Assert (My_Queue.Push (Priority => (Pri => 7, Value => 2), Bytes => (0 => 11)) = Success); + pragma Assert (Bytes = [1, 2, 3, 4]); + pragma Assert (My_Queue.Push (Priority => (Pri => 8, Value => 1), Bytes => [0 => 10]) = Success); + pragma Assert (My_Queue.Push (Priority => (Pri => 7, Value => 2), Bytes => [0 => 11]) = Success); pragma Assert (My_Queue.Peek (Priority => My_Data, Num_Bytes_Returned => Bytes_Returned) = Success); pragma Assert (My_Data = (Pri => 9, Value => 13)); pragma Assert (Bytes_Returned = 2); pragma Assert (My_Queue.Pop (Priority => My_Data, Num_Bytes_Returned => Bytes_Returned, Bytes => Bytes) = Success); pragma Assert (My_Data = (Pri => 9, Value => 13)); pragma Assert (Bytes_Returned = 2); - pragma Assert (Bytes (0 .. 1) = (8, 9)); + pragma Assert (Bytes (0 .. 1) = [8, 9]); pragma Assert (My_Queue.Peek (Priority => My_Data, Num_Bytes_Returned => Bytes_Returned) = Success); pragma Assert (My_Data = (Pri => 8, Value => 1)); pragma Assert (Bytes_Returned = 1); pragma Assert (My_Queue.Pop (Priority => My_Data, Num_Bytes_Returned => Bytes_Returned, Bytes => Bytes) = Success); pragma Assert (My_Data = (Pri => 8, Value => 1)); pragma Assert (Bytes_Returned = 1); - pragma Assert (Bytes (0 .. 0) = (0 => 10)); - pragma Assert (My_Queue.Push (Priority => (Pri => 19, Value => 3), Bytes => (0 => 14)) = Success); - pragma Assert (My_Queue.Push (Priority => (Pri => 20, Value => 4), Bytes => (0 => 15)) = Success); - pragma Assert (My_Queue.Push (Priority => (Pri => 21, Value => 5), Bytes => (0 => 16)) = Success); - pragma Assert (My_Queue.Push (Priority => (Pri => 22, Value => 6), Bytes => (0 => 17)) = Success); - pragma Assert (My_Queue.Push (Priority => (Pri => 23, Value => 7), Bytes => (0 => 18)) = Full); - pragma Assert (My_Queue.Push (Priority => (Pri => 23, Value => 7), Bytes => (1 .. 0 => 18)) = Full); + pragma Assert (Bytes (0 .. 0) = [0 => 10]); + pragma Assert (My_Queue.Push (Priority => (Pri => 19, Value => 3), Bytes => [0 => 14]) = Success); + pragma Assert (My_Queue.Push (Priority => (Pri => 20, Value => 4), Bytes => [0 => 15]) = Success); + pragma Assert (My_Queue.Push (Priority => (Pri => 21, Value => 5), Bytes => [0 => 16]) = Success); + pragma Assert (My_Queue.Push (Priority => (Pri => 22, Value => 6), Bytes => [0 => 17]) = Success); + pragma Assert (My_Queue.Push (Priority => (Pri => 23, Value => 7), Bytes => [0 => 18]) = Full); + pragma Assert (My_Queue.Push (Priority => (Pri => 23, Value => 7), Bytes => [1 .. 0 => 18]) = Full); pragma Assert (My_Queue.Pop (Priority => My_Data, Num_Bytes_Returned => Bytes_Returned, Bytes => Bytes) = Success); pragma Assert (My_Data = (Pri => 22, Value => 6)); pragma Assert (Bytes_Returned = 1); - pragma Assert (Bytes (0 .. 0) = (0 => 17)); + pragma Assert (Bytes (0 .. 0) = [0 => 17]); pragma Assert (My_Queue.Pop (Priority => My_Data, Num_Bytes_Returned => Bytes_Returned, Bytes => Bytes) = Success); pragma Assert (My_Data = (Pri => 21, Value => 5)); pragma Assert (Bytes_Returned = 1); - pragma Assert (Bytes (0 .. 0) = (0 => 16)); + pragma Assert (Bytes (0 .. 0) = [0 => 16]); pragma Assert (My_Queue.Pop (Priority => My_Data, Num_Bytes_Returned => Bytes_Returned, Bytes => Bytes) = Success); pragma Assert (My_Data = (Pri => 20, Value => 4)); pragma Assert (Bytes_Returned = 1); - pragma Assert (Bytes (0 .. 0) = (0 => 15)); + pragma Assert (Bytes (0 .. 0) = [0 => 15]); pragma Assert (My_Queue.Pop (Priority => My_Data, Num_Bytes_Returned => Bytes_Returned, Bytes => Bytes) = Success); pragma Assert (My_Data = (Pri => 19, Value => 3)); pragma Assert (Bytes_Returned = 1); - pragma Assert (Bytes (0 .. 0) = (0 => 14)); + pragma Assert (Bytes (0 .. 0) = [0 => 14]); pragma Assert (My_Queue.Pop (Priority => My_Data, Num_Bytes_Returned => Bytes_Returned, Bytes => Bytes) = Success); pragma Assert (My_Data = (Pri => 7, Value => 2)); pragma Assert (Bytes_Returned = 1); - pragma Assert (Bytes (0 .. 0) = (0 => 11)); + pragma Assert (Bytes (0 .. 0) = [0 => 11]); pragma Assert (My_Queue.Pop (Priority => My_Data, Num_Bytes_Returned => Bytes_Returned, Bytes => Bytes) = Empty); Put_Line ("passed."); Put ("Testing same priority... "); - pragma Assert (My_Queue.Push (Priority => (Pri => 56, Value => 7), Bytes => (1, 2, 3, 4)) = Success); - pragma Assert (My_Queue.Push (Priority => (Pri => 56, Value => 8), Bytes => (2, 3, 4)) = Success); - pragma Assert (My_Queue.Push (Priority => (Pri => 56, Value => 9), Bytes => (3, 4)) = Success); - pragma Assert (My_Queue.Push (Priority => (Pri => 56, Value => 10), Bytes => (18, 2, 3, 4)) = Success); + pragma Assert (My_Queue.Push (Priority => (Pri => 56, Value => 7), Bytes => [1, 2, 3, 4]) = Success); + pragma Assert (My_Queue.Push (Priority => (Pri => 56, Value => 8), Bytes => [2, 3, 4]) = Success); + pragma Assert (My_Queue.Push (Priority => (Pri => 56, Value => 9), Bytes => [3, 4]) = Success); + pragma Assert (My_Queue.Push (Priority => (Pri => 56, Value => 10), Bytes => [18, 2, 3, 4]) = Success); pragma Assert (My_Queue.Pop (Priority => My_Data, Num_Bytes_Returned => Bytes_Returned, Bytes => Bytes) = Success); pragma Assert (My_Data = (Pri => 56, Value => 7)); pragma Assert (Bytes_Returned = 4); - pragma Assert (Bytes (0 .. 3) = (1, 2, 3, 4)); + pragma Assert (Bytes (0 .. 3) = [1, 2, 3, 4]); pragma Assert (My_Queue.Pop (Priority => My_Data, Num_Bytes_Returned => Bytes_Returned, Bytes => Bytes) = Success); pragma Assert (My_Data = (Pri => 56, Value => 8)); pragma Assert (Bytes_Returned = 3); - pragma Assert (Bytes (0 .. 2) = (2, 3, 4)); - pragma Assert (My_Queue.Push (Priority => (Pri => 57, Value => 11), Bytes => (18, 2, 3)) = Success); - pragma Assert (My_Queue.Push (Priority => (Pri => 56, Value => 12), Bytes => (18, 2)) = Success); + pragma Assert (Bytes (0 .. 2) = [2, 3, 4]); + pragma Assert (My_Queue.Push (Priority => (Pri => 57, Value => 11), Bytes => [18, 2, 3]) = Success); + pragma Assert (My_Queue.Push (Priority => (Pri => 56, Value => 12), Bytes => [18, 2]) = Success); pragma Assert (My_Queue.Pop (Priority => My_Data, Num_Bytes_Returned => Bytes_Returned, Bytes => Bytes) = Success); pragma Assert (My_Data = (Pri => 57, Value => 11)); pragma Assert (Bytes_Returned = 3); - pragma Assert (Bytes (0 .. 2) = (18, 2, 3)); + pragma Assert (Bytes (0 .. 2) = [18, 2, 3]); pragma Assert (My_Queue.Pop (Priority => My_Data, Num_Bytes_Returned => Bytes_Returned, Bytes => Bytes) = Success); pragma Assert (My_Data = (Pri => 56, Value => 9)); pragma Assert (Bytes_Returned = 2); - pragma Assert (Bytes (0 .. 1) = (3, 4)); + pragma Assert (Bytes (0 .. 1) = [3, 4]); pragma Assert (My_Queue.Pop (Priority => My_Data, Num_Bytes_Returned => Bytes_Returned, Bytes => Bytes) = Success); pragma Assert (My_Data = (Pri => 56, Value => 10)); pragma Assert (Bytes_Returned = 4); - pragma Assert (Bytes (0 .. 3) = (18, 2, 3, 4)); + pragma Assert (Bytes (0 .. 3) = [18, 2, 3, 4]); pragma Assert (My_Queue.Pop (Priority => My_Data, Num_Bytes_Returned => Bytes_Returned, Bytes => Bytes) = Success); pragma Assert (My_Data = (Pri => 56, Value => 12)); pragma Assert (Bytes_Returned = 2); - pragma Assert (Bytes (0 .. 1) = (18, 2)); + pragma Assert (Bytes (0 .. 1) = [18, 2]); pragma Assert (My_Queue.Pop (Priority => My_Data, Num_Bytes_Returned => Bytes_Returned, Bytes => Bytes) = Empty); Put_Line ("passed."); Put ("Testing error... "); - pragma Assert (My_Queue.Push (Priority => (Pri => 56, Value => 7), Bytes => (1, 2, 3, 4)) = Success); + pragma Assert (My_Queue.Push (Priority => (Pri => 56, Value => 7), Bytes => [1, 2, 3, 4]) = Success); pragma Assert (My_Queue.Pop (Priority => My_Data, Num_Bytes_Returned => Bytes_Returned, Bytes => Bytes (0 .. 2)) = Too_Small); pragma Assert (My_Queue.Pop (Priority => My_Data, Num_Bytes_Returned => Bytes_Returned, Bytes => Bytes (0 .. 1)) = Too_Small); pragma Assert (My_Queue.Pop (Priority => My_Data, Num_Bytes_Returned => Bytes_Returned, Bytes => Bytes (0 .. 0)) = Too_Small); pragma Assert (My_Queue.Pop (Priority => My_Data, Num_Bytes_Returned => Bytes_Returned, Bytes => Bytes (0 .. 3)) = Success); pragma Assert (My_Data = (Pri => 56, Value => 7)); pragma Assert (Bytes_Returned = 4); - pragma Assert (Bytes (0 .. 3) = (1, 2, 3, 4)); + pragma Assert (Bytes (0 .. 3) = [1, 2, 3, 4]); pragma Assert (My_Queue.Pop (Priority => My_Data, Num_Bytes_Returned => Bytes_Returned, Bytes => Bytes (0 .. 3)) = Empty); - pragma Assert (My_Queue.Push (Priority => (Pri => 56, Value => 7), Bytes => (1, 2, 3, 4)) = Success); - pragma Assert (My_Queue.Push (Priority => (Pri => 56, Value => 7), Bytes => (1, 2, 3, 4, 5)) = Too_Large); - pragma Assert (My_Queue.Push (Priority => (Pri => 56, Value => 7), Bytes => (1, 2, 3, 4, 5, 6)) = Too_Large); - pragma Assert (My_Queue.Push (Priority => (Pri => 56, Value => 7), Bytes => (1, 2, 3, 4, 5, 6, 7)) = Too_Large); - pragma Assert (My_Queue.Push (Priority => (Pri => 56, Value => 7), Bytes => (1, 2, 3, 4, 5, 6, 7, 8)) = Too_Large); - pragma Assert (My_Queue.Push (Priority => (Pri => 56, Value => 7), Bytes => (1, 2, 3, 6)) = Success); + pragma Assert (My_Queue.Push (Priority => (Pri => 56, Value => 7), Bytes => [1, 2, 3, 4]) = Success); + pragma Assert (My_Queue.Push (Priority => (Pri => 56, Value => 7), Bytes => [1, 2, 3, 4, 5]) = Too_Large); + pragma Assert (My_Queue.Push (Priority => (Pri => 56, Value => 7), Bytes => [1, 2, 3, 4, 5, 6]) = Too_Large); + pragma Assert (My_Queue.Push (Priority => (Pri => 56, Value => 7), Bytes => [1, 2, 3, 4, 5, 6, 7]) = Too_Large); + pragma Assert (My_Queue.Push (Priority => (Pri => 56, Value => 7), Bytes => [1, 2, 3, 4, 5, 6, 7, 8]) = Too_Large); + pragma Assert (My_Queue.Push (Priority => (Pri => 56, Value => 7), Bytes => [1, 2, 3, 6]) = Success); pragma Assert (My_Queue.Pop (Priority => My_Data, Num_Bytes_Returned => Bytes_Returned, Bytes => Bytes (0 .. 3)) = Success); pragma Assert (My_Data = (Pri => 56, Value => 7)); pragma Assert (Bytes_Returned = 4); - pragma Assert (Bytes (0 .. 3) = (1, 2, 3, 4)); + pragma Assert (Bytes (0 .. 3) = [1, 2, 3, 4]); pragma Assert (My_Queue.Pop (Priority => My_Data, Num_Bytes_Returned => Bytes_Returned, Bytes => Bytes (0 .. 2)) = Too_Small); pragma Assert (My_Queue.Pop (Priority => My_Data, Num_Bytes_Returned => Bytes_Returned, Bytes => Bytes (0 .. 3)) = Success); pragma Assert (My_Data = (Pri => 56, Value => 7)); pragma Assert (Bytes_Returned = 4); - pragma Assert (Bytes (0 .. 3) = (1, 2, 3, 6)); + pragma Assert (Bytes (0 .. 3) = [1, 2, 3, 6]); pragma Assert (My_Queue.Pop (Priority => My_Data, Num_Bytes_Returned => Bytes_Returned, Bytes => Bytes (1 .. 0)) = Empty); Put_Line ("passed."); diff --git a/src/data_structures/protected_priority_queue/test/global.adb b/src/data_structures/protected_priority_queue/test/global.adb index d3f20640..8e9f145f 100644 --- a/src/data_structures/protected_priority_queue/test/global.adb +++ b/src/data_structures/protected_priority_queue/test/global.adb @@ -25,7 +25,7 @@ package body Global is One_Second_Later : Ada.Real_Time.Time; Len : Natural; Static_Var : Static.T := (others => 0); - Variable_Var : Simple_Variable.T := (Length => 0, Buffer => (others => 0)); + Variable_Var : Simple_Variable.T := (Length => 0, Buffer => [others => 0]); Bytes : Basic_Types.Byte_Array (0 .. 100); Pri_Data : Data; use Ada.Real_Time; @@ -47,7 +47,7 @@ package body Global is Pop_Assert.Eq (Queue.Pop (Priority => Pri_Data, Bytes => Bytes, Length => Len), Success); pragma Assert (Pri_Data = (Pri => 1, Data_Type => Bytes_Type)); Natural_Assert.Eq (Len, 9); - Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), (2, 3, 4, 5, 6, 7, 8, 9, 10)); + Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), [2, 3, 4, 5, 6, 7, 8, 9, 10]); Put_Line (Natural'Image (Queue.Num_Bytes_Free) & " bytes free in queue."); when Pop_Static => The_Action.Set (Nothing); @@ -69,16 +69,16 @@ package body Global is pragma Assert (Pri_Data = (Pri => 3, Data_Type => Variable_Type)); Put_Line ("len: " & Natural'Image (Len)); Natural_Assert.Eq (Len, 7); - Variable_Var := (0, (others => 0)); + Variable_Var := (0, [others => 0]); Pop_Type_Assert.Eq (Pop_Simple_Variable (Queue, Priority => Pri_Data, Dest => Variable_Var), Success); pragma Assert (Pri_Data = (Pri => 3, Data_Type => Variable_Type)); - Simple_Variable_Assert.Eq (Variable_Var, (6, (10, 9, 8, 7, 6, 5, others => 0))); + Simple_Variable_Assert.Eq (Variable_Var, (6, [10, 9, 8, 7, 6, 5, others => 0])); Put_Line (Natural'Image (Queue.Num_Bytes_Free) & " bytes free in queue."); when Push => The_Action.Set (Nothing); delay until One_Second_Later; Put_Line ("Handler adding item to queue."); - Push_Assert.Eq (Queue.Push ((Pri => 1, Data_Type => Bytes_Type), (4, 4, 4, 4, 4, 5, 5, 5, 5, 5)), Success); + Push_Assert.Eq (Queue.Push ((Pri => 1, Data_Type => Bytes_Type), [4, 4, 4, 4, 4, 5, 5, 5, 5, 5]), Success); Put_Line (Natural'Image (Queue.Num_Bytes_Free) & " bytes free in queue."); when Push_Static => The_Action.Set (Nothing); @@ -90,7 +90,7 @@ package body Global is The_Action.Set (Nothing); delay until One_Second_Later; Put_Line ("Handler adding variable item to queue."); - Push_Variable_Length_Type_Assert.Eq (Push_Simple_Variable (Queue, (Pri => 3, Data_Type => Variable_Type), (3, (99, 99, 99, 99, others => 255))), Success); + Push_Variable_Length_Type_Assert.Eq (Push_Simple_Variable (Queue, (Pri => 3, Data_Type => Variable_Type), (3, [99, 99, 99, 99, others => 255])), Success); Put_Line (Natural'Image (Queue.Num_Bytes_Free) & " bytes free in queue."); when Pop_Error => The_Action.Set (Nothing); @@ -101,14 +101,14 @@ package body Global is Pop_Type_Block_Assert.Eq (Pop_Simple_Variable_Block (Queue, Priority => Pri_Data, Dest => Variable_Var), Error); Peek_Block_Assert.Eq (Queue.Peek_Length_Block (Priority => Pri_Data, Length => Len), Error); Put_Line ("Error received, now pushing to unblock other task."); - Push_Assert.Eq (Queue.Push ((Pri => 1, Data_Type => Bytes_Type), (6, 6, 6, 7, 7, 8)), Success); + Push_Assert.Eq (Queue.Push ((Pri => 1, Data_Type => Bytes_Type), [6, 6, 6, 7, 7, 8]), Success); when Push_Error => The_Action.Set (Nothing); delay until One_Second_Later; Put_Line ("Handler pushing from a queue where another task is already blocked."); - Push_Block_Assert.Eq (Queue.Push_Block ((Pri => 1, Data_Type => Bytes_Type), (4, 4, 4, 4, 4, 5, 5, 5, 5, 5)), Error); + Push_Block_Assert.Eq (Queue.Push_Block ((Pri => 1, Data_Type => Bytes_Type), [4, 4, 4, 4, 4, 5, 5, 5, 5, 5]), Error); Push_Block_Assert.Eq (Push_Static_Block (Queue, (Pri => 1, Data_Type => Static_Type), (One => 7, Two => 8, Three => 9)), Error); - Push_Variable_Length_Type_Block_Assert.Eq (Push_Simple_Variable_Block (Queue, (Pri => 1, Data_Type => Variable_Type), (3, (99, 99, 99, 99, others => 255))), Error); + Push_Variable_Length_Type_Block_Assert.Eq (Push_Simple_Variable_Block (Queue, (Pri => 1, Data_Type => Variable_Type), (3, [99, 99, 99, 99, others => 255])), Error); Put_Line ("Error received, now popping to unblock other task."); Pop_Assert.Eq (Queue.Pop (Priority => Pri_Data, Bytes => Bytes, Length => Len), Success); when Quit => diff --git a/src/data_structures/protected_priority_queue/test/simple_variable.record.yaml b/src/data_structures/protected_priority_queue/test/simple_variable.record.yaml index 58defc5e..a088bdbe 100644 --- a/src/data_structures/protected_priority_queue/test/simple_variable.record.yaml +++ b/src/data_structures/protected_priority_queue/test/simple_variable.record.yaml @@ -11,5 +11,5 @@ fields: - name: Buffer type: Buffer_Type format: U8x20 - default: (others => 0) + default: "[others => 0]" variable_length: Length diff --git a/src/data_structures/protected_priority_queue/test/test.adb b/src/data_structures/protected_priority_queue/test/test.adb index 2a126559..e3e18e37 100644 --- a/src/data_structures/protected_priority_queue/test/test.adb +++ b/src/data_structures/protected_priority_queue/test/test.adb @@ -14,8 +14,8 @@ procedure Test is -- Other vars: Len : Natural; Static_Var : Static.T := (others => 0); - Variable_Var : constant Simple_Variable.T := (Length => 6, Buffer => (10, 9, 8, 7, 6, 5, others => 255)); - Variable_Var2 : Simple_Variable.T := (Length => 0, Buffer => (others => 0)); + Variable_Var : constant Simple_Variable.T := (Length => 6, Buffer => [10, 9, 8, 7, 6, 5, others => 255]); + Variable_Var2 : Simple_Variable.T := (Length => 0, Buffer => [others => 0]); Queue_Size : constant Positive := Simple_Variable.Size_In_Bytes * 3; Bytes : Basic_Types.Byte_Array (0 .. 100); Pri_Data : Data; @@ -39,7 +39,7 @@ begin Put_Line ("Filling queue test... "); Put_Line (Natural'Image (Queue.Num_Bytes_Free) & " bytes free in queue."); - Push_Assert.Eq (Queue.Push ((Pri => 1, Data_Type => Bytes_Type), (1, 2, 3, 4, 5, 6, 7, 8, 9, 10)), Success); + Push_Assert.Eq (Queue.Push ((Pri => 1, Data_Type => Bytes_Type), [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]), Success); Natural_Assert.Eq (Queue.Num_Elements, 1); Natural_Assert.Eq (Queue.Max_Num_Elements, 1); Put_Line (Natural'Image (Queue.Num_Bytes_Free) & " bytes free in queue."); @@ -49,7 +49,7 @@ begin Natural_Assert.Eq (Queue.Max_Num_Elements, 2); Put_Line (Natural'Image (Queue.Num_Bytes_Free) & " bytes free in queue."); -- Push a variable type: - Push_Variable_Length_Type_Assert.Eq (Push_Simple_Variable (Queue, (Pri => 0, Data_Type => Variable_Type), (Length => 21, Buffer => (others => 233))), Serialization_Failure); + Push_Variable_Length_Type_Assert.Eq (Push_Simple_Variable (Queue, (Pri => 0, Data_Type => Variable_Type), (Length => 21, Buffer => [others => 233])), Serialization_Failure); Push_Variable_Length_Type_Assert.Eq (Push_Simple_Variable (Queue, (Pri => 3, Data_Type => Variable_Type), Variable_Var), Success); Natural_Assert.Eq (Queue.Num_Elements, 3); Natural_Assert.Eq (Queue.Max_Num_Elements, 3); @@ -59,11 +59,11 @@ begin Put_Line ("Blocking push test... "); -- Push some bytes: - Push_Assert.Eq (Queue.Push ((Pri => 100, Data_Type => Bytes_Type), (1, 2, 3, 4, 5, 6, 7, 8, 9, 10)), Full); + Push_Assert.Eq (Queue.Push ((Pri => 100, Data_Type => Bytes_Type), [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]), Full); Put_Line (Natural'Image (Queue.Num_Bytes_Free) & " bytes free in queue."); Put_Line ("Waiting on full queue... "); The_Action.Set (Pop_Variable); - Push_Block_Assert.Eq (Queue.Push_Block ((Pri => 0, Data_Type => Bytes_Type), (11, 12, 13, 14, 15, 16, 17, 18, 19, 20)), Success); + Push_Block_Assert.Eq (Queue.Push_Block ((Pri => 0, Data_Type => Bytes_Type), [11, 12, 13, 14, 15, 16, 17, 18, 19, 20]), Success); Put_Line ("pushed item."); Put_Line (Natural'Image (Queue.Num_Bytes_Free) & " bytes free in queue."); Natural_Assert.Eq (Queue.Num_Elements, 3); @@ -84,7 +84,7 @@ begin Push_Variable_Length_Type_Assert.Eq (Push_Simple_Variable (Queue, (Pri => 99, Data_Type => Variable_Type), Variable_Var), Full); Put_Line ("Waiting on full queue... "); The_Action.Set (Pop_Static); - Push_Variable_Length_Type_Block_Assert.Eq (Push_Simple_Variable_Block (Queue, (Pri => 3, Data_Type => Variable_Type), (9, (8, 8, 8, 8, 8, 8, 8, 8, 8, others => 255))), Success); + Push_Variable_Length_Type_Block_Assert.Eq (Push_Simple_Variable_Block (Queue, (Pri => 3, Data_Type => Variable_Type), (9, [8, 8, 8, 8, 8, 8, 8, 8, 8, others => 255])), Success); Put_Line ("pushed item."); Natural_Assert.Eq (Queue.Num_Elements, 3); Natural_Assert.Eq (Queue.Max_Num_Elements, 3); @@ -99,7 +99,7 @@ begin Natural_Assert.Eq (Len, 10); Pop_Type_Assert.Eq (Pop_Simple_Variable (Queue, Pri_Data, Variable_Var2), Success); pragma Assert (Pri_Data = (Pri => 3, Data_Type => Variable_Type)); - Simple_Variable_Assert.Eq (Variable_Var2, (9, (8, 8, 8, 8, 8, 8, 8, 8, 8, others => 0))); + Simple_Variable_Assert.Eq (Variable_Var2, (9, [8, 8, 8, 8, 8, 8, 8, 8, 8, others => 0])); Put_Line (Natural'Image (Queue.Num_Bytes_Free) & " bytes free in queue."); Natural_Assert.Eq (Queue.Num_Elements, 2); Natural_Assert.Eq (Queue.Max_Num_Elements, 3); @@ -110,7 +110,7 @@ begin Pop_Assert.Eq (Queue.Pop (Pri_Data, Bytes, Len), Success); pragma Assert (Pri_Data = (Pri => 1, Data_Type => Bytes_Type)); Natural_Assert.Eq (Len, 10); - Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), (1, 2, 3, 4, 5, 6, 7, 8, 9, 10)); + Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]); Put_Line (Natural'Image (Queue.Num_Bytes_Free) & " bytes free in queue."); Natural_Assert.Eq (Queue.Num_Elements, 1); Natural_Assert.Eq (Queue.Max_Num_Elements, 3); @@ -121,7 +121,7 @@ begin Pop_Assert.Eq (Queue.Pop (Pri_Data, Bytes, Len), Success); pragma Assert (Pri_Data = (Pri => 0, Data_Type => Bytes_Type)); Natural_Assert.Eq (Len, 10); - Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), (11, 12, 13, 14, 15, 16, 17, 18, 19, 20)); + Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), [11, 12, 13, 14, 15, 16, 17, 18, 19, 20]); Put_Line (Natural'Image (Queue.Num_Bytes_Free) & " bytes free in queue."); Natural_Assert.Eq (Queue.Num_Elements, 0); Natural_Assert.Eq (Queue.Max_Num_Elements, 3); @@ -139,7 +139,7 @@ begin pragma Assert (Pri_Data = (Pri => 1, Data_Type => Bytes_Type)); Put_Line ("len: " & Natural'Image (Len)); Natural_Assert.Eq (Len, 10); - Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), (4, 4, 4, 4, 4, 5, 5, 5, 5, 5)); + Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), [4, 4, 4, 4, 4, 5, 5, 5, 5, 5]); Natural_Assert.Eq (Queue.Num_Elements, 0); Natural_Assert.Eq (Queue.Max_Num_Elements, 3); Put_Line (Natural'Image (Queue.Num_Bytes_Free) & " bytes free in queue."); @@ -150,7 +150,7 @@ begin Put_Line ("item popped."); Put_Line ("len: " & Natural'Image (Len)); Natural_Assert.Eq (Len, 10); - Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), (4, 4, 4, 4, 4, 5, 5, 5, 5, 5)); + Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), [4, 4, 4, 4, 4, 5, 5, 5, 5, 5]); Natural_Assert.Eq (Queue.Num_Elements, 0); Natural_Assert.Eq (Queue.Max_Num_Elements, 3); Put_Line (Natural'Image (Queue.Num_Bytes_Free) & " bytes free in queue."); @@ -164,7 +164,7 @@ begin Put_Line ("item popped."); Put_Line ("len: " & Natural'Image (Len)); Natural_Assert.Eq (Len, 10); - Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), (4, 4, 4, 4, 4, 5, 5, 5, 5, 5)); + Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), [4, 4, 4, 4, 4, 5, 5, 5, 5, 5]); Natural_Assert.Eq (Queue.Num_Elements, 0); Natural_Assert.Eq (Queue.Max_Num_Elements, 3); Put_Line (Natural'Image (Queue.Num_Bytes_Free) & " bytes free in queue."); @@ -184,7 +184,7 @@ begin Put_Line ("item popped."); Put_Line ("len: " & Natural'Image (Len)); Natural_Assert.Eq (Len, 10); - Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), (4, 4, 4, 4, 4, 5, 5, 5, 5, 5)); + Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), [4, 4, 4, 4, 4, 5, 5, 5, 5, 5]); Natural_Assert.Eq (Queue.Num_Elements, 0); Natural_Assert.Eq (Queue.Max_Num_Elements, 3); Put_Line (Natural'Image (Queue.Num_Bytes_Free) & " bytes free in queue."); @@ -217,7 +217,7 @@ begin Pop_Type_Block_Assert.Eq (Pop_Simple_Variable_Block (Queue, Pri_Data, Variable_Var2), Success); pragma Assert (Pri_Data = (Pri => 3, Data_Type => Variable_Type)); Put_Line ("item popped."); - Simple_Variable_Assert.Eq (Variable_Var2, (3, (99, 99, 99, others => 0))); + Simple_Variable_Assert.Eq (Variable_Var2, (3, [99, 99, 99, others => 0])); Natural_Assert.Eq (Queue.Num_Elements, 0); Natural_Assert.Eq (Queue.Max_Num_Elements, 3); Put_Line (Natural'Image (Queue.Num_Bytes_Free) & " bytes free in queue."); @@ -233,7 +233,7 @@ begin Pop_Type_Block_Assert.Eq (Pop_Simple_Variable_Block (Queue, Pri_Data, Variable_Var2), Success); pragma Assert (Pri_Data = (Pri => 3, Data_Type => Variable_Type)); Put_Line ("item popped."); - Simple_Variable_Assert.Eq (Variable_Var2, (3, (99, 99, 99, others => 0))); + Simple_Variable_Assert.Eq (Variable_Var2, (3, [99, 99, 99, others => 0])); Natural_Assert.Eq (Queue.Num_Elements, 0); Natural_Assert.Eq (Queue.Max_Num_Elements, 3); Put_Line (Natural'Image (Queue.Num_Bytes_Free) & " bytes free in queue."); @@ -250,7 +250,7 @@ begin Put_Line ("item popped."); Put_Line ("len: " & Natural'Image (Len)); Natural_Assert.Eq (Len, 6); - Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), (6, 6, 6, 7, 7, 8)); + Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), [6, 6, 6, 7, 7, 8]); Natural_Assert.Eq (Queue.Num_Elements, 0); Natural_Assert.Eq (Queue.Max_Num_Elements, 3); Put_Line (Natural'Image (Queue.Num_Bytes_Free) & " bytes free in queue."); @@ -259,7 +259,7 @@ begin Put_Line ("Filling queue test 2... "); Put_Line (Natural'Image (Queue.Num_Bytes_Free) & " bytes free in queue."); - Push_Assert.Eq (Queue.Push ((Pri => 11, Data_Type => Bytes_Type), (1, 2, 3, 4, 5, 6, 7, 8, 9, 10)), Success); + Push_Assert.Eq (Queue.Push ((Pri => 11, Data_Type => Bytes_Type), [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]), Success); Natural_Assert.Eq (Queue.Num_Elements, 1); Natural_Assert.Eq (Queue.Max_Num_Elements, 3); Put_Line (Natural'Image (Queue.Num_Bytes_Free) & " bytes free in queue."); @@ -269,7 +269,7 @@ begin Natural_Assert.Eq (Queue.Max_Num_Elements, 3); Put_Line (Natural'Image (Queue.Num_Bytes_Free) & " bytes free in queue."); -- Push a variable type: - Push_Variable_Length_Type_Assert.Eq (Push_Simple_Variable (Queue, (Pri => 0, Data_Type => Static_Type), (Length => 21, Buffer => (others => 233))), Serialization_Failure); + Push_Variable_Length_Type_Assert.Eq (Push_Simple_Variable (Queue, (Pri => 0, Data_Type => Static_Type), (Length => 21, Buffer => [others => 233])), Serialization_Failure); Push_Variable_Length_Type_Assert.Eq (Push_Simple_Variable (Queue, (Pri => 12, Data_Type => Static_Type), Variable_Var), Success); Natural_Assert.Eq (Queue.Num_Elements, 3); Natural_Assert.Eq (Queue.Max_Num_Elements, 3); @@ -279,11 +279,11 @@ begin Put_Line ("Blocking push error test... "); -- Push some bytes: - Push_Assert.Eq (Queue.Push ((Pri => 11, Data_Type => Bytes_Type), (1, 2, 3, 4, 5, 6, 7, 8, 9, 10)), Full); + Push_Assert.Eq (Queue.Push ((Pri => 11, Data_Type => Bytes_Type), [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]), Full); Put_Line (Natural'Image (Queue.Num_Bytes_Free) & " bytes free in queue."); Put_Line ("Waiting on full queue... "); The_Action.Set (Push_Error); - Push_Block_Assert.Eq (Queue.Push_Block ((Pri => 12, Data_Type => Bytes_Type), (11, 12, 13, 14, 15, 16, 17, 18, 19, 20)), Success); + Push_Block_Assert.Eq (Queue.Push_Block ((Pri => 12, Data_Type => Bytes_Type), [11, 12, 13, 14, 15, 16, 17, 18, 19, 20]), Success); Put_Line ("pushed item."); Put_Line (Natural'Image (Queue.Num_Bytes_Free) & " bytes free in queue."); Natural_Assert.Eq (Queue.Num_Elements, 3); @@ -300,7 +300,7 @@ begin Push_Variable_Length_Type_Assert.Eq (Push_Simple_Variable (Queue, (Pri => 11, Data_Type => Variable_Type), Variable_Var), Full); Put_Line ("Waiting on full queue... "); The_Action.Set (Push_Error); - Push_Variable_Length_Type_Block_Assert.Eq (Push_Simple_Variable_Block (Queue, (Pri => 11, Data_Type => Variable_Type), (9, (8, 8, 8, 8, 8, 8, 8, 8, 8, others => 255))), Success); + Push_Variable_Length_Type_Block_Assert.Eq (Push_Simple_Variable_Block (Queue, (Pri => 11, Data_Type => Variable_Type), (9, [8, 8, 8, 8, 8, 8, 8, 8, 8, others => 255])), Success); Put_Line ("pushed item."); Natural_Assert.Eq (Queue.Num_Elements, 3); Natural_Assert.Eq (Queue.Max_Num_Elements, 3); diff --git a/src/data_structures/variable_queue/test/global.adb b/src/data_structures/variable_queue/test/global.adb index 8d4c414f..72cf21af 100644 --- a/src/data_structures/variable_queue/test/global.adb +++ b/src/data_structures/variable_queue/test/global.adb @@ -27,7 +27,7 @@ package body Global is One_Second_Later : Ada.Real_Time.Time; Len : Natural; Static_Var : Static.T := (others => 0); - Variable_Var : Simple_Variable.T := (Length => 0, Buffer => (others => 0)); + Variable_Var : Simple_Variable.T := (Length => 0, Buffer => [others => 0]); Bytes : Basic_Types.Byte_Array (0 .. 100); use Ada.Real_Time; use Simple_Variable; @@ -46,10 +46,10 @@ package body Global is Natural_Assert.Eq (Len, 10); Pop_Assert.Eq (Queue.Peek (Bytes, Len, Offset => 2), Success); Natural_Assert.Eq (Len, 8); - Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), (3, 4, 5, 6, 7, 8, 9, 10)); + Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), [3, 4, 5, 6, 7, 8, 9, 10]); Pop_Assert.Eq (Queue.Pop (Bytes, Len, Offset => 1), Success); Natural_Assert.Eq (Len, 9); - Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), (2, 3, 4, 5, 6, 7, 8, 9, 10)); + Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), [2, 3, 4, 5, 6, 7, 8, 9, 10]); Put_Line (Natural'Image (Queue.Num_Bytes_Free) & " bytes free in queue."); when Pop_Static => The_Action.Set (Nothing); @@ -75,17 +75,17 @@ package body Global is Pop_Type_Assert.Eq (Peek_Simple_Variable (Queue, Variable_Var, Offset => 1), Deserialization_Failure); Pop_Type_Assert.Eq (Peek_Simple_Variable (Queue, Variable_Var, Offset => 0), Success); Put_Line ("Peeked: " & Simple_Variable.Representation.Image (Variable_Var)); - Simple_Variable_Assert.Eq (Variable_Var, (6, (10, 9, 8, 7, 6, 5, others => 0))); - Variable_Var := (0, (others => 0)); + Simple_Variable_Assert.Eq (Variable_Var, (6, [10, 9, 8, 7, 6, 5, others => 0])); + Variable_Var := (0, [others => 0]); Pop_Type_Assert.Eq (Pop_Simple_Variable (Queue, Variable_Var, Offset => 0), Success); - Simple_Variable_Assert.Eq (Variable_Var, (6, (10, 9, 8, 7, 6, 5, others => 0))); + Simple_Variable_Assert.Eq (Variable_Var, (6, [10, 9, 8, 7, 6, 5, others => 0])); -- Pop_Assert.eq(queue.Pop, Success); Put_Line (Natural'Image (Queue.Num_Bytes_Free) & " bytes free in queue."); when Push => The_Action.Set (Nothing); delay until One_Second_Later; Put_Line ("Handler adding item to queue."); - Push_Assert.Eq (Queue.Push ((4, 4, 4, 4, 4, 5, 5, 5, 5, 5)), Success); + Push_Assert.Eq (Queue.Push ([4, 4, 4, 4, 4, 5, 5, 5, 5, 5]), Success); Put_Line (Natural'Image (Queue.Num_Bytes_Free) & " bytes free in queue."); when Push_Static => The_Action.Set (Nothing); @@ -97,7 +97,7 @@ package body Global is The_Action.Set (Nothing); delay until One_Second_Later; Put_Line ("Handler adding variable item to queue."); - Push_Variable_Length_Type_Assert.Eq (Push_Simple_Variable (Queue, (3, (99, 99, 99, 99, others => 255))), Success); + Push_Variable_Length_Type_Assert.Eq (Push_Simple_Variable (Queue, (3, [99, 99, 99, 99, others => 255])), Success); Put_Line (Natural'Image (Queue.Num_Bytes_Free) & " bytes free in queue."); when Pop_Error => The_Action.Set (Nothing); @@ -111,14 +111,14 @@ package body Global is Pop_Type_Block_Assert.Eq (Peek_Simple_Variable_Block (Queue, Variable_Var), Error); Pop_Block_Assert.Eq (Queue.Peek_Length_Block (Len), Error); Put_Line ("Error received, now pushing to unblock other task."); - Push_Assert.Eq (Queue.Push ((6, 6, 6, 7, 7, 8)), Success); + Push_Assert.Eq (Queue.Push ([6, 6, 6, 7, 7, 8]), Success); when Push_Error => The_Action.Set (Nothing); delay until One_Second_Later; Put_Line ("Handler pushing from a queue where another task is already blocked."); - Push_Block_Assert.Eq (Queue.Push_Block ((4, 4, 4, 4, 4, 5, 5, 5, 5, 5)), Error); + Push_Block_Assert.Eq (Queue.Push_Block ([4, 4, 4, 4, 4, 5, 5, 5, 5, 5]), Error); Push_Block_Assert.Eq (Push_Static_Block (Queue, (One => 7, Two => 8, Three => 9)), Error); - Push_Variable_Length_Type_Block_Assert.Eq (Push_Simple_Variable_Block (Queue, (3, (99, 99, 99, 99, others => 255))), Error); + Push_Variable_Length_Type_Block_Assert.Eq (Push_Simple_Variable_Block (Queue, (3, [99, 99, 99, 99, others => 255])), Error); Put_Line ("Error received, now popping to unblock other task."); Pop_Assert.Eq (Queue.Pop, Success); when Quit => diff --git a/src/data_structures/variable_queue/test/simple_variable.record.yaml b/src/data_structures/variable_queue/test/simple_variable.record.yaml index 58defc5e..a088bdbe 100644 --- a/src/data_structures/variable_queue/test/simple_variable.record.yaml +++ b/src/data_structures/variable_queue/test/simple_variable.record.yaml @@ -11,5 +11,5 @@ fields: - name: Buffer type: Buffer_Type format: U8x20 - default: (others => 0) + default: "[others => 0]" variable_length: Length diff --git a/src/data_structures/variable_queue/test/test.adb b/src/data_structures/variable_queue/test/test.adb index 2e871e9b..6f1e0e22 100644 --- a/src/data_structures/variable_queue/test/test.adb +++ b/src/data_structures/variable_queue/test/test.adb @@ -17,11 +17,11 @@ procedure Test is Len : Natural; Static_Var : Static.T := (others => 0); Ignore_Static_Var : Static.T := (others => 0); - Variable_Var : constant Simple_Variable.T := (Length => 6, Buffer => (10, 9, 8, 7, 6, 5, others => 255)); - Variable_Var2 : Simple_Variable.T := (Length => 0, Buffer => (others => 0)); - Ignore_Variable_Var2 : Simple_Variable.T := (Length => 0, Buffer => (others => 0)); + Variable_Var : constant Simple_Variable.T := (Length => 6, Buffer => [10, 9, 8, 7, 6, 5, others => 255]); + Variable_Var2 : Simple_Variable.T := (Length => 0, Buffer => [others => 0]); + Ignore_Variable_Var2 : Simple_Variable.T := (Length => 0, Buffer => [others => 0]); Queue_Size : constant Positive := 40; - Queue_Bytes : aliased Basic_Types.Byte_Array := (0 .. Queue_Size - 1 => 0); + Queue_Bytes : aliased Basic_Types.Byte_Array := [0 .. Queue_Size - 1 => 0]; Bytes : Basic_Types.Byte_Array (0 .. 100); begin Put_Line ("Init queue test... "); @@ -43,7 +43,7 @@ begin Put_Line ("Filling queue test... "); Put_Line (Natural'Image (Queue.Num_Bytes_Free) & " bytes free in queue."); - Push_Assert.Eq (Queue.Push ((1, 2, 3, 4, 5, 6, 7, 8, 9, 10)), Success); + Push_Assert.Eq (Queue.Push ([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]), Success); Natural_Assert.Eq (Queue.Num_Elements, 1); Natural_Assert.Eq (Queue.Max_Num_Elements, 1); Put_Line (Natural'Image (Queue.Num_Bytes_Free) & " bytes free in queue."); @@ -55,7 +55,7 @@ begin Put_Line (Natural'Image (Queue.Num_Bytes_Free) & " bytes free in queue."); Put_Line (Basic_Types.Representation.Image (Queue_Bytes)); -- Push a variable type: - Push_Variable_Length_Type_Assert.Eq (Push_Simple_Variable (Queue, (Length => 21, Buffer => (others => 233))), Serialization_Failure); + Push_Variable_Length_Type_Assert.Eq (Push_Simple_Variable (Queue, (Length => 21, Buffer => [others => 233])), Serialization_Failure); Push_Variable_Length_Type_Assert.Eq (Push_Simple_Variable (Queue, Variable_Var), Success); Natural_Assert.Eq (Queue.Num_Elements, 3); Natural_Assert.Eq (Queue.Max_Num_Elements, 3); @@ -66,11 +66,11 @@ begin Put_Line ("Blocking push test... "); -- Push some bytes: - Push_Assert.Eq (Queue.Push ((1, 2, 3, 4, 5, 6, 7, 8, 9, 10)), Too_Full); + Push_Assert.Eq (Queue.Push ([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]), Too_Full); Put_Line (Natural'Image (Queue.Num_Bytes_Free) & " bytes free in queue."); Put_Line ("Waiting on full queue... "); The_Action.Set (Pop); - Push_Block_Assert.Eq (Queue.Push_Block ((11, 12, 13, 14, 15, 16, 17, 18, 19, 20)), Success); + Push_Block_Assert.Eq (Queue.Push_Block ([11, 12, 13, 14, 15, 16, 17, 18, 19, 20]), Success); Put_Line ("pushed item."); Put_Line (Natural'Image (Queue.Num_Bytes_Free) & " bytes free in queue."); Natural_Assert.Eq (Queue.Num_Elements, 3); @@ -95,7 +95,7 @@ begin Push_Variable_Length_Type_Assert.Eq (Push_Simple_Variable (Queue, Variable_Var), Too_Full); Put_Line ("Waiting on full queue... "); The_Action.Set (Pop_Variable); - Push_Variable_Length_Type_Block_Assert.Eq (Push_Simple_Variable_Block (Queue, (9, (8, 8, 8, 8, 8, 8, 8, 8, 8, others => 255))), Success); + Push_Variable_Length_Type_Block_Assert.Eq (Push_Simple_Variable_Block (Queue, (9, [8, 8, 8, 8, 8, 8, 8, 8, 8, others => 255])), Success); Put_Line ("pushed item."); Natural_Assert.Eq (Queue.Num_Elements, 3); Natural_Assert.Eq (Queue.Max_Num_Elements, 3); @@ -109,10 +109,10 @@ begin Natural_Assert.Eq (Len, 10); Pop_Assert.Eq (Queue.Peek (Bytes, Len, Offset => 1), Success); Natural_Assert.Eq (Len, 9); - Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), (12, 13, 14, 15, 16, 17, 18, 19, 20)); + Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), [12, 13, 14, 15, 16, 17, 18, 19, 20]); Pop_Assert.Eq (Queue.Pop (Bytes, Len, Offset => 3), Success); Natural_Assert.Eq (Len, 7); - Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), (14, 15, 16, 17, 18, 19, 20)); + Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), [14, 15, 16, 17, 18, 19, 20]); Put_Line (Natural'Image (Queue.Num_Bytes_Free) & " bytes free in queue."); Natural_Assert.Eq (Queue.Num_Elements, 2); Natural_Assert.Eq (Queue.Max_Num_Elements, 3); @@ -135,9 +135,9 @@ begin -- An offset here wouldn't usually work, but in this case the values of the array make is a success. Pop_Type_Assert.Eq (Peek_Simple_Variable (Queue, Variable_Var2, Offset => 1), Success); Put_Line ("Peeked: " & Simple_Variable.Representation.Image (Variable_Var2)); - Simple_Variable_Assert.Eq (Variable_Var2, (8, (8, 8, 8, 8, 8, 8, 8, 8, others => 0))); + Simple_Variable_Assert.Eq (Variable_Var2, (8, [8, 8, 8, 8, 8, 8, 8, 8, others => 0])); Pop_Type_Assert.Eq (Pop_Simple_Variable (Queue, Variable_Var2, Offset => 0), Success); - Simple_Variable_Assert.Eq (Variable_Var2, (9, (8, 8, 8, 8, 8, 8, 8, 8, 8, others => 0))); + Simple_Variable_Assert.Eq (Variable_Var2, (9, [8, 8, 8, 8, 8, 8, 8, 8, 8, others => 0])); Put_Line (Natural'Image (Queue.Num_Bytes_Free) & " bytes free in queue."); Natural_Assert.Eq (Queue.Num_Elements, 0); Natural_Assert.Eq (Queue.Max_Num_Elements, 3); @@ -155,7 +155,7 @@ begin Put_Line ("item popped."); Put_Line ("len: " & Natural'Image (Len)); Natural_Assert.Eq (Len, 10); - Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), (4, 4, 4, 4, 4, 5, 5, 5, 5, 5)); + Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), [4, 4, 4, 4, 4, 5, 5, 5, 5, 5]); Natural_Assert.Eq (Queue.Num_Elements, 0); Natural_Assert.Eq (Queue.Max_Num_Elements, 3); Put_Line (Natural'Image (Queue.Num_Bytes_Free) & " bytes free in queue."); @@ -165,7 +165,7 @@ begin Put_Line ("item peeked."); Put_Line ("len: " & Natural'Image (Len)); Natural_Assert.Eq (Len, 10); - Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), (4, 4, 4, 4, 4, 5, 5, 5, 5, 5)); + Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), [4, 4, 4, 4, 4, 5, 5, 5, 5, 5]); Natural_Assert.Eq (Queue.Num_Elements, 1); Natural_Assert.Eq (Queue.Max_Num_Elements, 3); Put_Line (Natural'Image (Queue.Num_Bytes_Free) & " bytes free in queue."); @@ -174,7 +174,7 @@ begin Put_Line ("item popped."); Put_Line ("len: " & Natural'Image (Len)); Natural_Assert.Eq (Len, 10); - Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), (4, 4, 4, 4, 4, 5, 5, 5, 5, 5)); + Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), [4, 4, 4, 4, 4, 5, 5, 5, 5, 5]); Natural_Assert.Eq (Queue.Num_Elements, 0); Natural_Assert.Eq (Queue.Max_Num_Elements, 3); Put_Line (Natural'Image (Queue.Num_Bytes_Free) & " bytes free in queue."); @@ -188,7 +188,7 @@ begin Put_Line ("item popped."); Put_Line ("len: " & Natural'Image (Len)); Natural_Assert.Eq (Len, 10); - Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), (4, 4, 4, 4, 4, 5, 5, 5, 5, 5)); + Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), [4, 4, 4, 4, 4, 5, 5, 5, 5, 5]); Natural_Assert.Eq (Queue.Num_Elements, 0); Natural_Assert.Eq (Queue.Max_Num_Elements, 3); Put_Line (Natural'Image (Queue.Num_Bytes_Free) & " bytes free in queue."); @@ -206,7 +206,7 @@ begin Put_Line ("item popped."); Put_Line ("len: " & Natural'Image (Len)); Natural_Assert.Eq (Len, 10); - Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), (4, 4, 4, 4, 4, 5, 5, 5, 5, 5)); + Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), [4, 4, 4, 4, 4, 5, 5, 5, 5, 5]); Natural_Assert.Eq (Queue.Num_Elements, 0); Natural_Assert.Eq (Queue.Max_Num_Elements, 3); Put_Line (Natural'Image (Queue.Num_Bytes_Free) & " bytes free in queue."); @@ -245,7 +245,7 @@ begin The_Action.Set (Push_Variable); Pop_Type_Block_Assert.Eq (Pop_Simple_Variable_Block (Queue, Variable_Var2), Success); Put_Line ("item popped."); - Simple_Variable_Assert.Eq (Variable_Var2, (3, (99, 99, 99, others => 0))); + Simple_Variable_Assert.Eq (Variable_Var2, (3, [99, 99, 99, others => 0])); Natural_Assert.Eq (Queue.Num_Elements, 0); Natural_Assert.Eq (Queue.Max_Num_Elements, 3); Put_Line (Natural'Image (Queue.Num_Bytes_Free) & " bytes free in queue."); @@ -253,14 +253,14 @@ begin The_Action.Set (Push_Variable); Pop_Type_Block_Assert.Eq (Peek_Simple_Variable_Block (Queue, Variable_Var2), Success); Put_Line ("item popped."); - Simple_Variable_Assert.Eq (Variable_Var2, (3, (99, 99, 99, others => 0))); + Simple_Variable_Assert.Eq (Variable_Var2, (3, [99, 99, 99, others => 0])); Natural_Assert.Eq (Queue.Num_Elements, 1); Natural_Assert.Eq (Queue.Max_Num_Elements, 3); Put_Line (Natural'Image (Queue.Num_Bytes_Free) & " bytes free in queue."); Put_Line ("Waiting on nonempty queue (variable)... "); Pop_Type_Block_Assert.Eq (Pop_Simple_Variable_Block (Queue, Variable_Var2), Success); Put_Line ("item popped."); - Simple_Variable_Assert.Eq (Variable_Var2, (3, (99, 99, 99, others => 0))); + Simple_Variable_Assert.Eq (Variable_Var2, (3, [99, 99, 99, others => 0])); Natural_Assert.Eq (Queue.Num_Elements, 0); Natural_Assert.Eq (Queue.Max_Num_Elements, 3); Put_Line (Natural'Image (Queue.Num_Bytes_Free) & " bytes free in queue."); @@ -278,7 +278,7 @@ begin Put_Line ("item popped."); Put_Line ("len: " & Natural'Image (Len)); Natural_Assert.Eq (Len, 6); - Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), (6, 6, 6, 7, 7, 8)); + Byte_Array_Assert.Eq (Bytes (0 .. Len - 1), [6, 6, 6, 7, 7, 8]); Natural_Assert.Eq (Queue.Num_Elements, 0); Natural_Assert.Eq (Queue.Max_Num_Elements, 3); Put_Line (Natural'Image (Queue.Num_Bytes_Free) & " bytes free in queue."); @@ -287,7 +287,7 @@ begin Put_Line ("Filling queue test 2... "); Put_Line (Natural'Image (Queue.Num_Bytes_Free) & " bytes free in queue."); - Push_Assert.Eq (Queue.Push ((1, 2, 3, 4, 5, 6, 7, 8, 9, 10)), Success); + Push_Assert.Eq (Queue.Push ([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]), Success); Natural_Assert.Eq (Queue.Num_Elements, 1); Natural_Assert.Eq (Queue.Max_Num_Elements, 3); Put_Line (Natural'Image (Queue.Num_Bytes_Free) & " bytes free in queue."); @@ -299,7 +299,7 @@ begin Put_Line (Natural'Image (Queue.Num_Bytes_Free) & " bytes free in queue."); Put_Line (Basic_Types.Representation.Image (Queue_Bytes)); -- Push a variable type: - Push_Variable_Length_Type_Assert.Eq (Push_Simple_Variable (Queue, (Length => 21, Buffer => (others => 233))), Serialization_Failure); + Push_Variable_Length_Type_Assert.Eq (Push_Simple_Variable (Queue, (Length => 21, Buffer => [others => 233])), Serialization_Failure); Push_Variable_Length_Type_Assert.Eq (Push_Simple_Variable (Queue, Variable_Var), Success); Natural_Assert.Eq (Queue.Num_Elements, 3); Natural_Assert.Eq (Queue.Max_Num_Elements, 3); @@ -310,11 +310,11 @@ begin Put_Line ("Blocking push error test... "); -- Push some bytes: - Push_Assert.Eq (Queue.Push ((1, 2, 3, 4, 5, 6, 7, 8, 9, 10)), Too_Full); + Push_Assert.Eq (Queue.Push ([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]), Too_Full); Put_Line (Natural'Image (Queue.Num_Bytes_Free) & " bytes free in queue."); Put_Line ("Waiting on full queue... "); The_Action.Set (Push_Error); - Push_Block_Assert.Eq (Queue.Push_Block ((11, 12, 13, 14, 15, 16, 17, 18, 19, 20)), Success); + Push_Block_Assert.Eq (Queue.Push_Block ([11, 12, 13, 14, 15, 16, 17, 18, 19, 20]), Success); Put_Line ("pushed item."); Put_Line (Natural'Image (Queue.Num_Bytes_Free) & " bytes free in queue."); Natural_Assert.Eq (Queue.Num_Elements, 3); @@ -339,7 +339,7 @@ begin Push_Variable_Length_Type_Assert.Eq (Push_Simple_Variable (Queue, Variable_Var), Too_Full); Put_Line ("Waiting on full queue... "); The_Action.Set (Push_Error); - Push_Variable_Length_Type_Block_Assert.Eq (Push_Simple_Variable_Block (Queue, (9, (8, 8, 8, 8, 8, 8, 8, 8, 8, others => 255))), Success); + Push_Variable_Length_Type_Block_Assert.Eq (Push_Simple_Variable_Block (Queue, (9, [8, 8, 8, 8, 8, 8, 8, 8, 8, others => 255])), Success); Put_Line ("pushed item."); Natural_Assert.Eq (Queue.Num_Elements, 3); Natural_Assert.Eq (Queue.Max_Num_Elements, 3); diff --git a/src/types/memory/byte_array_pointer.adb b/src/types/memory/byte_array_pointer.adb index 93ca92ac..b021745f 100644 --- a/src/types/memory/byte_array_pointer.adb +++ b/src/types/memory/byte_array_pointer.adb @@ -25,7 +25,7 @@ package body Byte_Array_Pointer is Data := new Basic_Types.Byte_Array (0 .. (Size - 1)); if Init_To_Zero then - Data.all := (others => 0); + Data.all := [others => 0]; end if; -- Convert the Byte array access to a diff --git a/src/types/memory/test/test.adb b/src/types/memory/test/test.adb index 6d2617aa..6259c615 100644 --- a/src/types/memory/test/test.adb +++ b/src/types/memory/test/test.adb @@ -12,14 +12,14 @@ procedure Test is -- Local vars: Heap_Ptr : Byte_Array_Pointer.Instance; Data_Ptr : Byte_Array_Pointer.Instance; - B_Array : aliased Byte_Array := (0, 0, 0, 0, 0); - Data_In : constant Byte_Array (0 .. 9) := (1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - Data_Out : Byte_Array (0 .. 9) := (others => 0); + B_Array : aliased Byte_Array := [0, 0, 0, 0, 0]; + Data_In : constant Byte_Array (0 .. 9) := [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; + Data_Out : Byte_Array (0 .. 9) := [others => 0]; procedure Go (Ptr : in out Byte_Array_Pointer.Instance) is procedure Reset_Buffer is begin - Copy_To (Ptr, (0, 0, 0, 0, 0)); + Copy_To (Ptr, [0, 0, 0, 0, 0]); end Reset_Buffer; procedure Print_Data is @@ -29,7 +29,7 @@ procedure Test is procedure Reset_Data is begin - Data_Out := (others => 0); + Data_Out := [others => 0]; end Reset_Data; The_Slice : Byte_Array_Pointer.Instance; begin @@ -37,7 +37,7 @@ procedure Test is Put_Line ("Test copy to ptr full"); Copy_To (Ptr, Data_In (0 .. 4)); Put_Line (Byte_Array_Pointer.Representation.Image (Ptr)); - Byte_Array_Pointer_Assert.Eq (Ptr, (1, 2, 3, 4, 5)); + Byte_Array_Pointer_Assert.Eq (Ptr, [1, 2, 3, 4, 5]); Reset_Buffer; Put_Line ("Passed."); New_Line; @@ -46,36 +46,36 @@ procedure Test is The_Slice := Slice (Ptr, 0, 3); Copy_To (The_Slice, Data_In (0 .. 3)); Put_Line (Byte_Array_Pointer.Representation.Image (Ptr)); - Byte_Array_Pointer_Assert.Eq (Ptr, (1, 2, 3, 4, 0)); + Byte_Array_Pointer_Assert.Eq (Ptr, [1, 2, 3, 4, 0]); Reset_Buffer; Put_Line ("Passed."); New_Line; Put_Line ("Test copy to buffer beginning"); The_Slice := Slice (Ptr, 0, 2); - Copy_To (The_Slice, (1, 2, 3)); + Copy_To (The_Slice, [1, 2, 3]); Put_Line (Byte_Array_Pointer.Representation.Image (Ptr)); - Byte_Array_Pointer_Assert.Eq (Ptr, (1, 2, 3, 0, 0)); + Byte_Array_Pointer_Assert.Eq (Ptr, [1, 2, 3, 0, 0]); Reset_Buffer; Put_Line ("Passed."); New_Line; Put_Line ("Test copy to buffer middle"); The_Slice := Slice (Ptr, 1); - Copy_To (The_Slice, (1, 2, 3, 0)); + Copy_To (The_Slice, [1, 2, 3, 0]); Put_Line (Byte_Array_Pointer.Representation.Image (Ptr)); - Byte_Array_Pointer_Assert.Eq (The_Slice, (1, 2, 3, 0)); - Byte_Array_Pointer_Assert.Eq (Ptr, (0, 1, 2, 3, 0)); + Byte_Array_Pointer_Assert.Eq (The_Slice, [1, 2, 3, 0]); + Byte_Array_Pointer_Assert.Eq (Ptr, [0, 1, 2, 3, 0]); Reset_Buffer; Put_Line ("Passed."); New_Line; Put_Line ("Test copy to buffer end"); The_Slice := Slice (Ptr, 3); - Copy_To (The_Slice, (1, 2)); + Copy_To (The_Slice, [1, 2]); Put_Line (Byte_Array_Pointer.Representation.Image (Ptr)); - Byte_Array_Pointer_Assert.Eq (The_Slice, (1, 2)); - Byte_Array_Pointer_Assert.Eq (Ptr, (0, 0, 0, 1, 2)); + Byte_Array_Pointer_Assert.Eq (The_Slice, [1, 2]); + Byte_Array_Pointer_Assert.Eq (Ptr, [0, 0, 0, 1, 2]); Reset_Buffer; Put_Line ("Passed."); New_Line; @@ -84,7 +84,7 @@ procedure Test is The_Slice := Slice (Ptr, 3, 3); Copy_To (The_Slice, Data_In (4 .. 4)); Put_Line (Byte_Array_Pointer.Representation.Image (Ptr)); - Byte_Array_Pointer_Assert.Eq (Ptr, (0, 0, 0, 5, 0)); + Byte_Array_Pointer_Assert.Eq (Ptr, [0, 0, 0, 5, 0]); Reset_Buffer; Put_Line ("Passed."); New_Line; @@ -93,12 +93,12 @@ procedure Test is The_Slice := Slice (Ptr, 3, 2); Copy_To (The_Slice, Data_In (4 .. 3)); Put_Line (Byte_Array_Pointer.Representation.Image (Ptr)); - Byte_Array_Pointer_Assert.Eq (Ptr, (0, 0, 0, 0, 0)); + Byte_Array_Pointer_Assert.Eq (Ptr, [0, 0, 0, 0, 0]); Reset_Buffer; The_Slice := Slice (Ptr, 19, 2); Copy_To (The_Slice, Data_In (4 .. 3)); Put_Line (Byte_Array_Pointer.Representation.Image (Ptr)); - Byte_Array_Pointer_Assert.Eq (Ptr, (0, 0, 0, 0, 0)); + Byte_Array_Pointer_Assert.Eq (Ptr, [0, 0, 0, 0, 0]); Reset_Buffer; Put_Line ("Passed."); New_Line; @@ -107,14 +107,14 @@ procedure Test is The_Slice := Slice (Ptr, 0, 4); Copy_To (The_Slice, Data_In (0 .. 4)); Put_Line (Byte_Array_Pointer.Representation.Image (Ptr)); - Byte_Array_Pointer_Assert.Eq (Ptr, (1, 2, 3, 4, 5)); + Byte_Array_Pointer_Assert.Eq (Ptr, [1, 2, 3, 4, 5]); Put_Line ("Passed."); New_Line; Put_Line ("Test copy from buffer full"); Data_Out (0 .. 4) := To_Byte_Array (Ptr); Print_Data; - pragma Assert (Data_Out = (1, 2, 3, 4, 5, 0, 0, 0, 0, 0)); + pragma Assert (Data_Out = [1, 2, 3, 4, 5, 0, 0, 0, 0, 0]); Reset_Data; Put_Line ("Passed."); New_Line; @@ -123,7 +123,7 @@ procedure Test is The_Slice := Slice (Ptr, 0, 4); Data_Out (0 .. 4) := To_Byte_Array (The_Slice); Print_Data; - pragma Assert (Data_Out = (1, 2, 3, 4, 5, 0, 0, 0, 0, 0)); + pragma Assert (Data_Out = [1, 2, 3, 4, 5, 0, 0, 0, 0, 0]); Reset_Data; Put_Line ("Passed."); New_Line; @@ -132,7 +132,7 @@ procedure Test is The_Slice := Slice (Ptr, 0, 3); Data_Out (0 .. 3) := To_Byte_Array (The_Slice); Print_Data; - pragma Assert (Data_Out = (1, 2, 3, 4, 0, 0, 0, 0, 0, 0)); + pragma Assert (Data_Out = [1, 2, 3, 4, 0, 0, 0, 0, 0, 0]); Reset_Data; Put_Line ("Passed."); New_Line; @@ -141,7 +141,7 @@ procedure Test is The_Slice := Slice (Ptr, 1, 3); Data_Out (1 .. 3) := To_Byte_Array (The_Slice); Print_Data; - pragma Assert (Data_Out = (0, 2, 3, 4, 0, 0, 0, 0, 0, 0)); + pragma Assert (Data_Out = [0, 2, 3, 4, 0, 0, 0, 0, 0, 0]); Reset_Data; Put_Line ("Passed."); New_Line; @@ -153,7 +153,7 @@ procedure Test is Put_Line (Natural'Image (To_Byte_Array (The_Slice)'Last)); Data_Out (0 .. 1) := To_Byte_Array (The_Slice); Print_Data; - pragma Assert (Data_Out = (4, 5, 0, 0, 0, 0, 0, 0, 0, 0)); + pragma Assert (Data_Out = [4, 5, 0, 0, 0, 0, 0, 0, 0, 0]); Reset_Data; Put_Line ("Passed."); New_Line; diff --git a/src/types/memory/test_serialization/simple_variable.record.yaml b/src/types/memory/test_serialization/simple_variable.record.yaml index 58defc5e..a088bdbe 100644 --- a/src/types/memory/test_serialization/simple_variable.record.yaml +++ b/src/types/memory/test_serialization/simple_variable.record.yaml @@ -11,5 +11,5 @@ fields: - name: Buffer type: Buffer_Type format: U8x20 - default: (others => 0) + default: "[others => 0]" variable_length: Length diff --git a/src/types/memory/test_serialization/test.adb b/src/types/memory/test_serialization/test.adb index 0fe82acc..49e4c5f1 100644 --- a/src/types/memory/test_serialization/test.adb +++ b/src/types/memory/test_serialization/test.adb @@ -16,7 +16,7 @@ procedure Test is -- Local vars: Heap_Ptr : Byte_Array_Pointer.Instance; Data_Ptr : Byte_Array_Pointer.Instance; - B_Array : aliased Byte_Array := (0 .. 49 => 0); + B_Array : aliased Byte_Array := [0 .. 49 => 0]; procedure Go (Ptr : in out Byte_Array_Pointer.Instance) is The_Slice : Byte_Array_Pointer.Instance; @@ -31,9 +31,9 @@ procedure Test is -- Vars: Static_Var : aliased Static.T := (3, 2, 1); - Variable_Var : aliased Simple_Variable.T := (Length => 6, Buffer => (10, 9, 8, 7, 6, 5, others => 255)); - Variable_Var_Bad : aliased Simple_Variable.T := (Length => 255, Buffer => (10, 9, 8, 7, 6, 5, others => 255)); - Variable_Var2 : Simple_Variable.T := (Length => 0, Buffer => (others => 0)); + Variable_Var : aliased Simple_Variable.T := (Length => 6, Buffer => [10, 9, 8, 7, 6, 5, others => 255]); + Variable_Var_Bad : aliased Simple_Variable.T := (Length => 255, Buffer => [10, 9, 8, 7, 6, 5, others => 255]); + Variable_Var2 : Simple_Variable.T := (Length => 0, Buffer => [others => 0]); Bytes : Simple_Variable.Serialization.Byte_Array; Stat : Serialization_Status; Num_Bytes : Natural; diff --git a/src/types/sequence/sequence_util.adb b/src/types/sequence/sequence_util.adb index 87f1f598..a71d3e28 100644 --- a/src/types/sequence/sequence_util.adb +++ b/src/types/sequence/sequence_util.adb @@ -5,8 +5,8 @@ package body Sequence_Util is function Crc_Sequence_Memory_Region (Region : in Memory_Region.T; Seq_Header : out Sequence_Header.T; Computed_Crc : out Crc_16.Crc_16_Type) return Crc_Status is begin -- Initialize CRC output params: - Seq_Header := (Crc => (0, 0), Version => 0, Category => 0, Id => 0, Length => 0); - Computed_Crc := (0, 0); + Seq_Header := (Crc => [0, 0], Version => 0, Category => 0, Id => 0, Length => 0); + Computed_Crc := [0, 0]; -- Check the length and make sure it is large enough to hold a sequence header: if Region.Length < Sequence_Header.Size_In_Bytes then diff --git a/src/util/byte_array_util/byte_array_util.adb b/src/util/byte_array_util/byte_array_util.adb index 76bd78da..0d57b0e4 100644 --- a/src/util/byte_array_util/byte_array_util.adb +++ b/src/util/byte_array_util/byte_array_util.adb @@ -75,7 +75,7 @@ package body Byte_Array_Util is function Extract_Poly_Type (Src : in Byte_Array; Offset : in Natural; Size : in Positive; Is_Signed : in Boolean; Value : out Poly_32_Type) return Extract_Poly_Type_Status is begin -- Initialize out parameter: - Value := (0, 0, 0, 0); + Value := [0, 0, 0, 0]; -- Validate offset and size. Size must be <= 32 bits. The size + offset must not overflow -- the size of the byte array. Size must be greater than zero. @@ -184,12 +184,12 @@ package body Byte_Array_Util is declare Value_Int_Trunc : constant Unsigned_32 := Value_Int and Limit; begin - Value_To_Set := ( + Value_To_Set := [ 3 => Unsigned_8 (Value_Int_Trunc and 16#FF#), 2 => Unsigned_8 (Shift_Right (Value_Int_Trunc, 8) and 16#FF#), 1 => Unsigned_8 (Shift_Right (Value_Int_Trunc, 16) and 16#FF#), 0 => Unsigned_8 (Shift_Right (Value_Int_Trunc, 24) and 16#FF#) - ); + ]; end; else return Truncation_Error; diff --git a/src/util/byte_array_util/test/byte_array_util_tests-implementation.adb b/src/util/byte_array_util/test/byte_array_util_tests-implementation.adb index 6d59fd8f..b6c575fe 100644 --- a/src/util/byte_array_util/test/byte_array_util_tests-implementation.adb +++ b/src/util/byte_array_util/test/byte_array_util_tests-implementation.adb @@ -37,146 +37,146 @@ package body Byte_Array_Util_Tests.Implementation is Val : Basic_Types.Poly_32_Type; begin -- Test extractions that end on byte boundaries: - Extract_Status_Assert.Eq (Extract_Poly_Type (Src => (1, 2, 3, 4, 5, 6, 7), Offset => 0, Size => 32, Is_Signed => False, Value => Val), Success); - Byte_Array_Assert.Eq (Val, (1, 2, 3, 4)); - Extract_Status_Assert.Eq (Extract_Poly_Type (Src => (1, 2, 3, 4, 5, 6, 7), Offset => 8, Size => 32, Is_Signed => False, Value => Val), Success); - Byte_Array_Assert.Eq (Val, (2, 3, 4, 5)); - Extract_Status_Assert.Eq (Extract_Poly_Type (Src => (1, 2, 3, 4, 5, 6, 7), Offset => 8, Size => 24, Is_Signed => False, Value => Val), Success); - Byte_Array_Assert.Eq (Val, (0, 2, 3, 4)); - Extract_Status_Assert.Eq (Extract_Poly_Type (Src => (1, 2, 3, 4, 5, 6, 7), Offset => 16, Size => 16, Is_Signed => False, Value => Val), Success); - Byte_Array_Assert.Eq (Val, (0, 0, 3, 4)); - Extract_Status_Assert.Eq (Extract_Poly_Type (Src => (1, 2, 3, 4, 5, 6, 7), Offset => 32, Size => 8, Is_Signed => False, Value => Val), Success); - Byte_Array_Assert.Eq (Val, (0, 0, 0, 5)); + Extract_Status_Assert.Eq (Extract_Poly_Type (Src => [1, 2, 3, 4, 5, 6, 7], Offset => 0, Size => 32, Is_Signed => False, Value => Val), Success); + Byte_Array_Assert.Eq (Val, [1, 2, 3, 4]); + Extract_Status_Assert.Eq (Extract_Poly_Type (Src => [1, 2, 3, 4, 5, 6, 7], Offset => 8, Size => 32, Is_Signed => False, Value => Val), Success); + Byte_Array_Assert.Eq (Val, [2, 3, 4, 5]); + Extract_Status_Assert.Eq (Extract_Poly_Type (Src => [1, 2, 3, 4, 5, 6, 7], Offset => 8, Size => 24, Is_Signed => False, Value => Val), Success); + Byte_Array_Assert.Eq (Val, [0, 2, 3, 4]); + Extract_Status_Assert.Eq (Extract_Poly_Type (Src => [1, 2, 3, 4, 5, 6, 7], Offset => 16, Size => 16, Is_Signed => False, Value => Val), Success); + Byte_Array_Assert.Eq (Val, [0, 0, 3, 4]); + Extract_Status_Assert.Eq (Extract_Poly_Type (Src => [1, 2, 3, 4, 5, 6, 7], Offset => 32, Size => 8, Is_Signed => False, Value => Val), Success); + Byte_Array_Assert.Eq (Val, [0, 0, 0, 5]); -- Test extractions that do not end on byte boundaries: - Extract_Status_Assert.Eq (Extract_Poly_Type (Src => (0 => 255), Offset => 0, Size => 1, Is_Signed => False, Value => Val), Success); - Byte_Array_Assert.Eq (Val, (0, 0, 0, 1)); - Extract_Status_Assert.Eq (Extract_Poly_Type (Src => (0 => 255, 1 => 255), Offset => 8, Size => 1, Is_Signed => False, Value => Val), Success); - Byte_Array_Assert.Eq (Val, (0, 0, 0, 1)); - Extract_Status_Assert.Eq (Extract_Poly_Type (Src => (0 => 255, 1 => 255), Offset => 5, Size => 5, Is_Signed => False, Value => Val), Success); - Byte_Array_Assert.Eq (Val, (0, 0, 0, 16#1F#)); - Extract_Status_Assert.Eq (Extract_Poly_Type (Src => (0 => 255, 1 => 255, 2 => 255, 3 => 255), Offset => 11, Size => 12, Is_Signed => False, Value => Val), Success); - Byte_Array_Assert.Eq (Val, (0, 0, 16#0F#, 16#FF#)); - Extract_Status_Assert.Eq (Extract_Poly_Type (Src => (0 => 233, 1 => 255, 2 => 235, 3 => 255), Offset => 10, Size => 12, Is_Signed => False, Value => Val), Success); - Byte_Array_Assert.Eq (Val, (0, 0, 16#0F#, 16#FA#)); - Extract_Status_Assert.Eq (Extract_Poly_Type (Src => (0 => 16#55#, 1 => 16#AA#, 2 => 16#55#, 3 => 16#AA#), Offset => 4, Size => 8, Is_Signed => False, Value => Val), Success); - Byte_Array_Assert.Eq (Val, (0, 0, 16#00#, 16#5A#)); - Extract_Status_Assert.Eq (Extract_Poly_Type (Src => (0 => 16#55#, 1 => 16#AA#, 2 => 16#55#, 3 => 16#AA#), Offset => 4, Size => 16, Is_Signed => False, Value => Val), Success); - Byte_Array_Assert.Eq (Val, (0, 0, 16#5A#, 16#A5#)); - Extract_Status_Assert.Eq (Extract_Poly_Type (Src => (0 => 16#55#, 1 => 16#AA#, 2 => 16#55#, 3 => 16#AA#), Offset => 3, Size => 16, Is_Signed => False, Value => Val), Success); - Byte_Array_Assert.Eq (Val, (0, 0, 16#AD#, 16#52#)); - Extract_Status_Assert.Eq (Extract_Poly_Type (Src => (0 => 16#55#, 1 => 16#AA#, 2 => 16#55#, 3 => 16#AA#), Offset => 2, Size => 17, Is_Signed => False, Value => Val), Success); - Byte_Array_Assert.Eq (Val, (0, 0, 16#AD#, 16#52#)); - Extract_Status_Assert.Eq (Extract_Poly_Type (Src => (0 => 16#55#, 1 => 16#AA#, 2 => 16#55#, 3 => 16#AA#), Offset => 3, Size => 17, Is_Signed => False, Value => Val), Success); - Byte_Array_Assert.Eq (Val, (0, 1, 16#5A#, 16#A5#)); - Extract_Status_Assert.Eq (Extract_Poly_Type (Src => (0 => 16#55#, 1 => 16#AA#, 2 => 16#55#, 3 => 16#AA#), Offset => 0, Size => 9, Is_Signed => False, Value => Val), Success); - Byte_Array_Assert.Eq (Val, (0, 0, 0, 16#AB#)); - Extract_Status_Assert.Eq (Extract_Poly_Type (Src => (0 => 16#2#), Offset => 6, Size => 2, Is_Signed => False, Value => Val), Success); - Byte_Array_Assert.Eq (Val, (0, 0, 0, 16#2#)); + Extract_Status_Assert.Eq (Extract_Poly_Type (Src => [0 => 255], Offset => 0, Size => 1, Is_Signed => False, Value => Val), Success); + Byte_Array_Assert.Eq (Val, [0, 0, 0, 1]); + Extract_Status_Assert.Eq (Extract_Poly_Type (Src => [0 => 255, 1 => 255], Offset => 8, Size => 1, Is_Signed => False, Value => Val), Success); + Byte_Array_Assert.Eq (Val, [0, 0, 0, 1]); + Extract_Status_Assert.Eq (Extract_Poly_Type (Src => [0 => 255, 1 => 255], Offset => 5, Size => 5, Is_Signed => False, Value => Val), Success); + Byte_Array_Assert.Eq (Val, [0, 0, 0, 16#1F#]); + Extract_Status_Assert.Eq (Extract_Poly_Type (Src => [0 => 255, 1 => 255, 2 => 255, 3 => 255], Offset => 11, Size => 12, Is_Signed => False, Value => Val), Success); + Byte_Array_Assert.Eq (Val, [0, 0, 16#0F#, 16#FF#]); + Extract_Status_Assert.Eq (Extract_Poly_Type (Src => [0 => 233, 1 => 255, 2 => 235, 3 => 255], Offset => 10, Size => 12, Is_Signed => False, Value => Val), Success); + Byte_Array_Assert.Eq (Val, [0, 0, 16#0F#, 16#FA#]); + Extract_Status_Assert.Eq (Extract_Poly_Type (Src => [0 => 16#55#, 1 => 16#AA#, 2 => 16#55#, 3 => 16#AA#], Offset => 4, Size => 8, Is_Signed => False, Value => Val), Success); + Byte_Array_Assert.Eq (Val, [0, 0, 16#00#, 16#5A#]); + Extract_Status_Assert.Eq (Extract_Poly_Type (Src => [0 => 16#55#, 1 => 16#AA#, 2 => 16#55#, 3 => 16#AA#], Offset => 4, Size => 16, Is_Signed => False, Value => Val), Success); + Byte_Array_Assert.Eq (Val, [0, 0, 16#5A#, 16#A5#]); + Extract_Status_Assert.Eq (Extract_Poly_Type (Src => [0 => 16#55#, 1 => 16#AA#, 2 => 16#55#, 3 => 16#AA#], Offset => 3, Size => 16, Is_Signed => False, Value => Val), Success); + Byte_Array_Assert.Eq (Val, [0, 0, 16#AD#, 16#52#]); + Extract_Status_Assert.Eq (Extract_Poly_Type (Src => [0 => 16#55#, 1 => 16#AA#, 2 => 16#55#, 3 => 16#AA#], Offset => 2, Size => 17, Is_Signed => False, Value => Val), Success); + Byte_Array_Assert.Eq (Val, [0, 0, 16#AD#, 16#52#]); + Extract_Status_Assert.Eq (Extract_Poly_Type (Src => [0 => 16#55#, 1 => 16#AA#, 2 => 16#55#, 3 => 16#AA#], Offset => 3, Size => 17, Is_Signed => False, Value => Val), Success); + Byte_Array_Assert.Eq (Val, [0, 1, 16#5A#, 16#A5#]); + Extract_Status_Assert.Eq (Extract_Poly_Type (Src => [0 => 16#55#, 1 => 16#AA#, 2 => 16#55#, 3 => 16#AA#], Offset => 0, Size => 9, Is_Signed => False, Value => Val), Success); + Byte_Array_Assert.Eq (Val, [0, 0, 0, 16#AB#]); + Extract_Status_Assert.Eq (Extract_Poly_Type (Src => [0 => 16#2#], Offset => 6, Size => 2, Is_Signed => False, Value => Val), Success); + Byte_Array_Assert.Eq (Val, [0, 0, 0, 16#2#]); -- Test illegal extractions: - Extract_Status_Assert.Eq (Extract_Poly_Type (Src => (0 => 16#55#, 1 => 16#AA#, 2 => 16#55#, 3 => 16#AA#), Offset => 0, Size => 33, Is_Signed => False, Value => Val), Error); - Extract_Status_Assert.Eq (Extract_Poly_Type (Src => (0 => 16#55#, 1 => 16#AA#, 2 => 16#55#, 3 => 16#AA#), Offset => 0, Size => 34, Is_Signed => False, Value => Val), Error); - Extract_Status_Assert.Eq (Extract_Poly_Type (Src => (0 => 16#55#, 1 => 16#AA#, 2 => 16#55#, 3 => 16#AA#), Offset => 0, Size => 99, Is_Signed => False, Value => Val), Error); - Extract_Status_Assert.Eq (Extract_Poly_Type (Src => (0 => 16#55#, 1 => 16#AA#, 2 => 16#55#, 3 => 16#AA#), Offset => 1, Size => 32, Is_Signed => False, Value => Val), Error); - Extract_Status_Assert.Eq (Extract_Poly_Type (Src => (0 => 16#55#, 1 => 16#AA#, 2 => 16#55#, 3 => 16#AA#), Offset => 5, Size => 29, Is_Signed => False, Value => Val), Error); - Extract_Status_Assert.Eq (Extract_Poly_Type (Src => (0 => 16#55#, 1 => 16#AA#, 2 => 16#55#, 3 => 16#AA#), Offset => 32, Size => 1, Is_Signed => False, Value => Val), Error); - Extract_Status_Assert.Eq (Extract_Poly_Type (Src => (0 => 16#55#, 1 => 16#AA#, 2 => 16#55#), Offset => 24, Size => 1, Is_Signed => False, Value => Val), Error); - Extract_Status_Assert.Eq (Extract_Poly_Type (Src => (0 => 16#55#, 1 => 16#AA#), Offset => 14, Size => 3, Is_Signed => False, Value => Val), Error); - Extract_Status_Assert.Eq (Extract_Poly_Type (Src => (0 => 16#55#, 1 => 16#AA#), Offset => 16, Size => 1, Is_Signed => False, Value => Val), Error); - Extract_Status_Assert.Eq (Extract_Poly_Type (Src => (0 => 16#55#, 1 => 16#AA#), Offset => 0, Size => 17, Is_Signed => False, Value => Val), Error); - Extract_Status_Assert.Eq (Extract_Poly_Type (Src => (1, 2, 3, 4, 5, 6, 7), Offset => 50, Size => 7, Is_Signed => False, Value => Val), Error); + Extract_Status_Assert.Eq (Extract_Poly_Type (Src => [0 => 16#55#, 1 => 16#AA#, 2 => 16#55#, 3 => 16#AA#], Offset => 0, Size => 33, Is_Signed => False, Value => Val), Error); + Extract_Status_Assert.Eq (Extract_Poly_Type (Src => [0 => 16#55#, 1 => 16#AA#, 2 => 16#55#, 3 => 16#AA#], Offset => 0, Size => 34, Is_Signed => False, Value => Val), Error); + Extract_Status_Assert.Eq (Extract_Poly_Type (Src => [0 => 16#55#, 1 => 16#AA#, 2 => 16#55#, 3 => 16#AA#], Offset => 0, Size => 99, Is_Signed => False, Value => Val), Error); + Extract_Status_Assert.Eq (Extract_Poly_Type (Src => [0 => 16#55#, 1 => 16#AA#, 2 => 16#55#, 3 => 16#AA#], Offset => 1, Size => 32, Is_Signed => False, Value => Val), Error); + Extract_Status_Assert.Eq (Extract_Poly_Type (Src => [0 => 16#55#, 1 => 16#AA#, 2 => 16#55#, 3 => 16#AA#], Offset => 5, Size => 29, Is_Signed => False, Value => Val), Error); + Extract_Status_Assert.Eq (Extract_Poly_Type (Src => [0 => 16#55#, 1 => 16#AA#, 2 => 16#55#, 3 => 16#AA#], Offset => 32, Size => 1, Is_Signed => False, Value => Val), Error); + Extract_Status_Assert.Eq (Extract_Poly_Type (Src => [0 => 16#55#, 1 => 16#AA#, 2 => 16#55#], Offset => 24, Size => 1, Is_Signed => False, Value => Val), Error); + Extract_Status_Assert.Eq (Extract_Poly_Type (Src => [0 => 16#55#, 1 => 16#AA#], Offset => 14, Size => 3, Is_Signed => False, Value => Val), Error); + Extract_Status_Assert.Eq (Extract_Poly_Type (Src => [0 => 16#55#, 1 => 16#AA#], Offset => 16, Size => 1, Is_Signed => False, Value => Val), Error); + Extract_Status_Assert.Eq (Extract_Poly_Type (Src => [0 => 16#55#, 1 => 16#AA#], Offset => 0, Size => 17, Is_Signed => False, Value => Val), Error); + Extract_Status_Assert.Eq (Extract_Poly_Type (Src => [1, 2, 3, 4, 5, 6, 7], Offset => 50, Size => 7, Is_Signed => False, Value => Val), Error); -- Some more point tests: - Extract_Status_Assert.Eq (Extract_Poly_Type (Src => (0 => 2#00000100#), Offset => 4, Size => 2, Is_Signed => False, Value => Val), Success); - Byte_Array_Assert.Eq (Val, (0, 0, 0, 1)); - Extract_Status_Assert.Eq (Extract_Poly_Type (Src => (0 => 2#00001100#), Offset => 4, Size => 2, Is_Signed => False, Value => Val), Success); - Byte_Array_Assert.Eq (Val, (0, 0, 0, 3)); - Extract_Status_Assert.Eq (Extract_Poly_Type (Src => (0 => 2#00101100#), Offset => 0, Size => 4, Is_Signed => False, Value => Val), Success); - Byte_Array_Assert.Eq (Val, (0, 0, 0, 2)); + Extract_Status_Assert.Eq (Extract_Poly_Type (Src => [0 => 2#00000100#], Offset => 4, Size => 2, Is_Signed => False, Value => Val), Success); + Byte_Array_Assert.Eq (Val, [0, 0, 0, 1]); + Extract_Status_Assert.Eq (Extract_Poly_Type (Src => [0 => 2#00001100#], Offset => 4, Size => 2, Is_Signed => False, Value => Val), Success); + Byte_Array_Assert.Eq (Val, [0, 0, 0, 3]); + Extract_Status_Assert.Eq (Extract_Poly_Type (Src => [0 => 2#00101100#], Offset => 0, Size => 4, Is_Signed => False, Value => Val), Success); + Byte_Array_Assert.Eq (Val, [0, 0, 0, 2]); end Test_Extract; -- This test makes sure the set polytype function works as expected. overriding procedure Test_Set (Self : in out Instance) is Ignore_Self : Instance renames Self; use Byte_Array_Util; - Bytes : Basic_Types.Byte_Array := (2 .. 11 => 0); + Bytes : Basic_Types.Byte_Array := [2 .. 11 => 0]; begin -- Test extractions that end on byte boundaries: - Set_Status_Assert.Eq (Set_Poly_Type (Dest => Bytes, Offset => 0, Size => 32, Value => (1, 2, 3, 4)), Success); - Byte_Array_Assert.Eq (Bytes, (0 => 1, 1 => 2, 2 => 3, 3 => 4, 4 .. 9 => 0)); - Set_Status_Assert.Eq (Set_Poly_Type (Dest => Bytes, Offset => 16, Size => 32, Value => (5, 6, 7, 8)), Success); - Byte_Array_Assert.Eq (Bytes, (0 => 1, 1 => 2, 2 => 5, 3 => 6, 4 => 7, 5 => 8, 6 .. 9 => 0)); - Set_Status_Assert.Eq (Set_Poly_Type (Dest => Bytes, Offset => 8, Size => 32, Value => (255, 255, 255, 255)), Success); - Byte_Array_Assert.Eq (Bytes, (0 => 1, 1 => 255, 2 => 255, 3 => 255, 4 => 255, 5 => 8, 6 .. 9 => 0)); - Set_Status_Assert.Eq (Set_Poly_Type (Dest => Bytes, Offset => 8, Size => 32, Value => (0, 0, 0, 12)), Success); - Byte_Array_Assert.Eq (Bytes, (0 => 1, 1 => 0, 2 => 0, 3 => 0, 4 => 12, 5 => 8, 6 .. 9 => 0)); - Set_Status_Assert.Eq (Set_Poly_Type (Dest => Bytes, Offset => 8, Size => 16, Value => (0, 0, 33, 33)), Success); - Byte_Array_Assert.Eq (Bytes, (0 => 1, 1 => 33, 2 => 33, 3 => 0, 4 => 12, 5 => 8, 6 .. 9 => 0)); - Set_Status_Assert.Eq (Set_Poly_Type (Dest => Bytes, Offset => 0, Size => 16, Value => (0, 0, 22, 0)), Success); - Byte_Array_Assert.Eq (Bytes, (0 => 22, 1 => 0, 2 => 33, 3 => 0, 4 => 12, 5 => 8, 6 .. 9 => 0)); - Set_Status_Assert.Eq (Set_Poly_Type (Dest => Bytes, Offset => 4 * 8, Size => 24, Value => (0, 3, 2, 1)), Success); - Byte_Array_Assert.Eq (Bytes, (0 => 22, 1 => 0, 2 => 33, 3 => 0, 4 => 3, 5 => 2, 6 => 1, 7 .. 9 => 0)); + Set_Status_Assert.Eq (Set_Poly_Type (Dest => Bytes, Offset => 0, Size => 32, Value => [1, 2, 3, 4]), Success); + Byte_Array_Assert.Eq (Bytes, [0 => 1, 1 => 2, 2 => 3, 3 => 4, 4 .. 9 => 0]); + Set_Status_Assert.Eq (Set_Poly_Type (Dest => Bytes, Offset => 16, Size => 32, Value => [5, 6, 7, 8]), Success); + Byte_Array_Assert.Eq (Bytes, [0 => 1, 1 => 2, 2 => 5, 3 => 6, 4 => 7, 5 => 8, 6 .. 9 => 0]); + Set_Status_Assert.Eq (Set_Poly_Type (Dest => Bytes, Offset => 8, Size => 32, Value => [255, 255, 255, 255]), Success); + Byte_Array_Assert.Eq (Bytes, [0 => 1, 1 => 255, 2 => 255, 3 => 255, 4 => 255, 5 => 8, 6 .. 9 => 0]); + Set_Status_Assert.Eq (Set_Poly_Type (Dest => Bytes, Offset => 8, Size => 32, Value => [0, 0, 0, 12]), Success); + Byte_Array_Assert.Eq (Bytes, [0 => 1, 1 => 0, 2 => 0, 3 => 0, 4 => 12, 5 => 8, 6 .. 9 => 0]); + Set_Status_Assert.Eq (Set_Poly_Type (Dest => Bytes, Offset => 8, Size => 16, Value => [0, 0, 33, 33]), Success); + Byte_Array_Assert.Eq (Bytes, [0 => 1, 1 => 33, 2 => 33, 3 => 0, 4 => 12, 5 => 8, 6 .. 9 => 0]); + Set_Status_Assert.Eq (Set_Poly_Type (Dest => Bytes, Offset => 0, Size => 16, Value => [0, 0, 22, 0]), Success); + Byte_Array_Assert.Eq (Bytes, [0 => 22, 1 => 0, 2 => 33, 3 => 0, 4 => 12, 5 => 8, 6 .. 9 => 0]); + Set_Status_Assert.Eq (Set_Poly_Type (Dest => Bytes, Offset => 4 * 8, Size => 24, Value => [0, 3, 2, 1]), Success); + Byte_Array_Assert.Eq (Bytes, [0 => 22, 1 => 0, 2 => 33, 3 => 0, 4 => 3, 5 => 2, 6 => 1, 7 .. 9 => 0]); -- Test extractions that do not end on byte boundaries: - Bytes := (others => 0); - Set_Status_Assert.Eq (Set_Poly_Type (Dest => Bytes, Offset => 4, Size => 8, Value => (0, 0, 0, 255)), Success); - Byte_Array_Assert.Eq (Bytes, (0 => 16#0f#, 1 => 16#f0#, 2 .. 9 => 0)); - Bytes := (others => 255); - Set_Status_Assert.Eq (Set_Poly_Type (Dest => Bytes, Offset => 4, Size => 8, Value => (0, 0, 0, 0)), Success); - Byte_Array_Assert.Eq (Bytes, (0 => 16#f0#, 1 => 16#0f#, 2 .. 9 => 255)); - Set_Status_Assert.Eq (Set_Poly_Type (Dest => Bytes, Offset => 4, Size => 8, Value => (0, 0, 0, 16#44#)), Success); - Byte_Array_Assert.Eq (Bytes, (0 => 16#f4#, 1 => 16#4f#, 2 .. 9 => 255)); - Set_Status_Assert.Eq (Set_Poly_Type (Dest => Bytes, Offset => 4, Size => 8, Value => (0, 0, 0, 16#11#)), Success); - Byte_Array_Assert.Eq (Bytes, (0 => 16#f1#, 1 => 16#1f#, 2 .. 9 => 255)); - Bytes := (others => 0); - Set_Status_Assert.Eq (Set_Poly_Type (Dest => Bytes, Offset => 3, Size => 16, Value => (0, 0, 16#FF#, 16#FF#)), Success); - Byte_Array_Assert.Eq (Bytes, (0 => 31, 1 => 16#ff#, 2 => 224, 3 .. 9 => 0)); - Bytes := (others => 255); - Set_Status_Assert.Eq (Set_Poly_Type (Dest => Bytes, Offset => 3, Size => 16, Value => (0, 0, 16#00#, 16#00#)), Success); - Byte_Array_Assert.Eq (Bytes, (0 => 224, 1 => 16#00#, 2 => 31, 3 .. 9 => 255)); - Bytes := (others => 255); - Set_Status_Assert.Eq (Set_Poly_Type (Dest => Bytes, Offset => 3, Size => 17, Value => (0, 0, 16#00#, 16#00#)), Success); - Byte_Array_Assert.Eq (Bytes, (0 => 224, 1 => 16#00#, 2 => 15, 3 .. 9 => 255)); - Bytes := (others => 0); - Set_Status_Assert.Eq (Set_Poly_Type (Dest => Bytes, Offset => 4, Size => 17, Value => (0, 0, 16#FF#, 16#FF#)), Success); - Byte_Array_Assert.Eq (Bytes, (0 => 16#07#, 1 => 16#FF#, 2 => 16#F8#, 3 .. 9 => 0)); - Bytes := (others => 0); - Set_Status_Assert.Eq (Set_Poly_Type (Dest => Bytes, Offset => 4, Size => 17, Value => (0, 1, 16#FF#, 16#FF#)), Success); - Byte_Array_Assert.Eq (Bytes, (0 => 16#0F#, 1 => 16#FF#, 2 => 16#F8#, 3 .. 9 => 0)); - Bytes := (others => 255); - Set_Status_Assert.Eq (Set_Poly_Type (Dest => Bytes, Offset => 4, Size => 1, Value => (0, 0, 16#0#, 16#0#)), Success); - Byte_Array_Assert.Eq (Bytes, (0 => 247, 1 .. 9 => 255)); - Set_Status_Assert.Eq (Set_Poly_Type (Dest => Bytes, Offset => 1, Size => 2, Value => (0, 0, 16#0#, 16#0#)), Success); - Byte_Array_Assert.Eq (Bytes, (0 => 151, 1 .. 9 => 255)); + Bytes := [others => 0]; + Set_Status_Assert.Eq (Set_Poly_Type (Dest => Bytes, Offset => 4, Size => 8, Value => [0, 0, 0, 255]), Success); + Byte_Array_Assert.Eq (Bytes, [0 => 16#0f#, 1 => 16#f0#, 2 .. 9 => 0]); + Bytes := [others => 255]; + Set_Status_Assert.Eq (Set_Poly_Type (Dest => Bytes, Offset => 4, Size => 8, Value => [0, 0, 0, 0]), Success); + Byte_Array_Assert.Eq (Bytes, [0 => 16#f0#, 1 => 16#0f#, 2 .. 9 => 255]); + Set_Status_Assert.Eq (Set_Poly_Type (Dest => Bytes, Offset => 4, Size => 8, Value => [0, 0, 0, 16#44#]), Success); + Byte_Array_Assert.Eq (Bytes, [0 => 16#f4#, 1 => 16#4f#, 2 .. 9 => 255]); + Set_Status_Assert.Eq (Set_Poly_Type (Dest => Bytes, Offset => 4, Size => 8, Value => [0, 0, 0, 16#11#]), Success); + Byte_Array_Assert.Eq (Bytes, [0 => 16#f1#, 1 => 16#1f#, 2 .. 9 => 255]); + Bytes := [others => 0]; + Set_Status_Assert.Eq (Set_Poly_Type (Dest => Bytes, Offset => 3, Size => 16, Value => [0, 0, 16#FF#, 16#FF#]), Success); + Byte_Array_Assert.Eq (Bytes, [0 => 31, 1 => 16#ff#, 2 => 224, 3 .. 9 => 0]); + Bytes := [others => 255]; + Set_Status_Assert.Eq (Set_Poly_Type (Dest => Bytes, Offset => 3, Size => 16, Value => [0, 0, 16#00#, 16#00#]), Success); + Byte_Array_Assert.Eq (Bytes, [0 => 224, 1 => 16#00#, 2 => 31, 3 .. 9 => 255]); + Bytes := [others => 255]; + Set_Status_Assert.Eq (Set_Poly_Type (Dest => Bytes, Offset => 3, Size => 17, Value => [0, 0, 16#00#, 16#00#]), Success); + Byte_Array_Assert.Eq (Bytes, [0 => 224, 1 => 16#00#, 2 => 15, 3 .. 9 => 255]); + Bytes := [others => 0]; + Set_Status_Assert.Eq (Set_Poly_Type (Dest => Bytes, Offset => 4, Size => 17, Value => [0, 0, 16#FF#, 16#FF#]), Success); + Byte_Array_Assert.Eq (Bytes, [0 => 16#07#, 1 => 16#FF#, 2 => 16#F8#, 3 .. 9 => 0]); + Bytes := [others => 0]; + Set_Status_Assert.Eq (Set_Poly_Type (Dest => Bytes, Offset => 4, Size => 17, Value => [0, 1, 16#FF#, 16#FF#]), Success); + Byte_Array_Assert.Eq (Bytes, [0 => 16#0F#, 1 => 16#FF#, 2 => 16#F8#, 3 .. 9 => 0]); + Bytes := [others => 255]; + Set_Status_Assert.Eq (Set_Poly_Type (Dest => Bytes, Offset => 4, Size => 1, Value => [0, 0, 16#0#, 16#0#]), Success); + Byte_Array_Assert.Eq (Bytes, [0 => 247, 1 .. 9 => 255]); + Set_Status_Assert.Eq (Set_Poly_Type (Dest => Bytes, Offset => 1, Size => 2, Value => [0, 0, 16#0#, 16#0#]), Success); + Byte_Array_Assert.Eq (Bytes, [0 => 151, 1 .. 9 => 255]); -- Test truncation logic: - Bytes := (others => 0); - Set_Status_Assert.Eq (Set_Poly_Type (Dest => Bytes, Offset => 0, Size => 8, Value => (0, 0, 1, 0)), Truncation_Error); - Byte_Array_Assert.Eq (Bytes, (0 .. 9 => 0)); - Set_Status_Assert.Eq (Set_Poly_Type (Dest => Bytes, Offset => 3, Size => 8, Value => (0, 0, 1, 0)), Truncation_Error); - Byte_Array_Assert.Eq (Bytes, (0 .. 9 => 0)); - Set_Status_Assert.Eq (Set_Poly_Type (Dest => Bytes, Offset => 3, Size => 8, Value => (0, 0, 1, 0), Truncation_Allowed => False), Truncation_Error); - Set_Status_Assert.Eq (Set_Poly_Type (Dest => Bytes, Offset => 3, Size => 8, Value => (0, 0, 1, 0), Truncation_Allowed => True), Success); - Byte_Array_Assert.Eq (Bytes, (0 .. 9 => 0)); - Set_Status_Assert.Eq (Set_Poly_Type (Dest => Bytes, Offset => 0, Size => 8, Value => (0, 0, 255, 254), Truncation_Allowed => False), Truncation_Error); - Set_Status_Assert.Eq (Set_Poly_Type (Dest => Bytes, Offset => 0, Size => 8, Value => (0, 0, 255, 254), Truncation_Allowed => True), Success); - Byte_Array_Assert.Eq (Bytes, (0 => 254, 1 .. 9 => 0)); - Bytes := (others => 255); - Set_Status_Assert.Eq (Set_Poly_Type (Dest => Bytes (3 .. 11), Offset => 2, Size => 13, Value => (0, 1, 0, 0), Truncation_Allowed => False), Truncation_Error); - Set_Status_Assert.Eq (Set_Poly_Type (Dest => Bytes (3 .. 11), Offset => 2, Size => 13, Value => (0, 1, 0, 0), Truncation_Allowed => True), Success); - Byte_Array_Assert.Eq (Bytes, (0 => 255, 1 => 192, 2 => 1, 3 .. 9 => 255)); + Bytes := [others => 0]; + Set_Status_Assert.Eq (Set_Poly_Type (Dest => Bytes, Offset => 0, Size => 8, Value => [0, 0, 1, 0]), Truncation_Error); + Byte_Array_Assert.Eq (Bytes, [0 .. 9 => 0]); + Set_Status_Assert.Eq (Set_Poly_Type (Dest => Bytes, Offset => 3, Size => 8, Value => [0, 0, 1, 0]), Truncation_Error); + Byte_Array_Assert.Eq (Bytes, [0 .. 9 => 0]); + Set_Status_Assert.Eq (Set_Poly_Type (Dest => Bytes, Offset => 3, Size => 8, Value => [0, 0, 1, 0], Truncation_Allowed => False), Truncation_Error); + Set_Status_Assert.Eq (Set_Poly_Type (Dest => Bytes, Offset => 3, Size => 8, Value => [0, 0, 1, 0], Truncation_Allowed => True), Success); + Byte_Array_Assert.Eq (Bytes, [0 .. 9 => 0]); + Set_Status_Assert.Eq (Set_Poly_Type (Dest => Bytes, Offset => 0, Size => 8, Value => [0, 0, 255, 254], Truncation_Allowed => False), Truncation_Error); + Set_Status_Assert.Eq (Set_Poly_Type (Dest => Bytes, Offset => 0, Size => 8, Value => [0, 0, 255, 254], Truncation_Allowed => True), Success); + Byte_Array_Assert.Eq (Bytes, [0 => 254, 1 .. 9 => 0]); + Bytes := [others => 255]; + Set_Status_Assert.Eq (Set_Poly_Type (Dest => Bytes (3 .. 11), Offset => 2, Size => 13, Value => [0, 1, 0, 0], Truncation_Allowed => False), Truncation_Error); + Set_Status_Assert.Eq (Set_Poly_Type (Dest => Bytes (3 .. 11), Offset => 2, Size => 13, Value => [0, 1, 0, 0], Truncation_Allowed => True), Success); + Byte_Array_Assert.Eq (Bytes, [0 => 255, 1 => 192, 2 => 1, 3 .. 9 => 255]); -- Test illegal extractions: - Bytes := (others => 0); - Set_Status_Assert.Eq (Set_Poly_Type (Dest => Bytes (1 .. 0), Offset => 2, Size => 13, Value => (255, 255, 255, 255), Truncation_Allowed => True), Error); - Byte_Array_Assert.Eq (Bytes, (0 .. 9 => 0)); - Set_Status_Assert.Eq (Set_Poly_Type (Dest => Bytes (2 .. 2), Offset => 0, Size => 9, Value => (255, 255, 255, 255), Truncation_Allowed => True), Error); - Byte_Array_Assert.Eq (Bytes, (0 .. 9 => 0)); - Set_Status_Assert.Eq (Set_Poly_Type (Dest => Bytes (2 .. 2), Offset => 8, Size => 1, Value => (255, 255, 255, 255), Truncation_Allowed => True), Error); - Byte_Array_Assert.Eq (Bytes, (0 .. 9 => 0)); - Set_Status_Assert.Eq (Set_Poly_Type (Dest => Bytes (2 .. 2), Offset => 2, Size => 7, Value => (255, 255, 255, 255), Truncation_Allowed => True), Error); - Byte_Array_Assert.Eq (Bytes, (0 .. 9 => 0)); + Bytes := [others => 0]; + Set_Status_Assert.Eq (Set_Poly_Type (Dest => Bytes (1 .. 0), Offset => 2, Size => 13, Value => [255, 255, 255, 255], Truncation_Allowed => True), Error); + Byte_Array_Assert.Eq (Bytes, [0 .. 9 => 0]); + Set_Status_Assert.Eq (Set_Poly_Type (Dest => Bytes (2 .. 2), Offset => 0, Size => 9, Value => [255, 255, 255, 255], Truncation_Allowed => True), Error); + Byte_Array_Assert.Eq (Bytes, [0 .. 9 => 0]); + Set_Status_Assert.Eq (Set_Poly_Type (Dest => Bytes (2 .. 2), Offset => 8, Size => 1, Value => [255, 255, 255, 255], Truncation_Allowed => True), Error); + Byte_Array_Assert.Eq (Bytes, [0 .. 9 => 0]); + Set_Status_Assert.Eq (Set_Poly_Type (Dest => Bytes (2 .. 2), Offset => 2, Size => 7, Value => [255, 255, 255, 255], Truncation_Allowed => True), Error); + Byte_Array_Assert.Eq (Bytes, [0 .. 9 => 0]); end Test_Set; -- This test makes sure the set and extract polytype functions work together as expected. @@ -184,44 +184,44 @@ package body Byte_Array_Util_Tests.Implementation is Ignore_Self : Instance renames Self; use Byte_Array_Util; Val : Basic_Types.Poly_32_Type; - Bytes : Basic_Types.Byte_Array := (2 .. 11 => 0); + Bytes : Basic_Types.Byte_Array := [2 .. 11 => 0]; begin - Set_Status_Assert.Eq (Set_Poly_Type (Dest => Bytes, Offset => 0, Size => 32, Value => (1, 2, 3, 4)), Success); + Set_Status_Assert.Eq (Set_Poly_Type (Dest => Bytes, Offset => 0, Size => 32, Value => [1, 2, 3, 4]), Success); Extract_Status_Assert.Eq (Extract_Poly_Type (Src => Bytes, Offset => 0, Size => 32, Is_Signed => False, Value => Val), Success); - Byte_Array_Assert.Eq (Val, (1, 2, 3, 4)); + Byte_Array_Assert.Eq (Val, [1, 2, 3, 4]); for Idx in 1 .. 44 loop - Set_Status_Assert.Eq (Set_Poly_Type (Dest => Bytes, Offset => Idx, Size => 32, Value => (1, 2, 3, 4)), Success); + Set_Status_Assert.Eq (Set_Poly_Type (Dest => Bytes, Offset => Idx, Size => 32, Value => [1, 2, 3, 4]), Success); Extract_Status_Assert.Eq (Extract_Poly_Type (Src => Bytes, Offset => Idx, Size => 32, Is_Signed => False, Value => Val), Success); - Byte_Array_Assert.Eq (Val, (1, 2, 3, 4)); + Byte_Array_Assert.Eq (Val, [1, 2, 3, 4]); end loop; - Bytes := (2 .. 11 => 243); + Bytes := [2 .. 11 => 243]; for Idx in 0 .. 44 loop - Set_Status_Assert.Eq (Set_Poly_Type (Dest => Bytes, Offset => Idx, Size => 16, Value => (0, 0, 16#FE#, 16#EF#)), Success); + Set_Status_Assert.Eq (Set_Poly_Type (Dest => Bytes, Offset => Idx, Size => 16, Value => [0, 0, 16#FE#, 16#EF#]), Success); Extract_Status_Assert.Eq (Extract_Poly_Type (Src => Bytes, Offset => Idx, Size => 16, Is_Signed => False, Value => Val), Success); - Byte_Array_Assert.Eq (Val, (0, 0, 16#FE#, 16#EF#)); + Byte_Array_Assert.Eq (Val, [0, 0, 16#FE#, 16#EF#]); end loop; - Bytes := (2 .. 11 => 4); + Bytes := [2 .. 11 => 4]; for Idx in 0 .. 44 loop - Set_Status_Assert.Eq (Set_Poly_Type (Dest => Bytes, Offset => Idx, Size => 1, Value => (0, 0, 0, 16#1#)), Success); + Set_Status_Assert.Eq (Set_Poly_Type (Dest => Bytes, Offset => Idx, Size => 1, Value => [0, 0, 0, 16#1#]), Success); Extract_Status_Assert.Eq (Extract_Poly_Type (Src => Bytes, Offset => Idx, Size => 1, Is_Signed => False, Value => Val), Success); - Byte_Array_Assert.Eq (Val, (0, 0, 16#0#, 16#1#)); + Byte_Array_Assert.Eq (Val, [0, 0, 16#0#, 16#1#]); end loop; - Bytes := (2 .. 11 => 0); + Bytes := [2 .. 11 => 0]; for Idx in 0 .. 44 loop - Set_Status_Assert.Eq (Set_Poly_Type (Dest => Bytes, Offset => Idx, Size => 17, Value => (0, 0, 16#45#, 16#11#)), Success); + Set_Status_Assert.Eq (Set_Poly_Type (Dest => Bytes, Offset => Idx, Size => 17, Value => [0, 0, 16#45#, 16#11#]), Success); Extract_Status_Assert.Eq (Extract_Poly_Type (Src => Bytes, Offset => Idx, Size => 17, Is_Signed => False, Value => Val), Success); - Byte_Array_Assert.Eq (Val, (0, 0, 16#45#, 16#11#)); + Byte_Array_Assert.Eq (Val, [0, 0, 16#45#, 16#11#]); end loop; - Bytes := (2 .. 11 => 16#AA#); + Bytes := [2 .. 11 => 16#AA#]; for Idx in 0 .. 44 loop - Set_Status_Assert.Eq (Set_Poly_Type (Dest => Bytes, Offset => Idx, Size => 2, Value => (0, 0, 16#45#, 16#12#), Truncation_Allowed => True), Success); + Set_Status_Assert.Eq (Set_Poly_Type (Dest => Bytes, Offset => Idx, Size => 2, Value => [0, 0, 16#45#, 16#12#], Truncation_Allowed => True), Success); Extract_Status_Assert.Eq (Extract_Poly_Type (Src => Bytes, Offset => Idx, Size => 2, Is_Signed => False, Value => Val), Success); - Byte_Array_Assert.Eq (Val, (0, 0, 16#0#, 16#2#)); + Byte_Array_Assert.Eq (Val, [0, 0, 16#0#, 16#2#]); end loop; end Test_Set_And_Extract; @@ -232,40 +232,40 @@ package body Byte_Array_Util_Tests.Implementation is Val : Basic_Types.Poly_32_Type; begin -- Basic tests: - Extract_Status_Assert.Eq (Extract_Poly_Type (Src => (16#00#, 16#FF#, 16#FF#, 2, 3, 4, 5, 6, 7), Offset => 8, Size => 8, Is_Signed => True, Value => Val), Success); - Byte_Array_Assert.Eq (Val, (255, 255, 255, 255)); - Extract_Status_Assert.Eq (Extract_Poly_Type (Src => (16#00#, 16#FF#, 16#FF#, 2, 3, 4, 5, 6, 7), Offset => 7, Size => 8, Is_Signed => True, Value => Val), Success); - Byte_Array_Assert.Eq (Val, (0, 0, 0, 16#7F#)); - Extract_Status_Assert.Eq (Extract_Poly_Type (Src => (16#00#, 16#FF#, 16#FF#, 2, 3, 4, 5, 6, 7), Offset => 9, Size => 8, Is_Signed => True, Value => Val), Success); - Byte_Array_Assert.Eq (Val, (255, 255, 255, 255)); - Extract_Status_Assert.Eq (Extract_Poly_Type (Src => (16#00#, 16#FF#, 16#FF#, 2, 3, 4, 5, 6, 7), Offset => 10, Size => 8, Is_Signed => True, Value => Val), Success); - Byte_Array_Assert.Eq (Val, (255, 255, 255, 255)); - Extract_Status_Assert.Eq (Extract_Poly_Type (Src => (16#00#, 16#FF#, 16#FF#, 2, 3, 4, 5, 6, 7), Offset => 17, Size => 8, Is_Signed => True, Value => Val), Success); - Byte_Array_Assert.Eq (Val, (255, 255, 255, 254)); - Extract_Status_Assert.Eq (Extract_Poly_Type (Src => (16#00#, 16#FF#, 16#FF#, 2, 3, 4, 5, 6, 7), Offset => 18, Size => 8, Is_Signed => True, Value => Val), Success); - Byte_Array_Assert.Eq (Val, (255, 255, 255, 252)); - Extract_Status_Assert.Eq (Extract_Poly_Type (Src => (16#00#, 16#FF#, 16#FF#, 2, 3, 4, 5, 6, 7), Offset => 8, Size => 7, Is_Signed => True, Value => Val), Success); - Byte_Array_Assert.Eq (Val, (255, 255, 255, 255)); - Extract_Status_Assert.Eq (Extract_Poly_Type (Src => (16#00#, 16#FF#, 16#FF#, 2, 3, 4, 5, 6, 7), Offset => 8, Size => 6, Is_Signed => True, Value => Val), Success); - Byte_Array_Assert.Eq (Val, (255, 255, 255, 255)); - Extract_Status_Assert.Eq (Extract_Poly_Type (Src => (16#00#, 16#FF#, 16#FF#, 2, 3, 4, 5, 6, 7), Offset => 8, Size => 1, Is_Signed => True, Value => Val), Success); - Byte_Array_Assert.Eq (Val, (255, 255, 255, 255)); + Extract_Status_Assert.Eq (Extract_Poly_Type (Src => [16#00#, 16#FF#, 16#FF#, 2, 3, 4, 5, 6, 7], Offset => 8, Size => 8, Is_Signed => True, Value => Val), Success); + Byte_Array_Assert.Eq (Val, [255, 255, 255, 255]); + Extract_Status_Assert.Eq (Extract_Poly_Type (Src => [16#00#, 16#FF#, 16#FF#, 2, 3, 4, 5, 6, 7], Offset => 7, Size => 8, Is_Signed => True, Value => Val), Success); + Byte_Array_Assert.Eq (Val, [0, 0, 0, 16#7F#]); + Extract_Status_Assert.Eq (Extract_Poly_Type (Src => [16#00#, 16#FF#, 16#FF#, 2, 3, 4, 5, 6, 7], Offset => 9, Size => 8, Is_Signed => True, Value => Val), Success); + Byte_Array_Assert.Eq (Val, [255, 255, 255, 255]); + Extract_Status_Assert.Eq (Extract_Poly_Type (Src => [16#00#, 16#FF#, 16#FF#, 2, 3, 4, 5, 6, 7], Offset => 10, Size => 8, Is_Signed => True, Value => Val), Success); + Byte_Array_Assert.Eq (Val, [255, 255, 255, 255]); + Extract_Status_Assert.Eq (Extract_Poly_Type (Src => [16#00#, 16#FF#, 16#FF#, 2, 3, 4, 5, 6, 7], Offset => 17, Size => 8, Is_Signed => True, Value => Val), Success); + Byte_Array_Assert.Eq (Val, [255, 255, 255, 254]); + Extract_Status_Assert.Eq (Extract_Poly_Type (Src => [16#00#, 16#FF#, 16#FF#, 2, 3, 4, 5, 6, 7], Offset => 18, Size => 8, Is_Signed => True, Value => Val), Success); + Byte_Array_Assert.Eq (Val, [255, 255, 255, 252]); + Extract_Status_Assert.Eq (Extract_Poly_Type (Src => [16#00#, 16#FF#, 16#FF#, 2, 3, 4, 5, 6, 7], Offset => 8, Size => 7, Is_Signed => True, Value => Val), Success); + Byte_Array_Assert.Eq (Val, [255, 255, 255, 255]); + Extract_Status_Assert.Eq (Extract_Poly_Type (Src => [16#00#, 16#FF#, 16#FF#, 2, 3, 4, 5, 6, 7], Offset => 8, Size => 6, Is_Signed => True, Value => Val), Success); + Byte_Array_Assert.Eq (Val, [255, 255, 255, 255]); + Extract_Status_Assert.Eq (Extract_Poly_Type (Src => [16#00#, 16#FF#, 16#FF#, 2, 3, 4, 5, 6, 7], Offset => 8, Size => 1, Is_Signed => True, Value => Val), Success); + Byte_Array_Assert.Eq (Val, [255, 255, 255, 255]); -- Test with actual unsigned integers: -- 100 stored at bit 4 for 8-bit signed integer: - Extract_Status_Assert.Eq (Extract_Poly_Type (Src => (16#06#, 16#40#, 16#00#, 2, 3, 4, 5, 6, 7), Offset => 4, Size => 8, Is_Signed => True, Value => Val), Success); - Byte_Array_Assert.Eq (Val, (0, 0, 0, 100)); + Extract_Status_Assert.Eq (Extract_Poly_Type (Src => [16#06#, 16#40#, 16#00#, 2, 3, 4, 5, 6, 7], Offset => 4, Size => 8, Is_Signed => True, Value => Val), Success); + Byte_Array_Assert.Eq (Val, [0, 0, 0, 100]); -- -100 stored at bit 4 for 8-bit signed integer: - Extract_Status_Assert.Eq (Extract_Poly_Type (Src => (16#09#, 16#C0#, 16#00#, 2, 3, 4, 5, 6, 7), Offset => 4, Size => 8, Is_Signed => True, Value => Val), Success); - Byte_Array_Assert.Eq (Val, (255, 255, 255, 16#9C#)); - Extract_Status_Assert.Eq (Extract_Poly_Type (Src => (16#29#, 16#C0#, 16#00#, 2, 3, 4, 5, 6, 7), Offset => 2, Size => 10, Is_Signed => True, Value => Val), Success); - Byte_Array_Assert.Eq (Val, (255, 255, 16#FE#, 16#9C#)); - Extract_Status_Assert.Eq (Extract_Poly_Type (Src => (16#29#, 16#C0#, 16#00#, 2, 3, 4, 5, 6, 7), Offset => 3, Size => 9, Is_Signed => True, Value => Val), Success); - Byte_Array_Assert.Eq (Val, (0, 0, 0, 16#9C#)); - Extract_Status_Assert.Eq (Extract_Poly_Type (Src => (16#29#, 16#C3#, 16#00#, 2, 3, 4, 5, 6, 7), Offset => 2, Size => 18, Is_Signed => True, Value => Val), Success); - Byte_Array_Assert.Eq (Val, (255, 16#FE#, 16#9C#, 16#30#)); - Extract_Status_Assert.Eq (Extract_Poly_Type (Src => (16#29#, 16#C3#, 16#00#, 2, 3, 4, 5, 6, 7), Offset => 0, Size => 20, Is_Signed => True, Value => Val), Success); - Byte_Array_Assert.Eq (Val, (0, 16#02#, 16#9C#, 16#30#)); + Extract_Status_Assert.Eq (Extract_Poly_Type (Src => [16#09#, 16#C0#, 16#00#, 2, 3, 4, 5, 6, 7], Offset => 4, Size => 8, Is_Signed => True, Value => Val), Success); + Byte_Array_Assert.Eq (Val, [255, 255, 255, 16#9C#]); + Extract_Status_Assert.Eq (Extract_Poly_Type (Src => [16#29#, 16#C0#, 16#00#, 2, 3, 4, 5, 6, 7], Offset => 2, Size => 10, Is_Signed => True, Value => Val), Success); + Byte_Array_Assert.Eq (Val, [255, 255, 16#FE#, 16#9C#]); + Extract_Status_Assert.Eq (Extract_Poly_Type (Src => [16#29#, 16#C0#, 16#00#, 2, 3, 4, 5, 6, 7], Offset => 3, Size => 9, Is_Signed => True, Value => Val), Success); + Byte_Array_Assert.Eq (Val, [0, 0, 0, 16#9C#]); + Extract_Status_Assert.Eq (Extract_Poly_Type (Src => [16#29#, 16#C3#, 16#00#, 2, 3, 4, 5, 6, 7], Offset => 2, Size => 18, Is_Signed => True, Value => Val), Success); + Byte_Array_Assert.Eq (Val, [255, 16#FE#, 16#9C#, 16#30#]); + Extract_Status_Assert.Eq (Extract_Poly_Type (Src => [16#29#, 16#C3#, 16#00#, 2, 3, 4, 5, 6, 7], Offset => 0, Size => 20, Is_Signed => True, Value => Val), Success); + Byte_Array_Assert.Eq (Val, [0, 16#02#, 16#9C#, 16#30#]); end Test_Extract_Signed; end Byte_Array_Util_Tests.Implementation; diff --git a/src/util/crc/checksum_16.adb b/src/util/crc/checksum_16.adb index 22982fc1..1bb209b3 100644 --- a/src/util/crc/checksum_16.adb +++ b/src/util/crc/checksum_16.adb @@ -21,12 +21,12 @@ package body Checksum_16 is return To_Return; end Compute_Checksum_16; - function Compute_Checksum_16 (Bytes : in Basic_Types.Byte_Array; Seed : in Checksum_16_Type := (0 => 16#00#, 1 => 16#00#)) return Checksum_16_Type is + function Compute_Checksum_16 (Bytes : in Basic_Types.Byte_Array; Seed : in Checksum_16_Type := [0 => 16#00#, 1 => 16#00#]) return Checksum_16_Type is Seed_Number : constant Unsigned_16 := Unsigned_16 (Seed (0)) * 256 + Unsigned_16 (Seed (1)); Result : constant Unsigned_16 := Compute_Checksum_16 (Bytes, Seed_Number); begin -- Return the result as array of bytes: - return (0 => Unsigned_8 (Result / 16#100#), 1 => Unsigned_8 (Result mod 16#100#)); + return [0 => Unsigned_8 (Result / 16#100#), 1 => Unsigned_8 (Result mod 16#100#)]; end Compute_Checksum_16; end Checksum_16; diff --git a/src/util/crc/checksum_16.ads b/src/util/crc/checksum_16.ads index 2254651b..a28b4d0c 100644 --- a/src/util/crc/checksum_16.ads +++ b/src/util/crc/checksum_16.ads @@ -14,6 +14,6 @@ package Checksum_16 is -- This function adds all the 16-bit words in the given byte array, starting with the given seed, and returns the -- result. If the number of bytes in the array is odd, then the the calculation assumes a pad byte is added to the end with -- a value of 0x00. The addition and result is in big endian. - function Compute_Checksum_16 (Bytes : in Basic_Types.Byte_Array; Seed : in Checksum_16_Type := (0 => 16#00#, 1 => 16#00#)) return Checksum_16_Type; + function Compute_Checksum_16 (Bytes : in Basic_Types.Byte_Array; Seed : in Checksum_16_Type := [0 => 16#00#, 1 => 16#00#]) return Checksum_16_Type; end Checksum_16; diff --git a/src/util/crc/crc_16.adb b/src/util/crc/crc_16.adb index 01b47840..57fddc1a 100644 --- a/src/util/crc/crc_16.adb +++ b/src/util/crc/crc_16.adb @@ -4,12 +4,12 @@ package body Crc_16 is -- Function to compute CRC on a variable array of bytes. A CRC of the whole -- array is computed. - function Compute_Crc_16 (Bytes : in Basic_Types.Byte_Array; Seed : in Crc_16_Type := (0 => 16#FF#, 1 => 16#FF#)) return Crc_16_Type is + function Compute_Crc_16 (Bytes : in Basic_Types.Byte_Array; Seed : in Crc_16_Type := [0 => 16#FF#, 1 => 16#FF#]) return Crc_16_Type is -- Constants: type Byte_Array_Byte_Index is array (Basic_Types.Byte) of Basic_Types.Byte; - Low_Crc : constant Byte_Array_Byte_Index := ( + Low_Crc : constant Byte_Array_Byte_Index := [ 16#00#, 16#21#, 16#42#, 16#63#, 16#84#, 16#a5#, 16#c6#, 16#e7#, 16#08#, 16#29#, 16#4a#, 16#6b#, 16#8c#, 16#ad#, 16#ce#, 16#ef#, 16#31#, 16#10#, 16#73#, 16#52#, 16#b5#, 16#94#, 16#f7#, 16#d6#, 16#39#, 16#18#, 16#7b#, 16#5a#, 16#bd#, 16#9c#, 16#ff#, 16#de#, 16#62#, 16#43#, 16#20#, 16#01#, 16#e6#, 16#c7#, 16#a4#, @@ -30,9 +30,9 @@ package body Crc_16 is 16#d0#, 16#b3#, 16#92#, 16#2e#, 16#0f#, 16#6c#, 16#4d#, 16#aa#, 16#8b#, 16#e8#, 16#c9#, 16#26#, 16#07#, 16#64#, 16#45#, 16#a2#, 16#83#, 16#e0#, 16#c1#, 16#1f#, 16#3e#, 16#5d#, 16#7c#, 16#9b#, 16#ba#, 16#d9#, 16#f8#, 16#17#, 16#36#, 16#55#, 16#74#, 16#93#, 16#b2#, 16#d1#, 16#f0# - ); + ]; - High_Crc : constant Byte_Array_Byte_Index := ( + High_Crc : constant Byte_Array_Byte_Index := [ 16#00#, 16#10#, 16#20#, 16#30#, 16#40#, 16#50#, 16#60#, 16#70#, 16#81#, 16#91#, 16#a1#, 16#b1#, 16#c1#, 16#d1#, 16#e1#, 16#f1#, 16#12#, 16#02#, 16#32#, 16#22#, 16#52#, 16#42#, 16#72#, 16#62#, 16#93#, 16#83#, 16#b3#, 16#a3#, 16#d3#, 16#c3#, 16#f3#, 16#e3#, 16#24#, 16#34#, 16#04#, 16#14#, 16#64#, 16#74#, 16#44#, @@ -53,7 +53,7 @@ package body Crc_16 is 16#1a#, 16#2a#, 16#3a#, 16#fd#, 16#ed#, 16#dd#, 16#cd#, 16#bd#, 16#ad#, 16#9d#, 16#8d#, 16#7c#, 16#6c#, 16#5c#, 16#4c#, 16#3c#, 16#2c#, 16#1c#, 16#0c#, 16#ef#, 16#ff#, 16#cf#, 16#df#, 16#af#, 16#bf#, 16#8f#, 16#9f#, 16#6e#, 16#7e#, 16#4e#, 16#5e#, 16#2e#, 16#3e#, 16#0e#, 16#1e# - ); + ]; -- Local parity variables: High_Parity : Basic_Types.Byte := Seed (Crc_16_Type'First); @@ -68,10 +68,10 @@ package body Crc_16 is end; end loop; - return (Crc_16_Type'First => High_Parity, Crc_16_Type'First + 1 => Low_Parity); + return [Crc_16_Type'First => High_Parity, Crc_16_Type'First + 1 => Low_Parity]; end Compute_Crc_16; - function Compute_Crc_16 (Byte_Ptr : in Byte_Array_Pointer.Instance; Seed : in Crc_16_Type := (0 => 16#FF#, 1 => 16#FF#)) return Crc_16_Type is + function Compute_Crc_16 (Byte_Ptr : in Byte_Array_Pointer.Instance; Seed : in Crc_16_Type := [0 => 16#FF#, 1 => 16#FF#]) return Crc_16_Type is use Byte_Array_Pointer; subtype Safe_Byte_Array_Type is Basic_Types.Byte_Array (0 .. Length (Byte_Ptr) - 1); -- Perform overlay manually instead of using Byte_Array_Pointer.Pointer to avoid Byte_Array_Access range checking. diff --git a/src/util/crc/crc_16.ads b/src/util/crc/crc_16.ads index cdad6ea4..a3a506ea 100644 --- a/src/util/crc/crc_16.ads +++ b/src/util/crc/crc_16.ads @@ -32,7 +32,7 @@ package Crc_16 is -- -- Converted to Ada and added seed capability by Kevin Dinkel, Summer, 2018. -- - function Compute_Crc_16 (Bytes : in Basic_Types.Byte_Array; Seed : in Crc_16_Type := (0 => 16#FF#, 1 => 16#FF#)) return Crc_16_Type; - function Compute_Crc_16 (Byte_Ptr : in Byte_Array_Pointer.Instance; Seed : in Crc_16_Type := (0 => 16#FF#, 1 => 16#FF#)) return Crc_16_Type; + function Compute_Crc_16 (Bytes : in Basic_Types.Byte_Array; Seed : in Crc_16_Type := [0 => 16#FF#, 1 => 16#FF#]) return Crc_16_Type; + function Compute_Crc_16 (Byte_Ptr : in Byte_Array_Pointer.Instance; Seed : in Crc_16_Type := [0 => 16#FF#, 1 => 16#FF#]) return Crc_16_Type; end Crc_16; diff --git a/src/util/crc/test/crc_16_tests-implementation.adb b/src/util/crc/test/crc_16_tests-implementation.adb index 1d65358b..c11064d4 100644 --- a/src/util/crc/test/crc_16_tests-implementation.adb +++ b/src/util/crc/test/crc_16_tests-implementation.adb @@ -32,9 +32,9 @@ package body Crc_16_Tests.Implementation is use Crc_16; use Basic_Types; Ignore : Instance renames Self; - Bytes : constant Basic_Types.Byte_Array (0 .. 14) := (16#06#, 16#00#, 16#0c#, 16#f0#, 16#00#, 16#04#, 16#00#, 16#55#, 16#88#, 16#73#, 16#c9#, 16#00#, 16#00#, 16#05#, 16#21#); + Bytes : constant Basic_Types.Byte_Array (0 .. 14) := [16#06#, 16#00#, 16#0c#, 16#f0#, 16#00#, 16#04#, 16#00#, 16#55#, 16#88#, 16#73#, 16#c9#, 16#00#, 16#00#, 16#05#, 16#21#]; Result : constant Crc_16_Type := Compute_Crc_16 (Bytes); - Expected : constant Crc_16_Type := (0 => 16#75#, 1 => 16#fb#); + Expected : constant Crc_16_Type := [0 => 16#75#, 1 => 16#fb#]; begin Put_Line ("Returned CRC: " & String_Util.Bytes_To_String (Result)); Put_Line ("Expected CRC: " & String_Util.Bytes_To_String (Expected)); @@ -45,12 +45,12 @@ package body Crc_16_Tests.Implementation is use Crc_16; use Basic_Types; Ignore : Instance renames Self; - Bytes : constant Basic_Types.Byte_Array (0 .. 14) := (16#06#, 16#00#, 16#0c#, 16#f0#, 16#00#, 16#04#, 16#00#, 16#55#, 16#88#, 16#73#, 16#c9#, 16#00#, 16#00#, 16#05#, 16#21#); + Bytes : constant Basic_Types.Byte_Array (0 .. 14) := [16#06#, 16#00#, 16#0c#, 16#f0#, 16#00#, 16#04#, 16#00#, 16#55#, 16#88#, 16#73#, 16#c9#, 16#00#, 16#00#, 16#05#, 16#21#]; Result1 : constant Crc_16_Type := Compute_Crc_16 (Bytes (0 .. 0)); Result2 : constant Crc_16_Type := Compute_Crc_16 (Bytes (1 .. 1), Result1); Result3 : constant Crc_16_Type := Compute_Crc_16 (Bytes (2 .. 6), Result2); Result : constant Crc_16_Type := Compute_Crc_16 (Bytes (7 .. 14), Result3); - Expected : constant Crc_16_Type := (0 => 16#75#, 1 => 16#fb#); + Expected : constant Crc_16_Type := [0 => 16#75#, 1 => 16#fb#]; begin Put_Line ("Returned CRC: " & String_Util.Bytes_To_String (Result)); Put_Line ("Expected CRC: " & String_Util.Bytes_To_String (Expected)); diff --git a/src/util/crc/test_checksum/test.adb b/src/util/crc/test_checksum/test.adb index 97377554..212c1aff 100644 --- a/src/util/crc/test_checksum/test.adb +++ b/src/util/crc/test_checksum/test.adb @@ -4,17 +4,17 @@ with Basic_Types.Representation; use Basic_Types; procedure Test is Checksum : Checksum_16_Type; begin - Checksum := Compute_Checksum_16 ((0, 1, 2, 3, 4, 5, 6, 7, 8, 9)); - pragma Assert (Checksum = (16#14#, 16#19#), "Expected " & Basic_Types.Representation.To_Tuple_String ((16#14#, 16#19#)) & " and got " & Basic_Types.Representation.To_Tuple_String (Checksum)); - Checksum := Compute_Checksum_16 ((1 => 0, 2 => 1, 3 => 2, 4 => 3, 5 => 4, 6 => 5, 7 => 6, 8 => 7, 9 => 8, 10 => 9)); - pragma Assert (Checksum = (16#14#, 16#19#), "Expected " & Basic_Types.Representation.To_Tuple_String ((16#14#, 16#19#)) & " and got " & Basic_Types.Representation.To_Tuple_String (Checksum)); - Checksum := Compute_Checksum_16 ((255, 1, 2, 10, 4, 15, 6, 0, 254, 9), Seed => (0, 11)); - pragma Assert (Checksum = (16#09#, 16#2E#), "Expected " & Basic_Types.Representation.To_Tuple_String ((16#09#, 16#2E#)) & " and got " & Basic_Types.Representation.To_Tuple_String (Checksum)); - Checksum := Compute_Checksum_16 ((255, 1, 2, 10, 4, 15, 6, 0, 254), Seed => (0, 11)); - pragma Assert (Checksum = (16#09#, 16#25#), "Expected " & Basic_Types.Representation.To_Tuple_String ((16#09#, 16#25#)) & " and got " & Basic_Types.Representation.To_Tuple_String (Checksum)); - Checksum := Compute_Checksum_16 ((255, 1, 2, 10, 4, 15, 6, 0, 254)); - pragma Assert (Checksum = (16#09#, 16#1A#), "Expected " & Basic_Types.Representation.To_Tuple_String ((16#09#, 16#1A#)) & " and got " & Basic_Types.Representation.To_Tuple_String (Checksum)); - Checksum := Compute_Checksum_16 (( + Checksum := Compute_Checksum_16 ([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]); + pragma Assert (Checksum = [16#14#, 16#19#], "Expected " & Basic_Types.Representation.To_Tuple_String ([16#14#, 16#19#]) & " and got " & Basic_Types.Representation.To_Tuple_String (Checksum)); + Checksum := Compute_Checksum_16 ([1 => 0, 2 => 1, 3 => 2, 4 => 3, 5 => 4, 6 => 5, 7 => 6, 8 => 7, 9 => 8, 10 => 9]); + pragma Assert (Checksum = [16#14#, 16#19#], "Expected " & Basic_Types.Representation.To_Tuple_String ([16#14#, 16#19#]) & " and got " & Basic_Types.Representation.To_Tuple_String (Checksum)); + Checksum := Compute_Checksum_16 ([255, 1, 2, 10, 4, 15, 6, 0, 254, 9], Seed => [0, 11]); + pragma Assert (Checksum = [16#09#, 16#2E#], "Expected " & Basic_Types.Representation.To_Tuple_String ([16#09#, 16#2E#]) & " and got " & Basic_Types.Representation.To_Tuple_String (Checksum)); + Checksum := Compute_Checksum_16 ([255, 1, 2, 10, 4, 15, 6, 0, 254], Seed => [0, 11]); + pragma Assert (Checksum = [16#09#, 16#25#], "Expected " & Basic_Types.Representation.To_Tuple_String ([16#09#, 16#25#]) & " and got " & Basic_Types.Representation.To_Tuple_String (Checksum)); + Checksum := Compute_Checksum_16 ([255, 1, 2, 10, 4, 15, 6, 0, 254]); + pragma Assert (Checksum = [16#09#, 16#1A#], "Expected " & Basic_Types.Representation.To_Tuple_String ([16#09#, 16#1A#]) & " and got " & Basic_Types.Representation.To_Tuple_String (Checksum)); + Checksum := Compute_Checksum_16 ([ 16#1B#, 16#78#, 16#C3#, @@ -181,6 +181,6 @@ begin 16#98#, 16#93#, 16#08# - )); - pragma Assert (Checksum = (16#E5#, 16#7D#), "Expected " & Basic_Types.Representation.To_Tuple_String ((16#E5#, 16#7D#)) & " and got " & Basic_Types.Representation.To_Tuple_String (Checksum)); + ]); + pragma Assert (Checksum = [16#E5#, 16#7D#], "Expected " & Basic_Types.Representation.To_Tuple_String ([16#E5#, 16#7D#]) & " and got " & Basic_Types.Representation.To_Tuple_String (Checksum)); end Test;