Skip to content

Commit

Permalink
#1282 SMARTS load/save errors in Indigo.
Browse files Browse the repository at this point in the history
Fix Unit Tests
  • Loading branch information
AliaksandrDziarkach committed Sep 20, 2023
1 parent e51d1d9 commit 3bb3e39
Show file tree
Hide file tree
Showing 12 changed files with 1 addition and 10 deletions.
2 changes: 0 additions & 2 deletions api/tests/integration/ref/formats/smarts.py.out
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ CC[C+5]CCCCC
([#8].[#6]).([#8].[#6]) is ok. smarts_in==smarts_out
[!C!b] is ok. smarts_in==smarts_out
[*] is ok. smarts_in==smarts_out
[*R] is ok. smarts_in==smarts_out
[*R0] is ok. smarts_in==smarts_out
[*R1] is ok. smarts_in==smarts_out
[*R3] is ok. smarts_in==smarts_out
[r] is ok. smarts_in==smarts_out
Expand Down
2 changes: 0 additions & 2 deletions api/tests/integration/tests/formats/smarts.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,6 @@ def test_smarts_load_save(smarts_in):

test_smarts_load_save("[!C!b]")
test_smarts_load_save("[*]")
test_smarts_load_save("[*R]")
test_smarts_load_save("[*R0]")
test_smarts_load_save("[*R1]")
test_smarts_load_save("[*R3]")
test_smarts_load_save("[r]")
Expand Down
Binary file modified api/tests/integration/tests/rendering/ref/linux/smarts/0171.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified api/tests/integration/tests/rendering/ref/linux/smarts/0172.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified api/tests/integration/tests/rendering/ref/linux/smarts/0188.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified api/tests/integration/tests/rendering/ref/mac/smarts/0171.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified api/tests/integration/tests/rendering/ref/mac/smarts/0172.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified api/tests/integration/tests/rendering/ref/mac/smarts/0188.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified api/tests/integration/tests/rendering/ref/win/smarts/0171.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified api/tests/integration/tests/rendering/ref/win/smarts/0172.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified api/tests/integration/tests/rendering/ref/win/smarts/0188.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 1 addition & 6 deletions core/indigo-core/molecule/src/smiles_loader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2886,15 +2886,10 @@ void SmilesLoader::_readAtom(Array<char>& atom_str, bool first_in_brackets, _Ato
int rc = scanner.readUnsigned();

if (rc == 0)
if (smarts_mode)
subatom = std::make_unique<QueryMolecule::Atom>(QueryMolecule::ATOM_SSSR_RINGS, 0);
else
subatom = std::make_unique<QueryMolecule::Atom>(QueryMolecule::ATOM_RING_BONDS, 0);
subatom = std::make_unique<QueryMolecule::Atom>(QueryMolecule::ATOM_RING_BONDS, 0);
else
subatom = std::make_unique<QueryMolecule::Atom>(QueryMolecule::ATOM_SSSR_RINGS, rc);
}
else if (smarts_mode)
subatom = std::make_unique<QueryMolecule::Atom>(QueryMolecule::ATOM_SSSR_RINGS, 1, 100);
else
subatom = std::make_unique<QueryMolecule::Atom>(QueryMolecule::ATOM_RING_BONDS, 1, 100);
}
Expand Down

0 comments on commit 3bb3e39

Please sign in to comment.