Skip to content

Commit

Permalink
Simplify assertions with equivalent but more simple.
Browse files Browse the repository at this point in the history
  • Loading branch information
arturobernalg committed Aug 14, 2021
1 parent 6260581 commit aca9c1a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
Expand Up @@ -16,7 +16,6 @@
*/
package org.apache.commons.rng.core;

import java.util.Arrays;

import org.junit.Test;
import org.junit.Assert;
Expand All @@ -30,6 +29,6 @@ public void testConsistency() {
final byte[] internalState = {1, 0, -23, 67, -128, 54, 100, 127};
final RandomProviderDefaultState state = new RandomProviderDefaultState(internalState);

Assert.assertTrue(Arrays.equals(internalState, state.getState()));
Assert.assertArrayEquals(internalState, state.getState());
}
}
Expand Up @@ -17,7 +17,6 @@

package org.apache.commons.rng.simple;

import java.util.Arrays;
import org.junit.Assert;

import org.apache.commons.rng.UniformRandomProvider;
Expand Down Expand Up @@ -75,15 +74,15 @@ public static void assertProduceSameSequence(UniformRandomProvider rng1,
for (int i = 0; i < 3; i++) {
rng1.nextBytes(a1);
rng2.nextBytes(a2);
Assert.assertTrue(Arrays.equals(a1, a2));
Assert.assertArrayEquals(a1, a2);
}

for (int i = 0; i < 5; i++) {
final int offset = 200 + i;
final int n = 23 + i;
rng1.nextBytes(a1, offset, n);
rng2.nextBytes(a2, offset, n);
Assert.assertTrue(Arrays.equals(a1, a2));
Assert.assertArrayEquals(a1, a2);
}
}
}

0 comments on commit aca9c1a

Please sign in to comment.