Esempio n. 1
0
void test7() {
  string smi = "c1ccccc1C";
#if 1
  Mol *m = SmilesToMol(smi);
  Mol::AromaticAtomIterator atomIt;
  Mol::AromaticAtomIterator beginP(m->beginAromaticAtoms());
  Mol::AromaticAtomIterator endP(m->endAromaticAtoms());
  unsigned int idx = 0;
  for (atomIt = beginP; atomIt != endP; atomIt++) {
    TEST_ASSERT((*atomIt)->getIdx() == idx);
    idx++;
  }
  TEST_ASSERT(idx == 6);

  atomIt = beginP;
  atomIt++;
  atomIt--;
  TEST_ASSERT((*atomIt)->getIdx() == 0);

  delete m;
  smi = "Cc1ccccc1";
  m = SmilesToMol(smi);
  beginP = m->beginAromaticAtoms();
  endP = m->endAromaticAtoms();
  idx = 0;
  for (atomIt = beginP; atomIt != endP; atomIt++) {
    TEST_ASSERT((*atomIt)->getIdx() == idx + 1);
    idx++;
  }
  TEST_ASSERT(idx == 6);
#endif
  BOOST_LOG(rdInfoLog) << "test7 done" << endl;
}