Skip to content
Snippets Groups Projects
Commit d02a37ec authored by Bienchen's avatar Bienchen
Browse files

Merge branch 'master' into develop

parents 3ab0c16a 707417eb
No related branches found
No related tags found
No related merge requests found
Changes in Release 1.7.1
--------------------------------------------------------------------------------
* Fixed an issue that could cause the star format parser (mmCIF, chemical
components dictionary) to enter an infinite loop
* Chemical components dictionary was extended by new chemical classes
introduced by PDB
* Fixed unit tests
* Improved documentation
Changes in Release 1.7
--------------------------------------------------------------------------------
......
......@@ -7,7 +7,7 @@ project(OpenStructure CXX C)
set (CMAKE_EXPORT_COMPILE_COMMANDS 1)
set (OST_VERSION_MAJOR 1)
set (OST_VERSION_MINOR 7)
set (OST_VERSION_PATCH 0)
set (OST_VERSION_PATCH 1)
set (OST_VERSION_STRING ${OST_VERSION_MAJOR}.${OST_VERSION_MINOR}.${OST_VERSION_PATCH} )
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/cmake_support)
include(OST)
......
......@@ -550,11 +550,15 @@ void StarParser::Parse()
case 'd':
if (tline.length()>=5 && StringRef("data_", 5)==tline.substr(0, 5)) {
this->ParseData();
} else {
throw IOException("Missing 'data_' control structure");
}
break;
case 'g':
if (tline.length()>=7 && StringRef("global_", 7)==tline.substr(0, 7)) {
this->ParseGlobal();
} else {
throw IOException("Missing 'global_' control structure");
}
break;
case '#':
......
......@@ -389,6 +389,20 @@ BOOST_AUTO_TEST_CASE(star_items_as_row)
BOOST_TEST_MESSAGE(" done.");
}
BOOST_AUTO_TEST_CASE(star_broken_data)
{
std::ifstream s("testfiles/broken_data.cif");
LoopTestParser star_p(s);
BOOST_CHECK_THROW(star_p.Parse(), IOException);
}
BOOST_AUTO_TEST_CASE(star_broken_global)
{
std::ifstream s("testfiles/broken_global.cif");
LoopTestParser star_p(s);
BOOST_CHECK_THROW(star_p.Parse(), IOException);
}
BOOST_AUTO_TEST_CASE(star_missing_data)
{
std::ifstream s("testfiles/missing_data.cif");
......
d lines starting with a 'd' kicked the parser into an infinite loop.
g lines starting with a 'g' kicked the parser into an infinite loop.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment