-
Notifications
You must be signed in to change notification settings - Fork 45
Open
@alisevych
Description
Description
Tests generated by Symbolic Execution for OverflowExamples with Treat overflows as errors
option on - are supposed to fail with ArithmeticException, but they are passing.
To Reproduce
- Install one of the latest plugin build from main in IDEA
- Run the 'UTBotJava' project in IntelliJ Idea
- Set
Overflow detection
toTreat overflows as errors
and Fuzzing on:
- Use plugin to generate tests for the sample org.utbot.examples.recursion.Recursion.factorial:
Expected behavior
Test produces int overflow inside factorial method (2^32 => 0) and is supposed to fail.
The test also should go to OVERFLOWS region and should have a comment about int overflow.
Actual behavior
A regular test is generated.
It is added to ///region FUZZER: SUCCESSFUL EXECUTIONS for method factorial(int)
The test is passing.
Visual proofs (screenshots, logs, images)
/** * @utbot.classUnderTest {@link Recursion} * @utbot.methodUnderTest {@link Recursion#factorial(int)} */ @Test @DisplayName("factorial: n = 1024 (mutated from 0) -> return 0") public void testFactorialReturnsZero() { Recursion recursion = new Recursion(); int actual = recursion.factorial(1024); assertEquals(0, actual); }
Environment
Windows 10 Pro
IntelliJ IDEA 2022年2月3日
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Todo