changeset 7619:1047164c8255

Merge
author mduigou
date Tue, 12 Mar 2013 17:10:50 -0700
parents 1a9739e922cd 62464bba05b2
children c4384d0a2706
files test/java/util/stream/Stream/IntStreamTest.java
diffstat 1 files changed, 8 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/test/java/util/stream/Stream/IntStreamTest.java	Tue Mar 12 17:09:43 2013 -0700
+++ b/test/java/util/stream/Stream/IntStreamTest.java	Tue Mar 12 17:10:50 2013 -0700
@@ -33,6 +33,7 @@
 
 import java.util.*;
 import java.util.concurrent.atomic.AtomicInteger;
+import java.util.concurrent.atomic.AtomicLong;
 import java.util.function.BiFunction;
 import java.util.function.IntPredicate;
 import java.util.stream.IntStream;
@@ -175,13 +176,13 @@
                     : (p == ParallelType.Sequential) ? Arrays.stream(array).sequential() :
                     Arrays.stream(array);
             double total1 = 0;
-            int total1Int = 0;
+            int intTotal1 = 0;
             for(int index = 0; index < array.length; index++) {
                 total1 += array[index];
-                total1Int += array[index];
+                intTotal1 += array[index];
             }
             assertEquals(avgStream1.average().getAsDouble(), total1 / array.length);
-            assertEquals(sumStream1.sum(), total1Int);
+            assertEquals(sumStream1.sum(), intTotal1);
 
             int startIndex = rand.nextInt(array.length);
             int endIndex = startIndex + rand.nextInt(array.length - startIndex + 1);
@@ -196,13 +197,13 @@
                assertEquals(sumStream2.sum(), 0);
             } else {
                 double total2 = 0;
-                int total2Int = 0;
+                int intTotal2 = 0;
                 for(int index = startIndex; index < endIndex; index++) {
                     total2 += array[index];
-                    total2Int += array[index];
+                    intTotal2 += array[index];
                 }
                 assertEquals(avgStream2.average().getAsDouble(), total2 / (endIndex - startIndex));
-                assertEquals(sumStream2.sum(), total2Int);
+                assertEquals(sumStream2.sum(), intTotal2);
             }
         }
     }
@@ -629,7 +630,7 @@
                     : (p == ParallelType.Sequential) ? Arrays.stream(array).sequential() :
                     Arrays.stream(array);
             AtomicInteger ai1 = new AtomicInteger(0);
-            long sum = stream1.peek(LambdaUtilities.addIntConsumer(ai1)).sum();
+            int sum = stream1.peek(LambdaUtilities.addIntConsumer(ai1)).sum();
             assertEquals(ai1.get(), sum);
 
             IntStream emptyStream = (p == ParallelType.Parallel) ? Arrays.parallelStream(new int[0]):