Permalink
Browse files

Small patch for bug 3551478

Change-Id: Ic565e6783caee915014f3d4958a243089a60ee47
Signed-off-by: Egon Willighagen <egonw@users.sourceforge.net>
  • Loading branch information...
johnmay authored and egonw committed Jul 29, 2012
1 parent c532191 commit 71f40a9b801f687d95accea38a7daab69c67b501
@@ -152,7 +152,7 @@ public static boolean isIsomorph(IAtomContainer g1, IAtomContainer g2) throws C
IQueryAtom qAtom = (IQueryAtom)atom2;
return qAtom.matches(g1.getAtom(0));
} else {
String atomSymbol = atom.getSymbol();
String atomSymbol = atom2.getSymbol();
return g1.getAtom(0).getSymbol().equals(atomSymbol);
}
}
@@ -171,7 +171,7 @@ public static boolean isIsomorph(IAtomContainer sourceGraph, IAtomContainer targ
IQueryAtom qAtom = (IQueryAtom) atom2;
return qAtom.matches(sourceGraph.getAtom(0));
} else {
String atomSymbol = atom.getSymbol();
String atomSymbol = atom2.getSymbol();
return sourceGraph.getAtom(0).getSymbol().equals(atomSymbol);
}
}
@@ -490,6 +490,19 @@
}
}
@Test
public void testSingleAtomMatching() throws Exception {
SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance());
IAtomContainer target = sp.parseSmiles("C");
IAtomContainer query = sp.parseSmiles("C");
Assert.assertTrue(UniversalIsomorphismTester.isIsomorph(target, query));
Assert.assertTrue(UniversalIsomorphismTester.isIsomorph(query, target));
}
@Test
public void testSingleAtomMismatching() throws Exception {
@@ -502,7 +515,6 @@ public void testSingleAtomMismatching() throws Exception {
UniversalIsomorphismTester.isIsomorph(target, query));
Assert.assertFalse("Single nitrogen and carbon should not match",
UniversalIsomorphismTester.isIsomorph(query, target));
}
/**

0 comments on commit 71f40a9

Please sign in to comment.