commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From er...@apache.org
Subject commons-rng git commit: Unit test.
Date Thu, 01 Sep 2016 23:40:51 GMT
Repository: commons-rng
Updated Branches:
  refs/heads/master 3a703ee1a -> 5dd1aeff7


Unit test.


Project: http://git-wip-us.apache.org/repos/asf/commons-rng/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-rng/commit/5dd1aeff
Tree: http://git-wip-us.apache.org/repos/asf/commons-rng/tree/5dd1aeff
Diff: http://git-wip-us.apache.org/repos/asf/commons-rng/diff/5dd1aeff

Branch: refs/heads/master
Commit: 5dd1aeff7e6926776f958587fa5b508b3c1585e0
Parents: 3a703ee
Author: Gilles <erans@apache.org>
Authored: Fri Sep 2 03:39:11 2016 +0200
Committer: Gilles <erans@apache.org>
Committed: Fri Sep 2 03:39:11 2016 +0200

----------------------------------------------------------------------
 .../internal/util/IntArray2LongArrayTest.java   | 39 ++++++++++++++++++++
 1 file changed, 39 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-rng/blob/5dd1aeff/src/test/java/org/apache/commons/rng/internal/util/IntArray2LongArrayTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/rng/internal/util/IntArray2LongArrayTest.java
b/src/test/java/org/apache/commons/rng/internal/util/IntArray2LongArrayTest.java
new file mode 100644
index 0000000..57c2d7e
--- /dev/null
+++ b/src/test/java/org/apache/commons/rng/internal/util/IntArray2LongArrayTest.java
@@ -0,0 +1,39 @@
+/*
+ * 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.internal.util;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+/**
+ * Tests for the {@link IntArray2LongArray} converter.
+ */
+public class IntArray2LongArrayTest {
+    @Test
+    public void testSeedSizeIsMultipleOfLongSize() {
+        final int[] seed = new int[12];
+        final long[] out = new IntArray2LongArray().convert(seed);
+        Assert.assertEquals(6, out.length);
+    }
+
+    @Test
+    public void testSeedSizeIsNotMultipleOfLongSize() {
+        final int[] seed = new int[13];
+        final long[] out = new IntArray2LongArray().convert(seed);
+        Assert.assertEquals(7, out.length);
+    }
+}


Mime
View raw message