add test for #378

This commit is contained in:
Greg Landrum
2014-11-09 11:47:46 +01:00
parent d0d62ea1a2
commit ff872cdba7

View File

@@ -3404,7 +3404,27 @@ void testGithub298(){
TEST_ASSERT(m);
TEST_ASSERT(m->getNumAtoms()==80);
TEST_ASSERT(m->getNumBonds()==210);
delete m;
}
BOOST_LOG(rdInfoLog) << "done" << std::endl;
}
void testGithub378(){
BOOST_LOG(rdInfoLog) << "-------------------------------------" << std::endl;
BOOST_LOG(rdInfoLog) << "Testing Github 378: SMILES parser doing the wrong thing for odd dot-disconnected construct" << std::endl;
{
RWMol *m;
std::string smiles="C1.C1CO1.N1";
m = SmilesToMol(smiles);
TEST_ASSERT(m);
TEST_ASSERT(m->getBondBetweenAtoms(0,1));
TEST_ASSERT(m->getBondBetweenAtoms(0,1)->getBondType()==Bond::SINGLE);
delete m;
TEST_ASSERT(m->getBondBetweenAtoms(3,4));
TEST_ASSERT(m->getBondBetweenAtoms(3,4)->getBondType()==Bond::SINGLE);
TEST_ASSERT(!m->getBondBetweenAtoms(1,3));
}
BOOST_LOG(rdInfoLog) << "done" << std::endl;
}
@@ -3465,5 +3485,6 @@ main(int argc, char *argv[])
testGithub210();
#endif
testGithub298();
testGithub378();
//testBug1719046();
}