Exemple #1
0
void testExtraBondQueries() {
  BOOST_LOG(rdErrorLog) << "---------------------- Test extra bond queries"
                        << std::endl;

  {  // stereo
    QueryBond qB;
    qB.setQuery(makeBondHasStereoQuery());
    Bond b1(Bond::DOUBLE);
    TEST_ASSERT(!qB.Match(&b1));
    b1.setStereo(Bond::STEREOE);
    TEST_ASSERT(qB.Match(&b1));
    b1.setStereo(Bond::STEREOANY);
    TEST_ASSERT(qB.Match(&b1));
    qB.getQuery()->setNegation(true);
    b1.setStereo(Bond::STEREONONE);
    TEST_ASSERT(qB.Match(&b1));
    b1.setStereo(Bond::STEREOE);
    TEST_ASSERT(!qB.Match(&b1));
    b1.setStereo(Bond::STEREOANY);
    TEST_ASSERT(!qB.Match(&b1));
  }
  BOOST_LOG(rdErrorLog) << "Done!" << std::endl;
}
Exemple #2
0
QueryBond *HasPropQueryBond(const std::string &propname, bool negate) {
  QueryBond *res = new QueryBond();
  res->setQuery(makeHasPropQuery<Bond>(propname));
  if (negate) res->getQuery()->setNegation(true);
  return res;
}