public static void main (String[] args) throws Throwable { TestSuite theSuite; if (args.length > 0) { theSuite = new TestSuite (); for (int i = 0; i < args.length; i++) { theSuite.addTest (new TestBitVarSet (args[i])); } } else { theSuite = (TestSuite) suite (); } junit.textui.TestRunner.run (theSuite); }
private void checkOrdering (VarSet vs, Variable[] vars) { assertEquals (vars.length, vs.size ()); for (int i = 0; i < vars.length; i++) { assertEquals (vars[i], vs.get (i)); } }
public void testEqualsHashCode () { Variable[] vars = new Variable [4]; for (int i = 0; i < vars.length; i++) { vars[i] = new Variable(3); } Universe uni = vars[0].getUniverse (); BitVarSet c1 = new BitVarSet (uni, Arrays.asList (vars)); BitVarSet c2 = new BitVarSet (uni, Arrays.asList (vars)); assertTrue(c1.equals (c2)); assertTrue(c2.equals (c1)); assertEquals (c1.hashCode(), c2.hashCode ()); }
public void testAddAllOrdering2 () { for (int rep = 0; rep < 1000; rep++) { Variable[] vars = new Variable[] { new Variable(2), new Variable (2) }; Universe uni = vars[0].getUniverse (); BitVarSet vs = new BitVarSet (uni, new ArrayList ()); vs.addAll (Arrays.asList (vars)); checkOrdering (vs, vars); } }
public void testEqualsHashCode () { Variable[] vars = new Variable [4]; for (int i = 0; i < vars.length; i++) { vars[i] = new Variable(3); } Universe uni = vars[0].getUniverse (); BitVarSet c1 = new BitVarSet (uni, Arrays.asList (vars)); BitVarSet c2 = new BitVarSet (uni, Arrays.asList (vars)); assertTrue(c1.equals (c2)); assertTrue(c2.equals (c1)); assertEquals (c1.hashCode(), c2.hashCode ()); }
public void testAddAllOrdering2 () { for (int rep = 0; rep < 1000; rep++) { Variable[] vars = new Variable[] { new Variable(2), new Variable (2) }; Universe uni = vars[0].getUniverse (); BitVarSet vs = new BitVarSet (uni, new ArrayList ()); vs.addAll (Arrays.asList (vars)); checkOrdering (vs, vars); } }
public static void main (String[] args) throws Throwable { TestSuite theSuite; if (args.length > 0) { theSuite = new TestSuite (); for (int i = 0; i < args.length; i++) { theSuite.addTest (new TestBitVarSet (args[i])); } } else { theSuite = (TestSuite) suite (); } junit.textui.TestRunner.run (theSuite); }
public void testAddAllOrdering () { for (int rep = 0; rep < 1000; rep++) { Variable[] vars = new Variable[] { new Variable(2), new Variable (2) }; Universe uni = vars[0].getUniverse (); BitVarSet vs = new BitVarSet (uni, Arrays.asList (vars)); checkOrdering (vs, vars); } }
private void checkOrdering (VarSet vs, Variable[] vars) { assertEquals (vars.length, vs.size ()); for (int i = 0; i < vars.length; i++) { assertEquals (vars[i], vs.get (i)); } }
public void testAddAllOrdering () { for (int rep = 0; rep < 1000; rep++) { Variable[] vars = new Variable[] { new Variable(2), new Variable (2) }; Universe uni = vars[0].getUniverse (); BitVarSet vs = new BitVarSet (uni, Arrays.asList (vars)); checkOrdering (vs, vars); } }
public void testAddAllOrdering3 () { for (int rep = 0; rep < 1000; rep++) { Variable[] vars = new Variable[] { new Variable(2), new Variable (2) }; Universe uni = vars[0].getUniverse (); BitVarSet vsOld = new BitVarSet (uni, Arrays.asList (vars)); BitVarSet vs = new BitVarSet (vsOld); checkOrdering (vs, vars); } }
public void testAddAllOrdering3 () { for (int rep = 0; rep < 1000; rep++) { Variable[] vars = new Variable[] { new Variable(2), new Variable (2) }; Universe uni = vars[0].getUniverse (); BitVarSet vsOld = new BitVarSet (uni, Arrays.asList (vars)); BitVarSet vs = new BitVarSet (vsOld); checkOrdering (vs, vars); } }