Skip to content

Mock error (FileInputStream) #1980

Closed
@pogrebnoijak

Description

@pogrebnoijak

Description

utbot-cli not generated anything if java.io.FileInputStream.read is called (FileInputStream mocked)

To Reproduce

public class JavaIoFileInputStreamCheck {
    public void read(String s) throws IOException {
        java.io.FileInputStream fis = new java.io.FileInputStream(s);
        byte[] b = new byte[1000];
        int size = fis.read(b);		// fail there
    }
}

run utbot-cli:

java -jar utbot-cli-2023.03-SNAPSHOT.jar generate --classpath "/home/andrew/ex/build/classes/java/main" --source /home/andrew/ex/src/main/java/org/example/JavaIoFileInputStreamCheck.java --output Test.java org.example.JavaIoFileInputStreamCheck --mock-always java.io.FileInputStream

Expected behavior

Something generated

Actual behavior

Nothing generated (smth wrong with fis.read)

package org.example;

public final class Test {
}

Visual proofs (screenshots, logs, images)

FileInputStream

Metadata

Metadata

Assignees

Labels

comp-symbolic-engineIssue is related to the symbolic execution enginectg-bugIssue is a bug

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions