diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2017-12-24 01:00:43 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2017-12-24 01:00:43 +0000 |
commit | c900243a09095e1ada97fb2e66ec08f68f277959 (patch) | |
tree | a27aa310f08ab03bb4eead4e773d3837c9f46b32 /test/std/input.output/string.streams/stringbuf/stringbuf.virtuals/seekoff.pass.cpp | |
parent | 0564cdb94a7a1facbb0dbf888ceb90638aa70ecd (diff) | |
download | src-c900243a09095e1ada97fb2e66ec08f68f277959.tar.gz src-c900243a09095e1ada97fb2e66ec08f68f277959.zip |
Vendor import of libc++ trunk r321414:vendor/libc++/libc++-trunk-r321426vendor/libc++/libc++-trunk-r321414
Notes
Notes:
svn path=/vendor/libc++/dist/; revision=327128
svn path=/vendor/libc++/libc++-trunk-r321426/; revision=327157; tag=vendor/libc++/libc++-trunk-r321426
Diffstat (limited to 'test/std/input.output/string.streams/stringbuf/stringbuf.virtuals/seekoff.pass.cpp')
-rw-r--r-- | test/std/input.output/string.streams/stringbuf/stringbuf.virtuals/seekoff.pass.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/std/input.output/string.streams/stringbuf/stringbuf.virtuals/seekoff.pass.cpp b/test/std/input.output/string.streams/stringbuf/stringbuf.virtuals/seekoff.pass.cpp index 6d20db13189a..8ec69cb24b60 100644 --- a/test/std/input.output/string.streams/stringbuf/stringbuf.virtuals/seekoff.pass.cpp +++ b/test/std/input.output/string.streams/stringbuf/stringbuf.virtuals/seekoff.pass.cpp @@ -21,6 +21,30 @@ int main() { { + std::stringbuf sb(std::ios_base::in); + assert(sb.pubseekoff(3, std::ios_base::beg, std::ios_base::out) == -1); + assert(sb.pubseekoff(3, std::ios_base::cur, std::ios_base::out) == -1); + assert(sb.pubseekoff(-3, std::ios_base::end, std::ios_base::out) == -1); + assert(sb.pubseekoff(3, std::ios_base::beg, std::ios_base::in | std::ios_base::out) == -1); + assert(sb.pubseekoff(3, std::ios_base::cur, std::ios_base::in | std::ios_base::out) == -1); + assert(sb.pubseekoff(-3, std::ios_base::end, std::ios_base::in | std::ios_base::out) == -1); + assert(sb.pubseekoff(0, std::ios_base::beg, std::ios_base::in) == 0); + assert(sb.pubseekoff(0, std::ios_base::cur, std::ios_base::in) == 0); + assert(sb.pubseekoff(0, std::ios_base::end, std::ios_base::in) == 0); + } + { + std::stringbuf sb(std::ios_base::out); + assert(sb.pubseekoff(3, std::ios_base::beg, std::ios_base::in) == -1); + assert(sb.pubseekoff(3, std::ios_base::cur, std::ios_base::in) == -1); + assert(sb.pubseekoff(-3, std::ios_base::end, std::ios_base::in) == -1); + assert(sb.pubseekoff(3, std::ios_base::beg, std::ios_base::in | std::ios_base::out) == -1); + assert(sb.pubseekoff(3, std::ios_base::cur, std::ios_base::in | std::ios_base::out) == -1); + assert(sb.pubseekoff(-3, std::ios_base::end, std::ios_base::in | std::ios_base::out) == -1); + assert(sb.pubseekoff(0, std::ios_base::beg, std::ios_base::out) == 0); + assert(sb.pubseekoff(0, std::ios_base::cur, std::ios_base::out) == 0); + assert(sb.pubseekoff(0, std::ios_base::end, std::ios_base::out) == 0); + } + { std::stringbuf sb("0123456789", std::ios_base::in); assert(sb.pubseekoff(3, std::ios_base::beg, std::ios_base::out) == -1); assert(sb.pubseekoff(3, std::ios_base::cur, std::ios_base::out) == -1); |