Skip to content

Commit

Permalink
replacing ()0 .. 5 => 0)
Browse files Browse the repository at this point in the history
  • Loading branch information
dinkelk committed Jul 8, 2024
1 parent 8372542 commit 91acbad
Show file tree
Hide file tree
Showing 20 changed files with 90 additions and 90 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -102,7 +102,7 @@ package body Ccsds_Command_Depacketizer_Tests.Implementation is
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));
Cmd2 : constant Command.T := Construct_Command (Id => 22, Arg_Buffer => [1 .. 0 => 0]);
begin
-- Send the packet:
T.Ccsds_Space_Packet_T_Send (Packet);
Expand Down Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ package body Event_Filter_Entry_Tests.Implementation 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_Empty_List : constant Event_Id_List := [1 .. 0 => 0];
State_Return_Status : Filter_Status;

-- Test setup for catching an invalid input range
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ package body Event_Limiter_Tests.Implementation is
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_Empty_List : constant Event_Id_List := [1 .. 0 => 0];
Start_Id : constant Event_Types.Event_Id := 0;
begin
Put_Line ("");
Expand Down Expand Up @@ -636,7 +636,7 @@ package body Event_Limiter_Tests.Implementation is
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_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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ package body Two_Counter_Entry_Tests.Implementation 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_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
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,12 @@ 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:
Expand Down Expand Up @@ -240,7 +240,7 @@ 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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -494,7 +494,7 @@ 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 (0 .. 4), [0 .. 4 => 15]);
Byte_Array_Assert.Eq (Memory (5 .. Memory'Last), (5 .. Memory'Last => 0));

-- Send command to write middle of region:
Expand All @@ -512,8 +512,8 @@ 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 (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:
Expand All @@ -531,8 +531,8 @@ 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 (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));

Expand All @@ -551,10 +551,10 @@ 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 (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 (98 .. 98), [98 .. 98 => 18]);
Byte_Array_Assert.Eq (Memory (99 .. Memory'Last), (99 .. Memory'Last => 44));
end Test_Nominal_Memory_Write;

Expand Down Expand Up @@ -613,7 +613,7 @@ 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 (0 .. 4), [0 .. 4 => 15]);
Byte_Array_Assert.Eq (Memory (5 .. Memory'Last), (5 .. Memory'Last => 0));
end Test_Write_Unreleased_Region;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,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 .. 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));
Expand Down Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -121,7 +121,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);
Pkt : Packet.T;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/core/serializer/test/test.adb
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ procedure Test is
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));
Expand Down
Loading

0 comments on commit 91acbad

Please sign in to comment.