Skip to content

Commit

Permalink
914 Why is the code InChI=123 valid (#1229)
Browse files Browse the repository at this point in the history
  • Loading branch information
Wadym authored Aug 21, 2023
1 parent 5fb2726 commit 9c46ebd
Show file tree
Hide file tree
Showing 14 changed files with 20 additions and 638 deletions.
20 changes: 17 additions & 3 deletions api/c/tests/unit/tests/inchi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ TEST_F(IndigoApiInchiTest, basic)
}
catch (const std::exception& e)
{
ASSERT_STREQ("inchi-wrapper: Indigo-InChI: no structural data has been provided: . Code: -1.", e.what());
ASSERT_STREQ("inchi-wrapper: Wrong InChI format", e.what());
}
}

Expand All @@ -77,6 +77,20 @@ TEST_F(IndigoApiInchiTest, incorrect_symbols)
}
catch (const std::exception& e)
{
ASSERT_STREQ("inchi-wrapper: Indigo-InChI: no structural data has been provided: (null). Code: -1.", e.what());
ASSERT_STREQ("inchi-wrapper: Wrong InChI format", e.what());
}
}
}

TEST_F(IndigoApiInchiTest, incorrect_symbols_123)
{
try
{
const char* inchi = "InChI=123";
const auto m = indigoInchiLoadMolecule(inchi);
EXPECT_ANY_THROW(indigoInchiGetInchi(m));
}
catch (const std::exception& e)
{
ASSERT_STREQ("inchi-wrapper: Wrong InChI format", e.what());
}
}
502 changes: 0 additions & 502 deletions api/http/env/Scripts/Activate.ps1

This file was deleted.

69 changes: 0 additions & 69 deletions api/http/env/Scripts/activate

This file was deleted.

34 changes: 0 additions & 34 deletions api/http/env/Scripts/activate.bat

This file was deleted.

22 changes: 0 additions & 22 deletions api/http/env/Scripts/deactivate.bat

This file was deleted.

Binary file removed api/http/env/Scripts/pip.exe
Binary file not shown.
Binary file removed api/http/env/Scripts/pip3.11.exe
Binary file not shown.
Binary file removed api/http/env/Scripts/pip3.exe
Binary file not shown.
Binary file removed api/http/env/Scripts/py.test.exe
Binary file not shown.
Binary file removed api/http/env/Scripts/pytest.exe
Binary file not shown.
Binary file removed api/http/env/Scripts/python.exe
Binary file not shown.
Binary file removed api/http/env/Scripts/pythonw.exe
Binary file not shown.
5 changes: 0 additions & 5 deletions api/http/env/pyvenv.cfg

This file was deleted.

6 changes: 3 additions & 3 deletions core/indigo-core/molecule/src/inchi_wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,13 +173,13 @@ void InchiWrapper::loadMoleculeFromInchi(const char* inchi_string, Molecule& mol
log.readString(inchi_output.szLog, true);

if (retcode == inchi_Ret_EOF) /* no structural data has been provided */
throw Error("Indigo-InChI: no structural data has been provided: %s. Code: %d.", inchi_output.szMessage, retcode);
throw Error("Wrong InChI format");

if (retcode == inchi_Ret_BUSY) /* Previuos call to InChI has not returned yet */
throw Error("Indigo-InChI: Previuos call to InChI has not returned yet: %s. Code: %d.", inchi_output.szMessage, retcode);
throw Error("Internal error parsing InChI string");

if (retcode != inchi_Ret_OKAY && retcode != inchi_Ret_WARNING)
throw Error("Indigo-InChI: InChI loading failed: %s. Code: %d.", inchi_output.szMessage, retcode);
throw Error("Internal error parsing InChI string");

// Check stereo options
_stereo_opt = _STEREO_ABS;
Expand Down

0 comments on commit 9c46ebd

Please sign in to comment.