mirror of
https://github.com/rdkit/rdkit.git
synced 2026-06-03 21:44:30 +08:00
Cleanups and additional tests to improve test coverage (#2852)
* disable builds of the StructChecker code by default * operator"" _smarts() doesn't need to catch sanitization errors * remove unused function * turn back on some tests that shouldn't have been disabled * Remove unused code from SMARTS parser and simplify a bit SmilesParseOps::AddFragToMol is now used only from the SMARTS parser, so we can simplify the API * Removes obsolete special case code for SMARTS This was relevant when organic atoms in SMARTS queries were stored as two-part queries. * improve SMARTS testing make sure we can generate SMARTS from all the examples and then parse that again. * Fixes #2814 * Fixes #2815 * some additional smarts tests to improve coverage * test copy ctor and getPos * remove obsolete test_list files * include tests for the morgan invariant generators * more cleanups and coverage improvements * remove files that were mistakenly added
This commit is contained in:
committed by
Brian Kelley
parent
22b86d0a94
commit
a75018fe38
@@ -1,9 +0,0 @@
|
||||
tests = [("python", "testAlignment.py", {})]
|
||||
|
||||
longTests = []
|
||||
|
||||
if __name__ == '__main__':
|
||||
import sys
|
||||
from rdkit import TestRunner
|
||||
failed, tests = TestRunner.RunScript('test_list.py', 0, 1)
|
||||
sys.exit(len(failed))
|
||||
@@ -1,14 +0,0 @@
|
||||
import sys
|
||||
|
||||
tests = [
|
||||
("testExecs/main.exe", "", {}),
|
||||
("python", "test_list.py", {'dir': 'Wrap'}),
|
||||
]
|
||||
|
||||
longTests = []
|
||||
|
||||
if __name__ == '__main__':
|
||||
import sys
|
||||
from rdkit import TestRunner
|
||||
failed, tests = TestRunner.RunScript('test_list.py', 0, 1)
|
||||
sys.exit(len(failed))
|
||||
@@ -1,11 +0,0 @@
|
||||
import sys
|
||||
|
||||
tests = [("testExecs/main.exe", "", {}), ]
|
||||
|
||||
longTests = []
|
||||
|
||||
if __name__ == '__main__':
|
||||
import sys
|
||||
from rdkit import TestRunner
|
||||
failed, tests = TestRunner.RunScript('test_list.py', 0, 1)
|
||||
sys.exit(len(failed))
|
||||
@@ -1,11 +0,0 @@
|
||||
import sys
|
||||
|
||||
tests = [("testExecs/testOptimizer.exe", "", {}), ]
|
||||
|
||||
longTests = []
|
||||
|
||||
if __name__ == '__main__':
|
||||
import sys
|
||||
from rdkit import TestRunner
|
||||
failed, tests = TestRunner.RunScript('test_list.py', 0, 1)
|
||||
sys.exit(len(failed))
|
||||
@@ -1,6 +1,5 @@
|
||||
// $Id$
|
||||
//
|
||||
// Copyright (C) 2004-2006 Rational Discovery LLC
|
||||
// Copyright (C) 2004-2019 Rational Discovery LLC
|
||||
//
|
||||
// @@ All Rights Reserved @@
|
||||
// This file is part of the RDKit.
|
||||
@@ -99,6 +98,42 @@ void test2Matrix() {
|
||||
CHECK_INVARIANT(RDKit::feq(C.getVal(0, 1), 10), "");
|
||||
CHECK_INVARIANT(RDKit::feq(C.getVal(1, 0), 10), "");
|
||||
CHECK_INVARIANT(RDKit::feq(C.getVal(1, 1), 10.25), "");
|
||||
|
||||
auto Ccp(C);
|
||||
Ccp += C;
|
||||
CHECK_INVARIANT(RDKit::feq(Ccp.getVal(0, 0), 20.5), "");
|
||||
CHECK_INVARIANT(RDKit::feq(Ccp.getVal(0, 1), 20), "");
|
||||
CHECK_INVARIANT(RDKit::feq(Ccp.getVal(1, 0), 20), "");
|
||||
CHECK_INVARIANT(RDKit::feq(Ccp.getVal(1, 1), 20.5), "");
|
||||
|
||||
Ccp -= C;
|
||||
CHECK_INVARIANT(RDKit::feq(Ccp.getVal(0, 0), 10.25), "");
|
||||
CHECK_INVARIANT(RDKit::feq(Ccp.getVal(0, 1), 10), "");
|
||||
CHECK_INVARIANT(RDKit::feq(Ccp.getVal(1, 0), 10), "");
|
||||
CHECK_INVARIANT(RDKit::feq(Ccp.getVal(1, 1), 10.25), "");
|
||||
|
||||
C *= 2.;
|
||||
CHECK_INVARIANT(RDKit::feq(C.getVal(0, 0), 20.5), "");
|
||||
CHECK_INVARIANT(RDKit::feq(C.getVal(0, 1), 20), "");
|
||||
CHECK_INVARIANT(RDKit::feq(C.getVal(1, 0), 20), "");
|
||||
CHECK_INVARIANT(RDKit::feq(C.getVal(1, 1), 20.5), "");
|
||||
|
||||
C /= 2.;
|
||||
CHECK_INVARIANT(RDKit::feq(C.getVal(0, 0), 10.25), "");
|
||||
CHECK_INVARIANT(RDKit::feq(C.getVal(0, 1), 10), "");
|
||||
CHECK_INVARIANT(RDKit::feq(C.getVal(1, 0), 10), "");
|
||||
CHECK_INVARIANT(RDKit::feq(C.getVal(1, 1), 10.25), "");
|
||||
|
||||
Vector<double> tRow(A.numCols());
|
||||
A.getRow(1, tRow);
|
||||
for (unsigned int i = 0; i < A.numCols(); ++i) {
|
||||
TEST_ASSERT(RDKit::feq(A.getVal(1, i), tRow.getVal(i)));
|
||||
}
|
||||
Vector<double> tCol(A.numRows());
|
||||
A.getCol(1, tCol);
|
||||
for (unsigned int i = 0; i < A.numRows(); ++i) {
|
||||
TEST_ASSERT(RDKit::feq(A.getVal(i, 1), tCol.getVal(i)));
|
||||
}
|
||||
}
|
||||
|
||||
void test3SquareMatrix() {
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
tests = [
|
||||
("python", "test_list.py", {'dir': 'Optimizer'}),
|
||||
("python", "test_list.py", {'dir': 'EigenSolvers'}),
|
||||
("python", "test_list.py", {'dir': 'Alignment'}),
|
||||
("testExecs/main.exe", "", {}),
|
||||
]
|
||||
|
||||
if __name__ == '__main__':
|
||||
import sys
|
||||
from rdkit import TestRunner
|
||||
failed, tests = TestRunner.RunScript('test_list.py', 0, 1)
|
||||
sys.exit(len(failed))
|
||||
Reference in New Issue
Block a user