Natools

Check-in [0faa8fc7d8]
Login
Overview
Comment:s_expressions-cache_tests: add a test for the new Lockable.Descriptor interface of cache objects
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 0faa8fc7d8f6c3ca5a7a88e5f9e0ec70110f1516
User & Date: nat on 2014-03-08 14:11:48
Other Links: manifest | tags
Context
2014-03-09
15:34
s_expressions-generic_caches: fix incorrect handling of Open_List and Close_List on brand new cache objects check-in: 8f20693700 user: nat tags: trunk
2014-03-08
14:11
s_expressions-cache_tests: add a test for the new Lockable.Descriptor interface of cache objects check-in: 0faa8fc7d8 user: nat tags: trunk
2014-03-07
21:53
s_expressions-generic_caches: implement Lockable.Descriptor interface on memory caches check-in: 660d5d43a4 user: nat tags: trunk
Changes

Modified tests/natools-s_expressions-cache_tests.adb from [ff4dd3eb96] to [f3f37a7b0d].

17
18
19
20
21
22
23


24
25
26
27
28
29
30
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32







+
+







with System.Storage_Pools;

with GNAT.Debug_Pools;

with Natools.S_Expressions.Atom_Buffers;
with Natools.S_Expressions.Caches;
with Natools.S_Expressions.Generic_Caches;
with Natools.S_Expressions.Lockable.Tests;
with Natools.S_Expressions.Parsers;
with Natools.S_Expressions.Printers;
with Natools.S_Expressions.Test_Tools;

package body Natools.S_Expressions.Cache_Tests is

   Pool : GNAT.Debug_Pools.Debug_Pool;

71
72
73
74
75
76
77

78
79
80
81
82
83
84
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87







+







   -------------------------

   procedure All_Tests (Report : in out NT.Reporter'Class) is
   begin
      Default_Instantiation (Report);
      Debug_Instantiation (Report);
      Descriptor_Interface (Report);
      Lockable_Interface (Report);
   end All_Tests;


   -----------------------
   -- Inidividual Tests --
   -----------------------

303
304
305
306
307
308
309



























310
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340







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

         Test_Tools.Next_And_Check (Test, First, Events.End_Of_Input, 0);
         Test_Tools.Next_And_Check (Test, Second, Events.End_Of_Input, 0);
      end;
   exception
      when Error : others => Test.Report_Exception (Error);
   end Descriptor_Interface;


   procedure Lockable_Interface (Report : in out NT.Reporter'Class) is
      Test : NT.Test := Report.Item ("Lockable.Descriptor insterface");
   begin
      declare
         Cache : Caches.Reference;
      begin
         declare
            Input : aliased Test_Tools.Memory_Stream;
            Parser : aliased Parsers.Parser;
            Subparser : Parsers.Subparser (Parser'Access, Input'Access);
         begin
            Input.Set_Data (Lockable.Tests.Test_Expression);
            Test_Tools.Next_And_Check (Test, Subparser, Events.Open_List, 1);
            Printers.Transfer (Subparser, Cache);
         end;

         declare
            Cursor : Caches.Cursor := Cache.First;
         begin
            Lockable.Tests.Test_Interface (Test, Cursor);
         end;
      end;
   exception
      when Error : others => Test.Report_Exception (Error);
   end Lockable_Interface;

end Natools.S_Expressions.Cache_Tests;

Modified tests/natools-s_expressions-cache_tests.ads from [089397de57] to [132164956e].

27
28
29
30
31
32
33

34
35
27
28
29
30
31
32
33
34
35
36







+


   package NT renames Natools.Tests;

   procedure All_Tests (Report : in out NT.Reporter'Class);

   procedure Debug_Instantiation (Report : in out NT.Reporter'Class);
   procedure Default_Instantiation (Report : in out NT.Reporter'Class);
   procedure Descriptor_Interface (Report : in out NT.Reporter'Class);
   procedure Lockable_Interface (Report : in out NT.Reporter'Class);

end Natools.S_Expressions.Cache_Tests;