Skip to content

Unused import in the generated test #1449

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
alisevych opened this issue Dec 1, 2022 · 1 comment
Closed

Unused import in the generated test #1449

alisevych opened this issue Dec 1, 2022 · 1 comment
Assignees
Labels
comp-codegen Issue is related to code generator ctg-bug Issue is a bug status-wont-fix This will not be worked on

Comments

@alisevych
Copy link
Member

alisevych commented Dec 1, 2022

Description

There is an unused import in the generated test:
import java.net.UnknownHostException;
for the code containing Socket.connect

To Reproduce

  1. Install Build from the main branch, one used into IDEA 2022.2.3
  2. Open UTBotJava project
  3. Check File -> Settings are default: 95% Symbolic execution
  4. Generate tests for the following class:
public class SecurityCheck {
    public int connect(Socket socket) throws IOException {
        socket.connect(new InetSocketAddress("0.0.0.0", 22));
        return 0;
    }
}

Expected behavior

Only required imports are added to the generated test class.

Actual behavior

There is unused import java.net.UnknownHostException;

Visual proofs (screenshots, logs, images)

image

Environment

Windows 10 Pro
IntelliJ IDEA 2022.2.3 (JBR 17)
Gradle
JDK 11

Additional context

Originally posted by @alisevych in #1314 (comment)

@korifey korifey moved this to Todo in UTBot Java Dec 1, 2022
@alisevych alisevych added ctg-bug Issue is a bug comp-codegen Issue is related to code generator labels Dec 1, 2022
@EgorkaKulikov
Copy link
Collaborator

EgorkaKulikov commented Dec 26, 2022

Can't reporoduce this this bug (both @sofurihafe and me), however, a new issue #1590 was discovered.

@alisevych alisevych assigned alisevych and unassigned EgorkaKulikov Dec 28, 2022
@alisevych alisevych added the status-wont-fix This will not be worked on label Jan 17, 2023
@alisevych alisevych closed this as not planned Won't fix, can't repro, duplicate, stale Jan 17, 2023
@github-project-automation github-project-automation bot moved this from Todo to Done in UTBot Java Jan 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp-codegen Issue is related to code generator ctg-bug Issue is a bug status-wont-fix This will not be worked on
Projects
Archived in project
Development

No branches or pull requests

2 participants