Created
June 25, 2009 02:12
-
-
Save rapodaca/135647 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.metamolecular.mx.fingerprint.Fingerprinter; | |
import com.metamolecular.mx.fingerprint.PathFingerprinter; | |
import com.metamolecular.mx.io.Molecules; | |
import junit.framework.TestCase; | |
import java.util.BitSet; | |
public class Test extends TestCase | |
{ | |
/** | |
* Fails with f89cd3b7433b707f1e5688648deaa2380a0dac44, but should pass. | |
*/ | |
public void testItShouldMatchPropaneToAcetone() | |
{ | |
Fingerprinter fingerprinter = new PathFingerprinter(); | |
BitSet propane = fingerprinter.getFingerprint(Molecules.createPropane()); | |
BitSet acetone = fingerprinter.getFingerprint(Molecules.createAcetone()); | |
assertTrue(match(propane, acetone)); | |
} | |
private boolean match(BitSet bitset, BitSet other) | |
{ | |
BitSet intersection = (BitSet) other; | |
intersection.and(bitset); | |
return intersection.equals(bitset); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment