Natools

Diff
Login

Differences From Artifact [2ff64e22d8]:

To Artifact [8f83a23777]:


237
238
239
240
241
242
243























244
245
246
247
248
249
250
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273







+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+







      if Continue then
         NT.Item (Report, Name, NT.Success);
      end if;
   exception
      when Error : others => NT.Report_Exception (Report, Name, Error);
   end Test_Double_Finalize;


   procedure Test_Implicit_Dereference (Report : in out NT.Reporter'Class) is
      Test : NT.Test := Report.Item ("Implicit dereference");
      Other_Number : constant Integer := 123;

      procedure Set_Number (Object : in out Counter);

      procedure Set_Number (Object : in out Counter) is
      begin
         Object.Instance_Number := Other_Number;
      end Set_Number;
   begin
      declare
         Ref : constant Refs.Reference := Refs.Create (Factory'Access);
         Original_Number : constant Natural := Ref.Query.Instance_Number;
      begin
         Set_Number (Ref.Update);
         Ref.Update.Instance_Number := Original_Number;
      end;
   exception
      when Error : others => Test.Report_Exception (Error);
   end Test_Implicit_Dereference;


   procedure Test_Instance_Counts (Report : in out NT.Reporter'Class) is
      Name : constant String := "Instance counts";
      Initial_Count : constant Integer := Instance_Count;
      Continue : Boolean := True;
   begin
      declare
488
489
490
491
492
493
494

495
496
497
498
499
500
511
512
513
514
515
516
517
518
519
520
521
522
523
524







+






   -- Test everything --
   ---------------------

   procedure All_Tests (Report : in out NT.Reporter'Class) is
   begin
      Test_Data_Access (Report);
      Test_Double_Finalize (Report);
      Test_Implicit_Dereference (Report);
      Test_Instance_Counts (Report);
      Test_Reference_Counts (Report);
      Test_Reference_Tests (Report);
   end All_Tests;

end Natools.Reference_Tests;