Skip to content
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

Internal utbot exception OverflowDetectionError is verified in generated test #2650

Open
alisevych opened this issue Oct 5, 2023 · 0 comments
Labels
comp-codegen Issue is related to code generator comp-symbolic-engine Issue is related to the symbolic execution engine ctg-bug Issue is a bug

Comments

@alisevych
Copy link
Member

Description

Internal utbot exception OverflowDetectionError is verified in generated test

To Reproduce

  1. Install -IU- UnitTestBot plugin in IntelliJ IDEA Ultimate 2023.2
  2. Open utbot project
  3. Set 'Treat overflows as errors' ON
  4. Generate tests for Heap with Parameterized tests and Do not mock selected

Expected behavior

Generated tests should compile successfully.
No internal utbot exceptions are expected to be used in generated tests.

Actual behavior

org.utbot.framework.plugin.api.OverflowDetectionError.class is checked as expectedError in the test.

Screenshots, logs

    @ParameterizedTest
    @MethodSource("org.utbot.examples.structures.HeapTest#provideDataForPush")
    public void parameterizedTestsForPush(Heap heap, long key, Class expectedError) {
        try {
            heap.push(key);
        } catch (java.lang.Throwable throwable) {
            assertTrue(expectedError.isInstance(throwable));
        }
    }

    public static java.util.ArrayList provideDataForPush() {
        ArrayList argList = new ArrayList();

        {
            Heap heap = new Heap();

            java.lang.Object[] testCaseObjects = new java.lang.Object[3];
            testCaseObjects[0] = heap;
            testCaseObjects[1] = Integer.MIN_VALUE;
            testCaseObjects[2] = org.utbot.framework.plugin.api.OverflowDetectionError.class;
            argList.add(arguments(testCaseObjects));
        }
    }

Environment

IntelliJ IDEA version - Ultimate 2023.2
Project - gradle
JDK - 17

Additional context

@alisevych alisevych added ctg-bug Issue is a bug comp-codegen Issue is related to code generator comp-symbolic-engine Issue is related to the symbolic execution engine labels Oct 5, 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 comp-symbolic-engine Issue is related to the symbolic execution engine ctg-bug Issue is a bug
Projects
Status: Todo
Development

No branches or pull requests

1 participant