-
Notifications
You must be signed in to change notification settings - Fork 45
Open
Assignees
@EgorkaKulikov
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
Type
Projects
Status
Todo