[Javabdd-checkins] JavaBDD_tests/bdd BasicTests.java,1.5,1.6
Brought to you by:
joewhaley
From: John W. <joe...@us...> - 2005-06-29 08:01:37
|
Update of /cvsroot/javabdd/JavaBDD_tests/bdd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3494/bdd Modified Files: BasicTests.java Log Message: Added replace test. Removed ensureCapacity tests. Index: BasicTests.java =================================================================== RCS file: /cvsroot/javabdd/JavaBDD_tests/bdd/BasicTests.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** BasicTests.java 29 Apr 2005 06:44:03 -0000 1.5 --- BasicTests.java 29 Jun 2005 08:01:29 -0000 1.6 *************** *** 17,20 **** --- 17,21 ---- import net.sf.javabdd.BDDException; import net.sf.javabdd.BDDFactory; + import net.sf.javabdd.BDDPairing; /** *************** *** 396,400 **** } ! public void testEnsureCapacity() { reset(); Assert.assertTrue(hasNext()); --- 397,440 ---- } ! public void testReplace() { ! reset(); ! Assert.assertTrue(hasNext()); ! while (hasNext()) { ! BDDFactory bdd = nextFactory(); ! if (bdd.varNum() < 5) bdd.setVarNum(5); ! BDDPairing p1 = bdd.makePair(0, 1); ! BDDPairing p2 = bdd.makePair(); ! p2.set(1, 2); ! BDDPairing p3 = bdd.makePair(); ! p3.set(new int[] { 0, 1 }, new int[] { 1, 0 }); ! BDD a, b, c, d, e, f; ! a = bdd.ithVar(0); ! b = bdd.ithVar(1); ! c = bdd.ithVar(2); ! d = bdd.zero(); ! e = bdd.one(); ! a.replaceWith(p1); ! Assert.assertEquals(a, b); ! a.replaceWith(p2); ! Assert.assertEquals(a, c); ! if (bdd.varNum() < 25) bdd.setVarNum(25); ! b.andWith(bdd.nithVar(0)); ! f = b.replace(p3); ! f.andWith(bdd.ithVar(0)); ! Assert.assertTrue(!f.isZero()); ! f.andWith(bdd.ithVar(1)); ! Assert.assertTrue(f.isZero()); ! d.replaceWith(p3); ! Assert.assertTrue(d.isZero()); ! e.replaceWith(p3); ! Assert.assertTrue(e.isOne()); ! a.free(); b.free(); c.free(); d.free(); e.free(); f.free(); ! p1.reset(); ! p2.reset(); ! p3.reset(); ! } ! } ! ! void tEnsureCapacity() { reset(); Assert.assertTrue(hasNext()); *************** *** 433,437 **** } ! public void testEnsureCapacity2() throws IOException { reset(); Assert.assertTrue(hasNext()); --- 473,477 ---- } ! void tEnsureCapacity2() throws IOException { reset(); Assert.assertTrue(hasNext()); *************** *** 439,443 **** BDDFactory bdd = nextFactory(); System.out.println("Factory "+bdd); - int n = bdd.numberOfDomains(); long[] domainSizes = new long[] { 127, 17, 31, 4, 256, 87, 42, 666, 3405, 18 }; while (bdd.numberOfDomains() < domainSizes.length) { --- 479,482 ---- |