File: TObjectHashTest.java

package info (click to toggle)
trove3 3.0.3-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,924 kB
  • sloc: java: 16,429; xml: 331; makefile: 21; sh: 10
file content (33 lines) | stat: -rw-r--r-- 832 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package gnu.trove.impl.hash;

import gnu.trove.map.hash.TObjectLongHashMap;
import junit.framework.TestCase;


/**
 *
 */
public class TObjectHashTest extends TestCase {
	// Test case bug bug ID 3067307
	public static void testBug3067307() {
		TObjectLongHashMap<String> testHash = new TObjectLongHashMap<String>();
		final int c = 1000;
		for ( long i = 1; i < c; i++ ) {
			final String data = "test-" + i;
			testHash.put( data, i );
			testHash.remove( data );
		}
	}

	// Test case bug bug ID 3067307
	public static void testBug3067307_noAutoCompact() {
		TObjectLongHashMap<String> testHash = new TObjectLongHashMap<String>();
		testHash.setAutoCompactionFactor( 0 );
		final int c = 1000;
		for ( long i = 1; i < c; i++ ) {
			final String data = "test-" + i;
			testHash.put( data, i );
			testHash.remove( data );
		}
	}
}