1-- Copyright 1998-2014 Simon Wright <simon@pushface.org> 2 3-- This package is free software; you can redistribute it and/or 4-- modify it under terms of the GNU General Public License as 5-- published by the Free Software Foundation; either version 2, or 6-- (at your option) any later version. This package is distributed in 7-- the hope that it will be useful, but WITHOUT ANY WARRANTY; without 8-- even the implied warranty of MERCHANTABILITY or FITNESS FOR A 9-- PARTICULAR PURPOSE. See the GNU General Public License for more 10-- details. You should have received a copy of the GNU General Public 11-- License distributed with this package; see file COPYING. If not, 12-- write to the Free Software Foundation, 59 Temple Place - Suite 13-- 330, Boston, MA 02111-1307, USA. 14 15with Ada.Finalization; 16with BC.Support.Smart_Pointers.Test_Finalize; 17 18package Smart_Test_Support is 19 20 -- This type is used to test BC.Support.Smart_Pointers. It's 21 -- Controlled simply so that we can see when instances are 22 -- deleted. 23 type T is new Ada.Finalization.Controlled with record 24 C : Character; 25 end record; 26 type P is access T; 27 28 procedure Finalize (The_T : in out T); 29 30 package Smart is new BC.Support.Smart_Pointers (T => T, P => P); 31 procedure Smart_Test_Finalize is new Smart.Test_Finalize; 32 33 function Create (Ch : Character) return Smart.Pointer; 34 function Value (P : Smart.Pointer) return Character; 35 36 -- Timing tests. Only need one level of controlledness for this. 37 type Character_P is access Character; 38 package Smart_Characters 39 is new BC.Support.Smart_Pointers (T => Character, P => Character_P); 40 41end Smart_Test_Support; 42