Index: tests/natools-reference_tests.adb ================================================================== --- tests/natools-reference_tests.adb +++ tests/natools-reference_tests.adb @@ -239,10 +239,33 @@ 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; @@ -490,11 +513,12 @@ 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; Index: tests/natools-reference_tests.ads ================================================================== --- tests/natools-reference_tests.ads +++ tests/natools-reference_tests.ads @@ -36,10 +36,11 @@ procedure All_Tests (Report : in out NT.Reporter'Class); -- All tests except Test_Task_Safety (see the Note above) procedure Test_Data_Access (Report : in out NT.Reporter'Class); procedure Test_Double_Finalize (Report : in out NT.Reporter'Class); + procedure Test_Implicit_Dereference (Report : in out NT.Reporter'Class); procedure Test_Instance_Counts (Report : in out NT.Reporter'Class); procedure Test_Reference_Counts (Report : in out NT.Reporter'Class); procedure Test_Reference_Tests (Report : in out NT.Reporter'Class); procedure Test_Task_Safety (Report : in out NT.Reporter'Class);