Found something in FastUtil i needed to address too. BulkFixes coming.
- Added: Guava TestSuit - Fixed: HashCode and toString method would crash if the Object Key/Value was null - Added: AbstractTypeCollection now delegates the contains check to type-specific Collections if it detects it. - Fixed: Map.Entry toString wasn't writing values not like it should do. - Fixed: Set.hashCode now is the sum of the elements instead of a Unique HashCode based on the elements. - Fixed: Added missing NonNull Checks. - Fixed: OpenHashMap.containsValue implementation was wrong. - Fixed: OpenHashMap.compute/present/absent now works how it is specified in the Java Documentation - Fixed: OpenHashMap.merge/BulkMerge now works how it is specified in the Java Documentation - Fixed: OpenHashMap.keySet.remove was causing a infinite loop. - Fixed: OpenHashMap.mapIterator now no longer crashes in certain cases.
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
package speiger.src.collections.objects.map;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
import com.google.common.collect.testing.MapTestSuiteBuilder;
|
||||
import com.google.common.collect.testing.TestStringMapGenerator;
|
||||
import com.google.common.collect.testing.features.CollectionFeature;
|
||||
import com.google.common.collect.testing.features.CollectionSize;
|
||||
import com.google.common.collect.testing.features.MapFeature;
|
||||
|
||||
import junit.framework.Test;
|
||||
import junit.framework.TestCase;
|
||||
import speiger.src.collections.objects.maps.impl.hash.Object2ObjectOpenHashMap;
|
||||
|
||||
@SuppressWarnings("javadoc")
|
||||
public final class MapTest extends TestCase
|
||||
{
|
||||
public static Test suite()
|
||||
{
|
||||
return suite("Object2ObjectOpenHashMap", Object2ObjectOpenHashMap::new);
|
||||
}
|
||||
|
||||
public static Test suite(String name, Supplier<Map<String, String>> factory)
|
||||
{
|
||||
return MapTestSuiteBuilder.using(new TestStringMapGenerator()
|
||||
{
|
||||
@Override
|
||||
protected Map<String, String> create(Map.Entry<String, String>[] entries)
|
||||
{
|
||||
Map<String, String> map = factory.get();
|
||||
for(Map.Entry<String, String> entry : entries)
|
||||
{
|
||||
map.put(entry.getKey(), entry.getValue());
|
||||
}
|
||||
return map;
|
||||
}
|
||||
}).named(name).withFeatures(CollectionSize.ANY, MapFeature.GENERAL_PURPOSE, MapFeature.ALLOWS_NULL_KEYS, MapFeature.ALLOWS_NULL_VALUES, MapFeature.ALLOWS_ANY_NULL_QUERIES, CollectionFeature.SUPPORTS_ITERATOR_REMOVE).createTestSuite();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user