[llvm-commits] CVS: llvm-java/test/Programs/SingleSource/UnitTests/Collections2.java Collections1.java Collections.java
Alkis Evlogimenos
alkis at cs.uiuc.edu
Tue Feb 1 20:58:16 PST 2005
Changes in directory llvm-java/test/Programs/SingleSource/UnitTests:
Collections2.java updated: 1.2 -> 1.3
Collections1.java updated: 1.2 -> 1.3
Collections.java updated: 1.3 -> 1.4
---
Log message:
Make tests a bit more interesting.
---
Diffs of the changes: (+9 -6)
Collections.java | 11 +++++++----
Collections1.java | 2 +-
Collections2.java | 2 +-
3 files changed, 9 insertions(+), 6 deletions(-)
Index: llvm-java/test/Programs/SingleSource/UnitTests/Collections2.java
diff -u llvm-java/test/Programs/SingleSource/UnitTests/Collections2.java:1.2 llvm-java/test/Programs/SingleSource/UnitTests/Collections2.java:1.3
--- llvm-java/test/Programs/SingleSource/UnitTests/Collections2.java:1.2 Tue Jan 25 10:45:11 2005
+++ llvm-java/test/Programs/SingleSource/UnitTests/Collections2.java Tue Feb 1 22:58:05 2005
@@ -4,7 +4,7 @@
{
public static void main(String[] args) {
Collection c1 = new TreeSet();
- Collections.fillCollectionWithInts(c1);
+ Collections.fillCollectionWithRandomInts(c1);
Collections.printIntCollection(c1);
}
}
Index: llvm-java/test/Programs/SingleSource/UnitTests/Collections1.java
diff -u llvm-java/test/Programs/SingleSource/UnitTests/Collections1.java:1.2 llvm-java/test/Programs/SingleSource/UnitTests/Collections1.java:1.3
--- llvm-java/test/Programs/SingleSource/UnitTests/Collections1.java:1.2 Tue Jan 25 10:45:11 2005
+++ llvm-java/test/Programs/SingleSource/UnitTests/Collections1.java Tue Feb 1 22:58:05 2005
@@ -4,7 +4,7 @@
{
public static void main(String[] args) {
Collection c1 = new LinkedList();
- Collections.fillCollectionWithInts(c1);
+ Collections.fillCollectionWithRandomInts(c1);
Collections.printIntCollection(c1);
}
}
Index: llvm-java/test/Programs/SingleSource/UnitTests/Collections.java
diff -u llvm-java/test/Programs/SingleSource/UnitTests/Collections.java:1.3 llvm-java/test/Programs/SingleSource/UnitTests/Collections.java:1.4
--- llvm-java/test/Programs/SingleSource/UnitTests/Collections.java:1.3 Tue Jan 25 10:45:11 2005
+++ llvm-java/test/Programs/SingleSource/UnitTests/Collections.java Tue Feb 1 22:58:05 2005
@@ -2,9 +2,12 @@
public class Collections
{
- public static void fillCollectionWithInts(Collection c) {
- for (int i = 0; i < 10; ++i)
- c.add(new Integer(i));
+ public static Random rand = new Random(0);
+
+ public static void fillCollectionWithRandomInts(Collection c) {
+ int size = rand.nextInt(45) + 5;
+ for (int i = 0; i < size; ++i)
+ c.add(new Integer(rand.nextInt()));
}
public static void printIntCollection(Collection c) {
@@ -14,7 +17,7 @@
public static void main(String[] args) {
Collection c1 = new TreeSet();
- fillCollectionWithInts(c1);
+ fillCollectionWithRandomInts(c1);
Collection c2 = new TreeSet(c1);
Test.println(c1.remove(new Integer(5)));
More information about the llvm-commits
mailing list