-
Notifications
You must be signed in to change notification settings - Fork 45
Open
Labels
comp-symbolic-engineIssue is related to the symbolic execution engineIssue is related to the symbolic execution enginectg-bugIssue is a bugIssue is a bugspec-release-tailingsFailed to include in the current release, let's include it in the next oneFailed to include in the current release, let's include it in the next one
Description
Description
Test generation using symbolic execution fails for methods containing
- new toArray method for Map keySet (added for Collections in Java 11)
- new and old toArray methods for Map entrySet
To Reproduce
Steps to reproduce the behavior:
- The following line is present in ~/.utbot/settings.properties :
useFuzzing=false
- Open/restart IntelliJ IDEA with UTBot plugin installed
- A project is opened
- Add the following class:
import java.util.HashMap;
import java.util.Map;
class A {
public String[] checkNewToArray() {
Map<String, String> namesMap = new HashMap<>();
namesMap.put("Joe", "Jane");
namesMap.put("Bill", "Anna");
String[] names = namesMap.entrySet().toArray(String[]::new);
return names;
}
}
- Initiate test generation with UTBot
- Same for the following method calls:
String[] names = namesMap.keySet().toArray(String[]::new);
String[] names = namesMap.entrySet().toArray(new String[2]);
Expected behavior
Tests are supposed to be generated.
Actual behavior
Failed to generate unit tests for class A - error popup is displayed
in 2-3 seconds after start
Visual proofs (screenshots, logs, images)
Environment
Windows 10 Pro
IntelliJ IDEA Ultimate 2022.1.3
JDK 11
Additional context
Working only with old toArray method for keySet:
String[] names = namesMap.keySet().toArray(new String[2]);
Metadata
Metadata
Assignees
Labels
comp-symbolic-engineIssue is related to the symbolic execution engineIssue is related to the symbolic execution enginectg-bugIssue is a bugIssue is a bugspec-release-tailingsFailed to include in the current release, let's include it in the next oneFailed to include in the current release, let's include it in the next one
Type
Projects
Status
Todo