Natools

Check-in [7064962d3b]
Login
Overview
Comment:cron: fix event order when extending an event list
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 7064962d3b5cf66678c1d1bc3f12c4bc97b39442
User & Date: nat on 2017-07-08 21:30:15
Other Links: manifest | tags
Context
2017-07-09
21:04
cron-tests: re-tune to achieve full coverage check-in: 5b22a3626b user: nat tags: trunk
2017-07-08
21:30
cron: fix event order when extending an event list check-in: 7064962d3b user: nat tags: trunk
2017-07-07
20:11
cron-tests: add a test for event list extension by a single event check-in: 757553b10d user: nat tags: trunk
Changes

Modified src/natools-cron.adb from [ef3067335b] to [f0ce301f6c].

209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
                     end loop;
                  else
                     Append
                       (Event_List (Previous.Update.Data.all),
                        Callback);
                  end if;
               elsif Callback.Query.Data.all in Event_List then
                  Append (Event_List (Callback.Update.Data.all), Previous);
                  Map.Replace_Element (Position, Callback);
               else
                  Map.Replace_Element
                    (Position,
                     Create_Event_List (Previous, Callback));
               end if;
            end if;







|







209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
                     end loop;
                  else
                     Append
                       (Event_List (Previous.Update.Data.all),
                        Callback);
                  end if;
               elsif Callback.Query.Data.all in Event_List then
                  Prepend (Event_List (Callback.Update.Data.all), Previous);
                  Map.Replace_Element (Position, Callback);
               else
                  Map.Replace_Element
                    (Position,
                     Create_Event_List (Previous, Callback));
               end if;
            end if;
388
389
390
391
392
393
394








395
396
397
398
399
400
401
   procedure Append
     (Self : in out Event_List;
      Ref : in Callback_Refs.Reference) is
   begin
      Self.List.Append (Ref);
   end Append;










   procedure Remove
     (Self : in out Event_List;
      Ref : in Callback_Refs.Reference;
      Removed : out Boolean)
   is
      use type Callback_Refs.Reference;







>
>
>
>
>
>
>
>







388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
   procedure Append
     (Self : in out Event_List;
      Ref : in Callback_Refs.Reference) is
   begin
      Self.List.Append (Ref);
   end Append;


   procedure Prepend
     (Self : in out Event_List;
      Ref : in Callback_Refs.Reference) is
   begin
      Self.List.Prepend (Ref);
   end Prepend;


   procedure Remove
     (Self : in out Event_List;
      Ref : in Callback_Refs.Reference;
      Removed : out Boolean)
   is
      use type Callback_Refs.Reference;

Modified src/natools-cron.ads from [de34f4fcac] to [cb4eec89c7].

116
117
118
119
120
121
122





123
124
125
126
127
128
129
      --  Sequentially run the contained events

   procedure Append
     (Self : in out Event_List;
      Ref : in Callback_Refs.Reference);
      --  Append Ref at the end of Self.List






   procedure Remove
     (Self : in out Event_List;
      Ref : in Callback_Refs.Reference;
      Removed : out Boolean);
      --  Remove Ref from Self.List, through a linear search

   function Is_Empty (Self : Event_List) return Boolean;







>
>
>
>
>







116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
      --  Sequentially run the contained events

   procedure Append
     (Self : in out Event_List;
      Ref : in Callback_Refs.Reference);
      --  Append Ref at the end of Self.List

   procedure Prepend
     (Self : in out Event_List;
      Ref : in Callback_Refs.Reference);
      --  Prepend Ref at the beginning of Self.List

   procedure Remove
     (Self : in out Event_List;
      Ref : in Callback_Refs.Reference;
      Removed : out Boolean);
      --  Remove Ref from Self.List, through a linear search

   function Is_Empty (Self : Event_List) return Boolean;