mirror of
https://github.com/boostorg/interprocess.git
synced 2026-01-19 04:12:13 +00:00
Fixed Trac #5139 ("Initial Stream Position in Boost.Interprocess.Vectorstream")
This commit is contained in:
@@ -6734,6 +6734,7 @@ thank them:
|
||||
|
||||
[section:release_notes_boost_1_59_00 Boost 1.59 Release]
|
||||
* Fixed bugs:
|
||||
* [@https://svn.boost.org/trac/boost/ticket/5139 ( Trac #5139 ( (['"Initial Stream Position in Boost.Interprocess.Vectorstream"])].
|
||||
* [@https://github.com/boostorg/interprocess/pull/19 GitHub Pull #19 (['"Fix exception visibility"])]. Thanks to Romain-Geissler.
|
||||
|
||||
[endsect]
|
||||
|
||||
@@ -200,8 +200,8 @@ class basic_bufferbuf
|
||||
|
||||
if(!in && !out)
|
||||
return pos_type(off_type(-1));
|
||||
else if((in && (!(m_mode & std::ios_base::in) || this->gptr() == 0)) ||
|
||||
(out && (!(m_mode & std::ios_base::out) || this->pptr() == 0)))
|
||||
else if((in && (!(m_mode & std::ios_base::in) || (off != 0 && this->gptr() == 0) )) ||
|
||||
(out && (!(m_mode & std::ios_base::out) || (off != 0 && this->pptr() == 0))))
|
||||
return pos_type(off_type(-1));
|
||||
|
||||
std::streamoff newoff;
|
||||
|
||||
@@ -298,8 +298,8 @@ class basic_vectorbuf
|
||||
return pos_type(off_type(-1));
|
||||
else if((in && out) && (dir == std::ios_base::cur))
|
||||
return pos_type(off_type(-1));
|
||||
else if((in && (!(m_mode & std::ios_base::in) || this->gptr() == 0)) ||
|
||||
(out && (!(m_mode & std::ios_base::out) || this->pptr() == 0)))
|
||||
else if((in && (!(m_mode & std::ios_base::in) || (off != 0 && this->gptr() == 0) )) ||
|
||||
(out && (!(m_mode & std::ios_base::out) || (off != 0 && this->pptr() == 0))))
|
||||
return pos_type(off_type(-1));
|
||||
|
||||
off_type newoff;
|
||||
|
||||
@@ -34,6 +34,12 @@ static int bufferstream_test()
|
||||
//This will be zero-initialized
|
||||
static char buffer [BufSize];
|
||||
bufferstream bufstream;
|
||||
if(bufstream.tellg() != std::streampos(0)){
|
||||
return 1;
|
||||
}
|
||||
if(bufstream.tellp() != std::streampos(0)){
|
||||
return 1;
|
||||
}
|
||||
std::stringstream std_stringstream;
|
||||
std::string str1, str2, str3("testline:");
|
||||
int number1, number2;
|
||||
@@ -129,7 +135,7 @@ static int bufferstream_test()
|
||||
|
||||
int main ()
|
||||
{
|
||||
if(bufferstream_test()==-1){
|
||||
if(bufferstream_test()){
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
|
||||
@@ -39,6 +39,14 @@ static int vectorstream_test()
|
||||
{
|
||||
{ //Test high watermarking initialization
|
||||
my_stringstream_t my_stringstream;
|
||||
|
||||
if(my_stringstream.tellg() != std::streampos(0)){
|
||||
return 1;
|
||||
}
|
||||
if(my_stringstream.tellp() != std::streampos(0)){
|
||||
return 1;
|
||||
}
|
||||
|
||||
int a (0);
|
||||
my_stringstream << 11;
|
||||
my_stringstream >> a;
|
||||
|
||||
Reference in New Issue
Block a user