Author: nextgens
Date: 2008-11-18 19:18:08 +0000 (Tue, 18 Nov 2008)
New Revision: 23738

Modified:
   
trunk/contrib/java-test/org/spaceroots/mantissa/random/MersenneTwisterTest.java
Log:
introduce a consitency test to avoid the freenet-ext #24 fiasco

Modified: 
trunk/contrib/java-test/org/spaceroots/mantissa/random/MersenneTwisterTest.java
===================================================================
--- 
trunk/contrib/java-test/org/spaceroots/mantissa/random/MersenneTwisterTest.java 
    2008-11-18 18:59:45 UTC (rev 23737)
+++ 
trunk/contrib/java-test/org/spaceroots/mantissa/random/MersenneTwisterTest.java 
    2008-11-18 19:18:08 UTC (rev 23738)
@@ -9,6 +9,13 @@
     super(name);
   }
 
+  public void testBytesToInt() {
+    // Test the consistency in order to avoid the freenet-ext #24 fiasco
+    byte[] bytes = new byte[] { 0, 1, 2, 2 };
+    int outLong = MersenneTwister.bytesToInt(bytes, 0);
+    assertEquals(outLong, 33685760);
+  }
+
   public void testDouble() {
     MersenneTwister mt = new MersenneTwister(195357343514l);
     ScalarSampleStatistics sample = new ScalarSampleStatistics();

_______________________________________________
cvs mailing list
[email protected]
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs

Reply via email to