-
Notifications
You must be signed in to change notification settings - Fork 45
Open
Labels
comp-codegenIssue is related to code generatorIssue is related to code generatorcomp-contest-estimatorIssue is related to contest estimatorIssue is related to contest estimatorctg-bugIssue is a bugIssue is a buglang-javaIssue is related to Java supportIssue is related to Java support
Description
Description
DeepEquals still has some duplicated assertions. We need to investigate how to avoid them
To Reproduce
Run ContestEstimator with the following settings:
methodFilter = "com.google.common.collect.Queues.synchronizedDeque"
projectFilter = listOf("guava-26.0")
The following test is generated:
@Test
public void testSynchronizedDeque() throws Exception {
ArrayDeque arrayDeque = new ArrayDeque();
Object object = new Object();
arrayDeque.add(object);
Object actual = Queues.synchronizedDeque(arrayDeque);
Object expected = createInstance("com.google.common.collect.Synchronized$SynchronizedDeque");
setField(expected, "com.google.common.collect.Synchronized$SynchronizedObject", "delegate", arrayDeque);
setField(expected, "com.google.common.collect.Synchronized$SynchronizedObject", "mutex", expected);
Object expectedDelegate = getFieldValue(expected, "com.google.common.collect.Synchronized$SynchronizedObject", "delegate");
Object actualDelegate = getFieldValue(actual, "com.google.common.collect.Synchronized$SynchronizedObject", "delegate");
assertTrue(deepEquals(expectedDelegate, actualDelegate));
Object expectedMutex = getFieldValue(expected, "com.google.common.collect.Synchronized$SynchronizedObject", "mutex");
Object actualMutex = getFieldValue(actual, "com.google.common.collect.Synchronized$SynchronizedObject", "mutex");
assertTrue(deepEquals(expectedMutex, actualMutex));
assertTrue(deepEquals(expectedMutex, actualMutex));
}
Last two assertions are incorrect.
Metadata
Metadata
Assignees
Labels
comp-codegenIssue is related to code generatorIssue is related to code generatorcomp-contest-estimatorIssue is related to contest estimatorIssue is related to contest estimatorctg-bugIssue is a bugIssue is a buglang-javaIssue is related to Java supportIssue is related to Java support
Type
Projects
Status
Todo