You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by er...@apache.org on 2016/09/02 15:52:06 UTC
[1/2] commons-rng git commit: Typo ("test" Javadoc).
Repository: commons-rng
Updated Branches:
refs/heads/master 5dd1aeff7 -> 6d67b29e7
Typo ("test" Javadoc).
Project: http://git-wip-us.apache.org/repos/asf/commons-rng/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-rng/commit/4113b9a4
Tree: http://git-wip-us.apache.org/repos/asf/commons-rng/tree/4113b9a4
Diff: http://git-wip-us.apache.org/repos/asf/commons-rng/diff/4113b9a4
Branch: refs/heads/master
Commit: 4113b9a4181a0d08de5319d1f62a793bf7bc73e1
Parents: 5dd1aef
Author: Gilles <er...@apache.org>
Authored: Fri Sep 2 17:50:14 2016 +0200
Committer: Gilles <er...@apache.org>
Committed: Fri Sep 2 17:50:14 2016 +0200
----------------------------------------------------------------------
.../java/org/apache/commons/rng/ProvidersCommonParametricTest.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/commons-rng/blob/4113b9a4/src/test/java/org/apache/commons/rng/ProvidersCommonParametricTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/rng/ProvidersCommonParametricTest.java b/src/test/java/org/apache/commons/rng/ProvidersCommonParametricTest.java
index acfea7a..51f313b 100644
--- a/src/test/java/org/apache/commons/rng/ProvidersCommonParametricTest.java
+++ b/src/test/java/org/apache/commons/rng/ProvidersCommonParametricTest.java
@@ -37,7 +37,7 @@ import org.junit.runners.Parameterized.Parameters;
import org.apache.commons.rng.internal.util.NumberFactory;
/**
- * Test for tests which all generators must pass.
+ * Tests which all generators must pass.
*/
@RunWith(value=Parameterized.class)
public class ProvidersCommonParametricTest {
[2/2] commons-rng git commit: Unit tests.
Posted by er...@apache.org.
Unit tests.
Project: http://git-wip-us.apache.org/repos/asf/commons-rng/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-rng/commit/6d67b29e
Tree: http://git-wip-us.apache.org/repos/asf/commons-rng/tree/6d67b29e
Diff: http://git-wip-us.apache.org/repos/asf/commons-rng/diff/6d67b29e
Branch: refs/heads/master
Commit: 6d67b29e74d5bab83e2a0dd83857dd7210b7f522
Parents: 4113b9a
Author: Gilles <er...@apache.org>
Authored: Fri Sep 2 17:51:29 2016 +0200
Committer: Gilles <er...@apache.org>
Committed: Fri Sep 2 17:51:29 2016 +0200
----------------------------------------------------------------------
.../apache/commons/rng/RandomSourceTest.java | 69 ++++++++++++++++++++
1 file changed, 69 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/commons-rng/blob/6d67b29e/src/test/java/org/apache/commons/rng/RandomSourceTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/rng/RandomSourceTest.java b/src/test/java/org/apache/commons/rng/RandomSourceTest.java
new file mode 100644
index 0000000..ce24954
--- /dev/null
+++ b/src/test/java/org/apache/commons/rng/RandomSourceTest.java
@@ -0,0 +1,69 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.rng;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+/**
+ * Tests for {@link RandomSource}.
+ */
+public class RandomSourceTest {
+ @Test
+ public void testCreateInt() {
+ final int n = 4;
+ for (int i = 0; i < n; i++) {
+ // Can fail, but unlikely given the range.
+ Assert.assertNotEquals(RandomSource.createInt(),
+ RandomSource.createInt());
+ }
+ }
+
+ @Test
+ public void testCreateLong() {
+ final int n = 6;
+ for (int i = 0; i < n; i++) {
+ // Can fail, but unlikely given the range.
+ Assert.assertNotEquals(RandomSource.createLong(),
+ RandomSource.createLong());
+ }
+ }
+
+ @Test
+ public void testCreateIntArray() {
+ final int n = 13;
+ final int[] seed = RandomSource.createIntArray(n);
+ Assert.assertEquals(n, seed.length);
+
+ for (int i = 1; i < n; i++) {
+ // Can fail, but unlikely given the range.
+ Assert.assertNotEquals(seed[i - 1], seed[i]);
+ }
+ }
+
+ @Test
+ public void testCreateLongArray() {
+ final int n = 9;
+ final long[] seed = RandomSource.createLongArray(n);
+ Assert.assertEquals(n, seed.length);
+
+ for (int i = 1; i < n; i++) {
+ // Can fail, but unlikely given the range.
+ Assert.assertNotEquals(seed[i - 1], seed[i]);
+ }
+ }
+}