diff options
author | Eric Fiselier <eric@efcs.ca> | 2014-12-20 01:40:03 +0000 |
---|---|---|
committer | Eric Fiselier <eric@efcs.ca> | 2014-12-20 01:40:03 +0000 |
commit | a90c6dd46005b2b14de3bb889a8d03bb34bd3256 (patch) | |
tree | 81065ae44967d68964de1f2fdfa107623e58e8a4 /test/std/input.output/iostream.format/input.streams/istream.unformatted/ignore_0xff.pass.cpp | |
parent | 669a8a5a1929e881258bfed10d7461ca42ea0a9e (diff) | |
download | external_libcxx-a90c6dd46005b2b14de3bb889a8d03bb34bd3256.tar.gz external_libcxx-a90c6dd46005b2b14de3bb889a8d03bb34bd3256.tar.bz2 external_libcxx-a90c6dd46005b2b14de3bb889a8d03bb34bd3256.zip |
Move test into test/std subdirectory.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@224658 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/std/input.output/iostream.format/input.streams/istream.unformatted/ignore_0xff.pass.cpp')
-rw-r--r-- | test/std/input.output/iostream.format/input.streams/istream.unformatted/ignore_0xff.pass.cpp | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/test/std/input.output/iostream.format/input.streams/istream.unformatted/ignore_0xff.pass.cpp b/test/std/input.output/iostream.format/input.streams/istream.unformatted/ignore_0xff.pass.cpp new file mode 100644 index 000000000..ccc354548 --- /dev/null +++ b/test/std/input.output/iostream.format/input.streams/istream.unformatted/ignore_0xff.pass.cpp @@ -0,0 +1,34 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// <istream> + +// basic_istream<charT,traits>& +// ignore(streamsize n = 1, int_type delim = traits::eof()); + +// http://llvm.org/bugs/show_bug.cgi?id=16427 + +#include <sstream> +#include <cassert> + +int main() +{ + int bad=-1; + std::ostringstream os; + os << "aaaabbbb" << static_cast<char>(bad) + << "ccccdddd" << std::endl; + std::string s=os.str(); + + std::istringstream is(s); + const unsigned int ignoreLen=10; + size_t a=is.tellg(); + is.ignore(ignoreLen); + size_t b=is.tellg(); + assert((b-a)==ignoreLen); +} |