Natools

Check-in [b0c9543345]
Login
Overview
Comment:s_expressions-atom_buffers-tests: use the new capacity accessor in tests
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: b0c95433457f750bf4d374243456e721b07ca5ce
User & Date: nat on 2014-08-10 17:13:50
Other Links: manifest | tags
Context
2014-08-11
17:30
s_expressions-parsers-tests: use the new capacity accessor instead of "=" to test buffers check-in: bec485b991 user: nat tags: trunk
2014-08-10
17:13
s_expressions-atom_buffers-tests: use the new capacity accessor in tests check-in: b0c9543345 user: nat tags: trunk
2014-08-09
10:37
s_expressions-atom_buffers: add a capacity accessor check-in: 43ab20ac63 user: nat tags: trunk
Changes

Modified tests/natools-s_expressions-atom_buffers-tests.adb from [3b89ddc3f5] to [af14b7fc76].

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
387
388
389
390
391
392
393
394
395
396
397

            if Buffer.Raw_Query.Data /= Accessor.Data then
               Report.Item (Name, NT.Fail);
               Report.Info ("Soft reset changed storage area");
               return;
            end if;

            if Buffer.Raw_Query.Data.all'Length /= Buffer.Available then
               Report.Item (Name, NT.Fail);
               Report.Info ("Available length inconsistency, recorded"
                 & Count'Image (Buffer.Available) & ", actual"
                 & Count'Image (Buffer.Raw_Query.Data.all'Length));
               return;
            end if;

            if Buffer.Data'Length /= Buffer.Used then
               Report.Item (Name, NT.Fail);
               Report.Info ("Used length inconsistency, recorded"
                 & Count'Image (Buffer.Used) & ", actual"
                 & Count'Image (Buffer.Data'Length));
               return;
            end if;
         end;

         for O in Octet'(10) .. Octet'(50) loop
            Buffer.Append (O);
         end loop;

         Buffer.Hard_Reset;

         if Buffer.Length /= 0
           or else Buffer.Available /= 0
           or else not Buffer.Ref.Is_Empty
         then
            Report.Item (Name, NT.Fail);
            Report.Info ("Hard reset did not completely clean structure");
         end if;
      end;








|


|




















|







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
387
388
389
390
391
392
393
394
395
396
397

            if Buffer.Raw_Query.Data /= Accessor.Data then
               Report.Item (Name, NT.Fail);
               Report.Info ("Soft reset changed storage area");
               return;
            end if;

            if Buffer.Raw_Query.Data.all'Length /= Buffer.Capacity then
               Report.Item (Name, NT.Fail);
               Report.Info ("Available length inconsistency, recorded"
                 & Count'Image (Buffer.Capacity) & ", actual"
                 & Count'Image (Buffer.Raw_Query.Data.all'Length));
               return;
            end if;

            if Buffer.Data'Length /= Buffer.Used then
               Report.Item (Name, NT.Fail);
               Report.Info ("Used length inconsistency, recorded"
                 & Count'Image (Buffer.Used) & ", actual"
                 & Count'Image (Buffer.Data'Length));
               return;
            end if;
         end;

         for O in Octet'(10) .. Octet'(50) loop
            Buffer.Append (O);
         end loop;

         Buffer.Hard_Reset;

         if Buffer.Length /= 0
           or else Buffer.Capacity /= 0
           or else not Buffer.Ref.Is_Empty
         then
            Report.Item (Name, NT.Fail);
            Report.Info ("Hard reset did not completely clean structure");
         end if;
      end;