These tests were produced after multiple attempts for the same class. Note: it succeeded once, but failed in later runs for two different reasons.
BTW The sandbox is turned off in the plugin. I have added a SecurityManager to checked no attempt to write occurs in the test (or any class it depends on)
The source is here.
/**
* Method under test: {@link Maths#roundingFactor(double)}
*/
@Test
public void testRoundingFactor() {
assertEquals(10000000000L, Maths.roundingFactor(10.0d));
assertEquals(2L, Maths.roundingFactor(0.5d));
assertEquals(10L, Maths.roundingFactor(-0.5d));
}
/**
* Method under test: {@link Maths#roundingFactor(double)}
*/
@Test
@Ignore("TODO: Complete this test")
public void testRoundingFactor2() {
// TODO: Complete this test.
// Reason: R013 No inputs found that don't throw a trivial exception.
// Diffblue Cover tried to run the arrange/act section, but the method under
// test threw
// java.lang.ArrayIndexOutOfBoundsException: 98
// at net.openhft.chronicle.core.Maths.roundingFactor(Maths.java:97)
// See https://diff.blue/R013 to resolve this issue.
Maths.roundingFactor(98.3d);
}
/**
* Method under test: {@link Maths#roundingFactor(int)}
*/
@Test
@Ignore("TODO: Complete this test")
public void testRoundingFactor3() {
// TODO: Complete this test.
// Reason: R011 Sandboxing policy violation.
// Diffblue Cover ran code in your project that tried
// to access files created outside of the test (file 'C:\Users\PETERL~1\AppData\Local\Temp', permission 'write').
// Diffblue Cover's default sandboxing policy disallows this in order to prevent
// your code from damaging your system environment.
// See https://diff.blue/R011 to resolve this issue.
// Arrange
// TODO: Populate arranged inputs
int digits = 0;
// Act
long actualRoundingFactorResult = Maths.roundingFactor(digits);
// Assert
// TODO: Add assertions on result
}