Login | Register
My pages Projects Community openCollabNet

Discussions > cvs > CVS update: /charles/src/testdir/

charles
Discussion topic

Back to topic list

CVS update: /charles/src/testdir/

Reply

Author matthewjheaney
Full name Matthew Heaney
Date 2004-03-13 08:14:43 PST
Message User: matthewjheaney
Date: 04/03/13 08:14:43

Modified:
 /charles/src/testdir/
  test_single_unbounded_merge.adb

Log:
 test empty containers, too

File Changes:

Directory: /charles/src/testdir/
====================​============

File [changed]: test_single_unbounded_merge.adb
Url: http://charles.tigri​s.org/source/browse/​charles/src/testdir/​test_single_unbounde​d_merge.adb?r1=1.2​&r2=1.3
Delta lines: +29 -14
---------------------
--- test_single_unbounded_merge.adb 13 Mar 2004 16:04:16 -0000 1.2
+++ test_single_unbounded_merge.adb 13 Mar 2004 16:14:41 -0000 1.3
@@ -22,10 +22,18 @@
 
    begin
 
+ Put (Length (C), Width => 0);
+ Put (": ");
+
+ if Is_Empty (C) then
+ Put ("<empty>");
+ else
       Iterate (C);
+ end if;
+
       New_Line;
 
- end;
+ end Print;
 
 
    function Is_Sorted (C : Container_Type) return Boolean is
@@ -103,13 +111,13 @@
       Put (Index, Width => 0);
       New_Line;
 
- N := 1 + Random (G) mod 21;
+ N := Random (G) mod 21;
 
       for I in 1 .. N loop
          Append (C1, New_Item => (Random (G) mod 26, 'a'));
       end loop;
 
- N := 1 + Random (G) mod 21;
+ N := Random (G) mod 21;
 
       for I in 1 .. N loop
          Append (C2, New_Item => (Random (G) mod 26, 'b'));
@@ -223,11 +231,14 @@
                Print (C2);
                New_Line;
 
+ if N2 > 0 then
                pragma Assert (K = First (C1));
                pragma Assert (Length (C1) = Count (C1));
                pragma Assert (Length (C2) = Count (C2));
                pragma Assert (Length (C1) = N1 + 1);
                pragma Assert (Length (C2) = N2 - 1);
+ null;
+ end if;
             end;
 
          elsif J = Last (C2) then
@@ -295,11 +306,14 @@
             Print (C2);
             New_Line;
 
+ if N2 > 0 then
             pragma Assert (K = Succ (I));
             pragma Assert (Length (C1) = Count (C1));
             pragma Assert (Length (C2) = Count (C2));
             pragma Assert (Length (C1) = N1 + 1);
             pragma Assert (Length (C2) = N2 - 1);
+ null;
+ end if;
          end;
 
       elsif J = Last (C2) then
@@ -351,6 +365,7 @@
 
       end if;
 
+ Put_Line ("sorting");
 
       Sort (C1);
       pragma Assert (Is_Sorted (C1));




--------------------​--------------------​--------------------​---------
To unsubscribe, e-mail: cvs-unsubscribe@char​les.tigris.org
For additional commands, e-mail: cvs-help at charles dot tigris dot org

« Previous message in topic | 1 of 1 | Next message in topic »

Messages

Show all messages in topic

CVS update: /charles/src/testdir/ matthewjheaney Matthew Heaney 2004-03-13 08:14:43 PST
Messages per page: