We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Description One of generated test contains following line which could not be compiled: concreteList.add(((Object) - 1L));
concreteList.add(((Object) - 1L));
To Reproduce
// copied from org.utbot.fuzzing.samples.Collections.ConcreteList public static class ConcreteList<T extends Number> extends LinkedList<T> { public boolean equals(Collection<T> collection) { if (collection.size() != size()) { return false; } int i = 0; for (T t : collection) { if (!java.util.Objects.equals(get(i), t)) { return false; } } return true; } }
Expected behavior All generated tests can be compiled and executed.
Actual behavior One of generated test is shown below, it doesn't compile.
@Test @DisplayName("equals: collection = collection -> return false") public void testEqualsReturnsFalse2() { ConcreteList concreteList = new ConcreteList(); concreteList.add(((Object) Byte.MIN_VALUE)); concreteList.add(((Object) Byte.MAX_VALUE)); concreteList.add(((Object) - 1L)); //UNCOMPILABLE concreteList.add(((Object) (short) 0)); concreteList.add(((Object) (byte) 0)); ArrayList arrayList = new ArrayList(); arrayList.add(Byte.MIN_VALUE); arrayList.add(0.0); arrayList.add(Float.NaN); arrayList.add(Double.POSITIVE_INFINITY); arrayList.add((byte) 0); boolean actual = concreteList.equals(((Collection) arrayList)); assertFalse(actual); }
Environment
IntelliJ IDEA version - 2023.2 Project - utbot or just copy sample to any other Java project Plugin - 2023.8.5065
The text was updated successfully, but these errors were encountered:
Can be reproduced on a minimalized example
public static class ConcreteList<T extends Number> extends LinkedList<T> { public boolean equals(Collection<T> collection) { var value = get(0); if (java.util.Objects.equals(value, -1)) { return true; } return false; } }
Sorry, something went wrong.
Correct casts for negative numbers and test file name for inner classes
870153f
#2514 #2515 (#2518)
EgorkaKulikov
Successfully merging a pull request may close this issue.
Description
One of generated test contains following line which could not be compiled:
concreteList.add(((Object) - 1L));
To Reproduce
Expected behavior
All generated tests can be compiled and executed.
Actual behavior
One of generated test is shown below, it doesn't compile.
Environment
IntelliJ IDEA version - 2023.2
Project - utbot or just copy sample to any other Java project
Plugin - 2023.8.5065
The text was updated successfully, but these errors were encountered: