Skip to content
Snippets Groups Projects
Commit e2b3a001 authored by marco's avatar marco
Browse files

fix alignment/sequence unit tests

git-svn-id: https://dng.biozentrum.unibas.ch/svn/openstructure/trunk@2219 5a81b35b-ba03-0410-adc8-b2c5c5119f08
parent 37e6e4c2
No related branches found
No related tags found
No related merge requests found
...@@ -170,7 +170,7 @@ int SequenceImpl::GetLength() const { ...@@ -170,7 +170,7 @@ int SequenceImpl::GetLength() const {
char SequenceImpl::GetOneLetterCode(int position) const char SequenceImpl::GetOneLetterCode(int position) const
{ {
if (position<0 || position>static_cast<int>(seq_string_.length())) if (position<0 || position>=static_cast<int>(seq_string_.length()))
throw Error("Position is not covered in sequence"); throw Error("Position is not covered in sequence");
return seq_string_[position]; return seq_string_[position];
} }
......
...@@ -215,9 +215,9 @@ BOOST_AUTO_TEST_CASE(alignment_aligned_region) ...@@ -215,9 +215,9 @@ BOOST_AUTO_TEST_CASE(alignment_aligned_region)
BOOST_CHECK_THROW(ar = a.MakeRegion(-1,2,0),std::out_of_range); BOOST_CHECK_THROW(ar = a.MakeRegion(-1,2,0),std::out_of_range);
BOOST_CHECK_THROW(ar = a.MakeRegion(0,7,0),std::out_of_range); BOOST_CHECK_THROW(ar = a.MakeRegion(0,7,0),std::out_of_range);
BOOST_CHECK_THROW(ar = a.MakeRegion(2,4,0),std::out_of_range); BOOST_CHECK_NO_THROW(ar = a.MakeRegion(2,4,0));
BOOST_CHECK_THROW(ar = a.MakeRegion(3,2,0),std::out_of_range); BOOST_CHECK_NO_THROW(ar = a.MakeRegion(3,2,0));
BOOST_CHECK_THROW(ar = a.MakeRegion(3,3,0),std::out_of_range); BOOST_CHECK_NO_THROW(ar = a.MakeRegion(3,3,0));
} }
BOOST_AUTO_TEST_SUITE_END() BOOST_AUTO_TEST_SUITE_END()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment