Commit 72c87c9f authored by Daniel Le Berre's avatar Daniel Le Berre

Fix for #151

parent ab20f0c6
Pipeline #3651 failed with stages
in 4 minutes and 41 seconds
......@@ -126,7 +126,7 @@ public class SolverStats implements Serializable {
public Map<String, Number> toMap() {
Map<String, Number> map = new HashMap<String, Number>();
for (Field f : this.getClass().getFields()) {
for (Field f : this.getClass().getDeclaredFields()) {
try {
map.put(f.getName(), (Number) f.get(this));
} catch (IllegalArgumentException e) {
......
package org.sat4j;
import static org.junit.Assert.assertTrue;
import org.junit.Test;
import org.sat4j.core.VecInt;
import org.sat4j.minisat.SolverFactory;
import org.sat4j.specs.ContradictionException;
import org.sat4j.specs.ISolver;
import org.sat4j.specs.IVecInt;
import org.sat4j.specs.TimeoutException;
public class BugSAT151 {
@Test
public void testNonEmptyStats()
throws ContradictionException, TimeoutException {
IVecInt lits = new VecInt(new int[] { 1, 2, 3 });
ISolver solver = SolverFactory.newDefault();
solver.newVar(3);
solver.addAtMost(lits, 2);
assertTrue(solver.getStat().keySet().size() > 0);
solver.isSatisfiable();
assertTrue(solver.getStat().keySet().size() > 0);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment