Fix (most of) mem problems (#2123)

* do not use new on loggers

* del pointers in testDistGeom

* Update Dict hasNonPOD status on bulk update

* delete new Dicts in memtest1.cpp

* fixes in MolSuppliers and testFMCS

* PeriodicTable singleton as unique_ptr

* fix EEM_arrays leak

* fix leaks in testPBF

* fix ParamCollection leak in test UFF

* fix leaks in MMFF

* clear prop dict before read in in pickler

* fix leaks in testFreeSASA

* fix leaks in test3D

* modernize Dict.h & SmilesParse.cpp

* fix leaks in testQuery

* fix leaks in testCrystalFF

* fix leaks in cxsmilesTest

* fix leaks in Catalog & mol cat test

* fix leaks in ShapeUtils & tests

* fix leaks in testSubgraphs1

* fix leaks testFingerprintGenerators

* fix leaks in Catalog/FilterCatalog

* fix leaks in graphmolqueryTest

* these changes reduce bison parse leaks

* fixed leaks in testChirality.cpp

* fix leaks + 2 tests in testMolWriter

* fix 4m leaks in substructLibraryTest

* small improvements to molTautomerTest; still leaks

* fix leaks in testRGroupDecomp

* fix leaks in test; parser still leaks

* fix leaks in itertest

* fix 4m leaks in testDepictor

* fixes in smatest; still leaking due to parser

* fixes in testSLNParse; still leaking due to parser

* flex/bison: always add atoms with ownership; smarts error cleanup

* fix leaks in testReaction

* fix leaks in testSubstructMatch

* fix leaks in resMolSupplierTest

* fix leaks in testChemTransforms + bug in ChemTransforms

* fix leaks in testPickler

* fix leaks in testMolTransform

* fix leaks in testFragCatalog

* fix leak in testSLNParse. Still leaks due to Smiles

* fixed most leaks in testMolSupplier

* pre bison fix

* fix some atom & bond parse problems; others still fail

* bison smiles & smarts, atoms & bonds more or less fixed

* fix leaks in molopstest.cpp

* fix leaks in testFingerprints, MACCS.cpp & AtomPairs.cpp

* fix leaks in moldraw2Dtest1

* fix leaks in testDescriptors

* fix leaks in testInchi

* fix leaks in testUFFForceFieldHelpers

* fix leaks in hanoiTest & new_canon.h

* fix leaks in testMMFFForceField

* fix leaks in graphmolTest1

* fix leaks in testMMFFForceFieldHelpers

* fix leaks in testDistGeomHelpers

* fix leaks in testMolAlign

* initialize occupancy & temp facto with default values

* fix leak in TautomerTransform

* updated suppressions

* fix testStructChecker

* fix logging & py tests

* fix TautomerTransform class/struct issue

* remove misplaced delete in testSLNParse

* deinit in testAvalonLib1

* fix Avalon-triggered(?) bug in StructChecker/Pattern.cpp

* fix random testMolWriter/Supplier fails

- diversify output file names to avoid clashing.
- unify Writers close/destruct behavior.
- flushing/closing in tests.

* use reset in FFs Params.cpp

* comments on testMMFFForceField

* unrequired 'if's added to mol suppliers

* correct cast in FilterCatalog.h

* use unique_ptr in MACCS Patterns

* remove unrequred if in new_canon

* update & move suppressions
This commit is contained in:
Ric
2018-10-29 10:33:26 -04:00
committed by Brian Kelley
parent 797dff02f1
commit a6b26253ff
92 changed files with 3499 additions and 1286 deletions

View File

@@ -410,6 +410,7 @@ void testInitStruChk() {
int errs = AvalonTools::initCheckMol(struchk_init);
TEST_ASSERT(!errs);
RDKit::ROMOL_SPTR m = AvalonTools::checkMol(errs, "c1ccccc1", true);
AvalonTools::closeCheckMolFiles();
TEST_ASSERT(errs == 0);
}
BOOST_LOG(rdInfoLog) << "done" << std::endl;

View File

@@ -31,6 +31,7 @@
#include "RDFreeSASA.h"
#include <GraphMol/RDKitBase.h>
#include <GraphMol/QueryAtom.h>
#include <GraphMol/SmilesParse/SmilesParse.h>
#include <GraphMol/FileParsers/FileParsers.h>
@@ -398,10 +399,13 @@ void testPDB() {
std::cerr << " polar " << polard << std::endl;
std::cerr << " apolar " << apolard << std::endl;
TEST_ASSERT(fabs(polard + apolard - 5000.340175) < 1e-5);
delete polar;
delete apolar;
delete m;
delete mnoh;
TEST_ASSERT(fabs(polard + apolard - 5000.340175) < 1e-5);
BOOST_LOG(rdInfoLog) << "Done" << std::endl;
}

View File

@@ -51,7 +51,7 @@ void runblock(const std::vector<ROMol *> &mols, unsigned int count,
}
}
};
}
} // namespace
#include <thread>
#include <future>
@@ -165,10 +165,11 @@ void testGithubIssue8() {
ROMol *m2 = InchiToMol(inchi, tmp2);
TEST_ASSERT(m2);
std::string smi = MolToSmiles(*m2, true);
TEST_ASSERT(smi == "[H]/N=c1\\cc2oc3cc(N)ccc3c(-c3ccccc3C(=O)O)c-2cc1[125I]");
TEST_ASSERT(smi ==
"[H]/N=c1\\cc2oc3cc(N)ccc3c(-c3ccccc3C(=O)O)c-2cc1[125I]");
inchi = MolToInchi(*m2, tmp2);
TEST_ASSERT(inchi ==
TEST_ASSERT(inchi ==
"InChI=1S/C20H13IN2O3/"
"c21-15-8-14-18(9-16(15)23)26-17-7-10(22)5-6-13(17)19(14)11-3-"
"1-2-4-12(11)20(24)25/h1-9,23H,22H2,(H,24,25)/b23-16+/i21-2");
@@ -302,6 +303,7 @@ void testGithubIssue437() {
std::string smi2 = MolToSmiles(*m, true);
// std::cerr<<" smi1: "<<smi1<<std::endl;
// std::cerr<<" smi2: "<<smi2<<std::endl;
delete m;
TEST_ASSERT(smi1 == smi2);
}
{
@@ -318,6 +320,7 @@ void testGithubIssue437() {
std::string smi2 = MolToSmiles(*m, true);
// std::cerr<<" smi1: "<<smi1<<std::endl;
// std::cerr<<" smi2: "<<smi2<<std::endl;
delete m;
TEST_ASSERT(smi1 == smi2);
}
{
@@ -334,6 +337,7 @@ void testGithubIssue437() {
delete m;
m = InchiToMol(inchi, tmp);
std::string smi2 = MolToSmiles(*m, true);
delete m;
TEST_ASSERT(smi1 == smi2);
}
{
@@ -352,6 +356,7 @@ void testGithubIssue437() {
std::string smi2 = MolToSmiles(*m, true);
// std::cerr<<" smi1: "<<smi1<<std::endl;
// std::cerr<<" smi2: "<<smi2<<std::endl;
delete m;
TEST_ASSERT(smi1 == smi2);
}
{
@@ -368,6 +373,7 @@ void testGithubIssue437() {
delete m;
m = InchiToMol(inchi, tmp);
std::string smi2 = MolToSmiles(*m, true);
delete m;
TEST_ASSERT(smi1 == smi2);
}
{
@@ -384,6 +390,7 @@ void testGithubIssue437() {
delete m;
m = InchiToMol(inchi, tmp);
std::string smi2 = MolToSmiles(*m, true);
delete m;
TEST_ASSERT(smi1 == smi2);
}
@@ -403,6 +410,7 @@ void testGithubIssue437() {
delete m;
m = InchiToMol(inchi, tmp);
std::string smi2 = MolToSmiles(*m, true);
delete m;
TEST_ASSERT(smi1 == smi2);
}
@@ -420,6 +428,7 @@ void testGithubIssue437() {
delete m;
m = InchiToMol(inchi, tmp);
std::string smi2 = MolToSmiles(*m, true);
delete m;
TEST_ASSERT(smi1 == smi2);
}
{
@@ -435,6 +444,7 @@ void testGithubIssue437() {
delete m;
m = InchiToMol(inchi, tmp);
std::string smi2 = MolToSmiles(*m, true);
delete m;
TEST_ASSERT(smi1 == smi2);
}
{
@@ -450,6 +460,7 @@ void testGithubIssue437() {
delete m;
m = InchiToMol(inchi, tmp);
std::string smi2 = MolToSmiles(*m, true);
delete m;
TEST_ASSERT(smi1 == smi2);
}
{
@@ -469,6 +480,7 @@ void testGithubIssue437() {
delete m;
m = InchiToMol(inchi, tmp);
std::string smi2 = MolToSmiles(*m, true);
delete m;
TEST_ASSERT(smi1 == smi2);
}
BOOST_LOG(rdInfoLog) << "done" << std::endl;