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

assertArrayEquals overload is not found, tests doesn't compile #135

Closed
alexeyfridman opened this issue Jun 2, 2022 · 1 comment · Fixed by #464
Closed

assertArrayEquals overload is not found, tests doesn't compile #135

alexeyfridman opened this issue Jun 2, 2022 · 1 comment · Fixed by #464
Assignees
Labels
comp-codegen Issue is related to code generator ctg-bug Issue is a bug priority-top-focus Top priority chosen by dev team spec-internal Internal issue

Comments

@alexeyfridman
Copy link
Collaborator

SAT-1622

Project: guava-26.0. Class: com.google.common.primitives.Booleans.
Compilation Error during compiling Test Class after test generation:

C:\Users\sWX1143086\work\UnitTestBot\UTBotJava\utbot-junit-contest\build\output\test_candidates\guava-26.0\com\google\common\primitives\BooleansTest.java:605: error: no suitable method found for assertArrayEquals(boolean[],boolean[])
assertArrayEquals(expected, actual);
^
method Assert.assertArrayEquals(long[],long[]) is not applicable
(argument mismatch; boolean[] cannot be converted to long[])
method Assert.assertArrayEquals(int[],int[]) is not applicable
(argument mismatch; boolean[] cannot be converted to int[])
method Assert.assertArrayEquals(short[],short[]) is not applicable
(argument mismatch; boolean[] cannot be converted to short[])
method Assert.assertArrayEquals(char[],char[]) is not applicable
(argument mismatch; boolean[] cannot be converted to char[])
method Assert.assertArrayEquals(byte[],byte[]) is not applicable
(argument mismatch; boolean[] cannot be converted to byte[])
method Assert.assertArrayEquals(Object[],Object[]) is not applicable
(argument mismatch; boolean[] cannot be converted to Object[])

@alexeyfridman alexeyfridman added ctg-bug Issue is a bug priority-top-focus Top priority chosen by dev team spec-internal Internal issue labels Jun 2, 2022
@alexeyfridman alexeyfridman moved this to Todo in UTBot Java Jun 2, 2022
@alexeyfridman alexeyfridman moved this from Todo to Done in UTBot Java Jun 2, 2022
Repository owner moved this from Done to In Progress in UTBot Java Jun 2, 2022
@Vassiliy-Kudryashov
Copy link
Member

The issue is that minor version of JUnit 4 have different API for arrays.
Namely Assert.assertArrayEquals(boolean[], boolean[]) method absents in versions up to 4.11 and appears in 4.12 only
Moreover, in JUnit 4.0 - 4.2 they use assertEquals method name for Object[] and assertArrayEquals since 4.3
Solution: our DependencyPatterns should limit requirements for JUnit 4 more strictly. 4.12 is the oldest supported version.

@denis-fokin denis-fokin added the comp-codegen Issue is related to code generator label Jun 8, 2022
@denis-fokin denis-fokin changed the title Codegen: assertArrayEquals overload is not found, tests doesn't compile assertArrayEquals overload is not found, tests doesn't compile Jun 8, 2022
Vassiliy-Kudryashov added a commit that referenced this issue Jul 11, 2022
resolving merge conflict with main branch, use the very last (just added to the list) library with matching name
Vassiliy-Kudryashov added a commit that referenced this issue Jul 11, 2022
resolving merge conflict with main branch, use the very last (just added to the list) library with matching name
Vassiliy-Kudryashov added a commit that referenced this issue Jul 11, 2022
…464)

resolving merge conflict with main branch, use the very last (just added to the list) library with matching name
Repository owner moved this from In Progress to Done in UTBot Java Jul 11, 2022
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 priority-top-focus Top priority chosen by dev team spec-internal Internal issue
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants