You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Only one condition is tested in a simple if-else construct.
Tried with different Coverage options, resulting all in same generated test case (see below).
Code to test:
public class Foobar {
public boolean fooTheBar(int x) {
if(x > 1000) {
return true;
} else {
return false;
}
}
}
Generated Test Case:
public class TestClass12 {
// Fields for test parameters and expected return values.
private de.wwu.pi.dbtest.sampleapp.Foobar testedClass;
private boolean booleanfalse;
private int intm50;
/**
* Set up the unit test by initializing the fields to the desired values.
*/
@Before public void setUp() {
this.testedClass = new de.wwu.pi.dbtest.sampleapp.Foobar();
this.booleanfalse = false;
this.intm50 = -50;
}
/**
* Run the tests on de.wwu.pi.dbtest.sampleapp.Foobar.fooTheBar(int x).
*/
@Test public void testIt() {
assertEquals(this.booleanfalse, this.testedClass.fooTheBar(this.intm50));
}
/**
* Invoke JUnit to run the unit tests.
* @param args Command line arguments, which are ignored here. Just supply null.
*/
public static void main(String args[]) {
org.junit.runner.JUnitCore.main("test.unitTests.TestClass12");
}
}
The text was updated successfully, but these errors were encountered:
Is it possible that this happens only when using JaCoP as a solver? Because currently, JaCoP is limited to integer values in the interval of [-50,50]. You can change this interval by putting smaller(!) values into de.wwu.muggl.solvers.jacop.JaCoPTransformer#DOMAIN_DEPRECIATION, as this constant is used for reducing the domain of IntVars.
Background: If we assume a range of [-50,50], then there is actually no x that can fulfill the criterion x > 1000. This is wrong, of course, but with JaCoP there is currently no other solution.
Only one condition is tested in a simple if-else construct.
Tried with different Coverage options, resulting all in same generated test case (see below).
Code to test:
Generated Test Case:
The text was updated successfully, but these errors were encountered: