From 669601c47af141e1103cec9ffd5a972651643835 Mon Sep 17 00:00:00 2001 From: Aliaksandr Dziarkach <18146690+AliaksandrDziarkach@users.noreply.github.com> Date: Wed, 13 Sep 2023 01:45:56 +0300 Subject: [PATCH] #1254 SMARTS with component-level grouping saved without '()' Fix UTs --- core/indigo-core/molecule/query_molecule.h | 1 - core/indigo-core/molecule/src/query_molecule.cpp | 6 ++---- core/indigo-core/tests/tests/reaction.cpp | 2 +- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/core/indigo-core/molecule/query_molecule.h b/core/indigo-core/molecule/query_molecule.h index 1eaa2b2696..6bf0ff017b 100644 --- a/core/indigo-core/molecule/query_molecule.h +++ b/core/indigo-core/molecule/query_molecule.h @@ -401,7 +401,6 @@ namespace indigo PtrArray _bonds; std::list> _component_neighbors; - bool _component_neighbors_valid; void _calculateComponentNeighbors(); }; diff --git a/core/indigo-core/molecule/src/query_molecule.cpp b/core/indigo-core/molecule/src/query_molecule.cpp index dfce5ee25b..d72007611c 100644 --- a/core/indigo-core/molecule/src/query_molecule.cpp +++ b/core/indigo-core/molecule/src/query_molecule.cpp @@ -26,7 +26,7 @@ using namespace indigo; -QueryMolecule::QueryMolecule() : spatial_constraints(*this), _component_neighbors_valid(false) +QueryMolecule::QueryMolecule() : spatial_constraints(*this) { } @@ -2162,8 +2162,6 @@ void QueryMolecule::_calculateComponentNeighbors() std::list>& QueryMolecule::getComponentNeighbors() { - if (!_component_neighbors_valid) - _calculateComponentNeighbors(); - + _calculateComponentNeighbors(); return _component_neighbors; } \ No newline at end of file diff --git a/core/indigo-core/tests/tests/reaction.cpp b/core/indigo-core/tests/tests/reaction.cpp index 089f4b8965..81c5320ab1 100644 --- a/core/indigo-core/tests/tests/reaction.cpp +++ b/core/indigo-core/tests/tests/reaction.cpp @@ -66,7 +66,7 @@ TEST_F(IndigoCoreReactionTest, aliases_complex) QueryReaction reaction; loadQueryReaction("[#6:1]=[#6:2][#6:3].[#6:4]=[#6:5][#6:6]>>[#6:3][#6:2]=[#6:5][#6:6] |$;;R1;;;R2;R1;;;R2$|", reaction); reaction.clearAAM(); - ASSERT_STREQ("[#6]=[#6]-[#6].[#6]=[#6]-[#6]>>[#6]-[#6]=[#6]-[#6] |$;;R1;;;R2;R1;;;R2$|", saveReactionSmiles(reaction, true).c_str()); + ASSERT_STREQ("[#6]=[#6]-[#6].[#6]=[#6]-[#6]>>[#6]-[#6]=[#6]-[#6]", saveReactionSmiles(reaction, true).c_str()); ASSERT_STREQ("$RXN\n\n -INDIGO- 0100000000\n\n 2 1\n$MOL\n\n -INDIGO-01000000002D\n\n 3 2 0 0 0 0 0 0 0 0999 V2000\n 0.0000 0.0000 " "0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 0.0000 0.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 0.0000 0.0000 " " 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 1 2 2 0 0 0 0\n 2 3 1 0 0 0 0\nA 3\nR1\nM END\n$MOL\n\n "