Natools

Check-in [dd07424307]
Login
Overview
Comment:s_expressions-cache_tests: add a test for the new replayable interface
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: dd0742430763b8b00045d74f675a577b34e9962b
User & Date: nat on 2014-09-09 18:36:47
Other Links: manifest | tags
Context
2014-09-10
19:08
s_expressions-printers: add an option for Transfer to stay in the current nesting level check-in: 02db3410f5 user: nat tags: trunk
2014-09-09
18:36
s_expressions-cache_tests: add a test for the new replayable interface check-in: dd07424307 user: nat tags: trunk
2014-09-08
19:52
s_expressions-generic_caches: implement the new Replayable.Descriptor interface in cursors check-in: 14c328e4b4 user: nat tags: trunk
Changes

Modified tests/natools-s_expressions-cache_tests.adb from [47eb5e3287] to [8372577f83].

74
75
76
77
78
79
80

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







+








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


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

332
333
334
335
336
337
338














































339
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386







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

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


   procedure Replayable_Interface (Report : in out NT.Reporter'Class) is
      Test : NT.Test := Report.Item ("Replayable.Descriptor insterface");
   begin
      declare
         Cache : Caches.Reference;
         First, Second : Caches.Cursor;
      begin
         Cache.Append_Atom (To_Atom ("begin"));
         Cache.Open_List;
         Cache.Append_Atom (To_Atom ("command"));
         Cache.Open_List;
         Cache.Append_Atom (To_Atom ("first"));
         Cache.Append_Atom (To_Atom ("second"));
         Cache.Close_List;
         Cache.Close_List;
         Cache.Append_Atom (To_Atom ("end"));

         First := Cache.First;

         Test_Tools.Test_Atom_Accessors (Test, First, To_Atom ("begin"), 0);

         Test_Tools.Next_And_Check (Test, First, Events.Open_List, 1);
         Test_Tools.Test_Atom_Accessor_Exceptions (Test, First);
         Test_Tools.Next_And_Check (Test, First, To_Atom ("command"), 1);
         Second := First.Duplicate;
         Test_Tools.Next_And_Check (Test, First, Events.Open_List, 2);
         Test_Tools.Next_And_Check (Test, First, To_Atom ("first"), 2);
         Test_Tools.Next_And_Check (Test, First, To_Atom ("second"), 2);
         Test_Tools.Next_And_Check (Test, First, Events.Close_List, 1);
         Test_Tools.Next_And_Check (Test, Second, Events.Open_List, 2);
         Test_Tools.Next_And_Check (Test, Second, To_Atom ("first"), 2);
         Test_Tools.Next_And_Check (Test, Second, To_Atom ("second"), 2);
         Test_Tools.Next_And_Check (Test, First, Events.Close_List, 0);
         Test_Tools.Next_And_Check (Test, Second, Events.Close_List, 1);
         Test_Tools.Test_Atom_Accessor_Exceptions (Test, Second);
         Test_Tools.Next_And_Check (Test, Second, Events.Close_List, 0);
         Test_Tools.Next_And_Check (Test, Second, To_Atom ("end"), 0);
         Test_Tools.Next_And_Check (Test, First, To_Atom ("end"), 0);
         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 Replayable_Interface;

end Natools.S_Expressions.Cache_Tests;

Modified tests/natools-s_expressions-cache_tests.ads from [132164956e] to [793d6401a2].

28
29
30
31
32
33
34

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







+



   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);
   procedure Replayable_Interface (Report : in out NT.Reporter'Class);

end Natools.S_Expressions.Cache_Tests;