Skip to content

Mock label is assigned to null values #1520

Closed
@CaelmBleidd

Description

@CaelmBleidd

Description

We have an array that contains information about whether some object is mocked or not with symbolic addresses as its indices. When we create an object, we assign a mark corresponding provided mock information. Because of an error, we do it without the condition that they should not be taken into account if the object we create is null, and it cases UNSAT verdict.

To Reproduce

Steps to reproduce the behavior:

  1. Open a test project with utbot-api dependency
  2. Copy there a code from visual proof section below
  3. Run generation with Other packages mock strategy

Expected behavior

One generated test.

Actual behavior

No generated tests.

Visual proofs (screenshots, logs, images)

public int mocksForNullOfDifferentTypes(Integer intValue, Random random) {
    UtMock.assume(intValue == null);
    UtMock.assume(random == null);

    return 0;
}

Environment
Mocks are enabled, any Junit is ok, mock strategy all other classes of from other packages

Additional context

There is no additional context

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