From: <dr...@us...> - 2002-11-10 21:26:57
|
Update of /cvsroot/webmacro/webmacro/test/unit/org/webmacro/util In directory usw-pr-cvs1:/tmp/cvs-serv16361/test/unit/org/webmacro/util Added Files: TestMathTool.java Log Message: fixing bug #59: MathTool.random() oversteps its bounds --- NEW FILE: TestMathTool.java --- /* * Created by IntelliJ IDEA. * User: e_ridge * Date: Nov 10, 2002 * Time: 4:15:21 PM * To change template for new class use * Code Style | Class Templates options (Tools | IDE Options). */ package org.webmacro.util; import junit.framework.TestCase; import org.webmacro.servlet.MathTool; public class TestMathTool extends TestCase { public TestMathTool(String s) { super(s); } public void testRandom () { for (int x=0; x<1000000; x++) { int rnd = MathTool.random(3, 5); assert (""+rnd, rnd >= 3 && rnd <=5); } } } |