Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

914 Why is the code InChI=123 valid #1229

Merged
merged 2 commits into from
Aug 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading