|
Boost : |
From: Frank Birbacher (bloodymir.crap_at_[hidden])
Date: 2007-08-28 21:59:43
Hi!
I had problems using iostreams::stream<file_descriptor> with Windows and
MSVC 8 Express. The file_descriptor had a bug and failed seeking. But
the error had gone unnoticed. Because of this I wrote a test case for
this in hope to discover an error in IOStreams (source: see below). I
did not discover one. Instead the test runs fine on linux/gcc 4.1.2 but
fails on Windows/MSVC8Express (test run: see below).
I based the test on "Standard C++ IOStreams and Locales" (Langer&Kreft),
Section 1.3 "The Stream State". And I found the IOStreams library is
just using std::iostream for handling the errors. So is MSVC buggy in
this regard? Or am I missing something?
Source of test case in Trac SVN Browser:
http://svn.boost.org/trac/boost/browser/sandbox-branches/birbacher/fix_iostreams/libs/iostreams/test/error_test.cpp?rev=39047
Result of test case on platform Windows/MSVC 8 Express:
> ...using <p..\..\..\bin.v2\libs\iostreams\test\error_test.test\msvc-8.0express\debug>error_test.exe...
> testing.capture-output ..\..\..\bin.v2\libs\iostreams\test\error_test.test\msvc-8.0express\debug\error_test.run
> ====== BEGIN OUTPUT ======
> Running 12 test cases...
> error_test.cpp(81): error in "wrap_nothrow <&test_seekg>": exception thrown by function(stream)
> error_test.cpp(66): error in "wrap_nothrow <&test_seekg>": stream still good
> error_test.cpp(68): error in "wrap_nothrow <&test_seekg>": stream did not set badbit
> error_test.cpp(69): error in "wrap_nothrow <&test_seekg>": stream did not fail
> error_test.cpp(71): error in "wrap_nothrow <&test_seekg>": stream does not report failure by operator !
> error_test.cpp(73): error in "wrap_nothrow <&test_seekg>": stream does not report failure by operator void*
> error_test.cpp(66): error in "wrap_throw <&test_seekg>": stream still good
> error_test.cpp(68): error in "wrap_throw <&test_seekg>": stream did not set badbit
> error_test.cpp(69): error in "wrap_throw <&test_seekg>": stream did not fail
> error_test.cpp(71): error in "wrap_throw <&test_seekg>": stream does not report failure by operator !
> error_test.cpp(73): error in "wrap_throw <&test_seekg>": stream does not report failure by operator void*
> unknown location(0): fatal error in "wrap_throw_delayed<&test_seekg>": std::runtime_error: bad seek
> error_test.cpp(73): last checkpoint
> error_test.cpp(81): error in "wrap_nothrow <&test_seekp>": exception thrown by function(stream)
> error_test.cpp(66): error in "wrap_nothrow <&test_seekp>": stream still good
> error_test.cpp(68): error in "wrap_nothrow <&test_seekp>": stream did not set badbit
> error_test.cpp(69): error in "wrap_nothrow <&test_seekp>": stream did not fail
> error_test.cpp(71): error in "wrap_nothrow <&test_seekp>": stream does not report failure by operator !
> error_test.cpp(73): error in "wrap_nothrow <&test_seekp>": stream does not report failure by operator void*
> error_test.cpp(66): error in "wrap_throw <&test_seekp>": stream still good
> error_test.cpp(68): error in "wrap_throw <&test_seekp>": stream did not set badbit
> error_test.cpp(69): error in "wrap_throw <&test_seekp>": stream did not fail
> error_test.cpp(71): error in "wrap_throw <&test_seekp>": stream does not report failure by operator !
> error_test.cpp(73): error in "wrap_throw <&test_seekp>": stream does not report failure by operator void*
> unknown location(0): fatal error in "wrap_throw_delayed<&test_seekp>": std::runtime_error: bad seek
> error_test.cpp(73): last checkpoint
>
> *** 24 failures detected in test suite "Master Test Suite"
>
> EXIT STATUS: 201
> ====== END OUTPUT ======
Any opinions on this? Any suggestions on what to do about it?
Frank
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk