1 25 26 package org.archive.util.fingerprint; 27 28 import junit.framework.Test; 29 import junit.framework.TestSuite; 30 31 37 public class LongFPSetCacheTest extends LongFPSetTestCase { 38 43 public LongFPSetCacheTest(final String testName) { 44 super(testName); 45 } 46 47 52 public static void main(String argv[]) { 53 junit.textui.TestRunner.run(suite()); 54 } 55 56 61 public static Test suite() { 62 return new TestSuite(LongFPSetCacheTest.class); 63 } 64 65 LongFPSet makeLongFPSet() { 66 return new LongFPSetCache(); 67 } 68 69 74 75 public void testCount() { 76 LongFPSet fpSet = new LongFPSetCache(); 77 final int NUM = 800; final int MAX_ENTRIES = 768; 84 85 assertEquals("empty set to start", 0, fpSet.count()); 86 87 for (int i = 1; i < NUM; ++i) { 88 fpSet.add((long) i); 89 assertEquals("correct num on add", 90 i<MAX_ENTRIES?i:MAX_ENTRIES, fpSet.count()); 91 } 92 } 93 94 } 96 97 | Popular Tags |