Skip to content

Broken parametrized tests for ObjectWithPrimitivesTest #629

Closed
@sofurihafe

Description

@sofurihafe

Description

Broken parametrized tests are being generated for ObjectWithPrimitivesTest.

To Reproduce

  1. Enable parametrized test generation for samples,
  2. Run ObjectWithPrimitivesTest.

Actual behavior

testDefaultConstructor
Not parametrized test looks like this:

public class ObjectWithPrimitivesClassGeneratedTest {
    ///region Test suites for executable org.utbot.examples.objects.ObjectWithPrimitivesClass.<init>
    
    ///region
    
    @Test
    public void testObjectWithPrimitivesClass1() {
        ObjectWithPrimitivesClass actual = new ObjectWithPrimitivesClass();
    }
    ///endregion
    
    ///endregion
    
}

Parametrized broken test with a following error (generated test has the same thing):

Error region in ObjectWithPrimitivesClass:     
    public void testObjectWithPrimitivesClass_errors()
     {
        // Couldn't generate some tests. List of errors:
        // 
        // 1 occurrences of:
        // org.utbot.framework.plugin.api.ConstructorId cannot be cast to org.utbot.framework.plugin.api.MethodId
    }

testConstructorWithParams
Not parametrized test looks like this:

public class ObjectWithPrimitivesClassGeneratedTest {
    ///region Test suites for executable org.utbot.examples.objects.ObjectWithPrimitivesClass.<init>
    
    ///region
    
    @Test
    public void testObjectWithPrimitivesClass1() {
        ObjectWithPrimitivesClass actual = new ObjectWithPrimitivesClass(-255, -255, java.lang.Double.NaN);
    }
    ///endregion
    
    ///endregion
    
}

Parametrized broken test with a following error (generated test has the same thing):

Error region in ObjectWithPrimitivesClass:     
    public void testObjectWithPrimitivesClass_errors()
     {
        // Couldn't generate some tests. List of errors:
        // 
        // 1 occurrences of:
        // Index: 3, Size: 3   
    }

Metadata

Metadata

Labels

comp-codegenIssue is related to code generatorctg-bugIssue is a bug

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions