diff options
| author | ljfa <ljfa-ag@web.de> | 2015-09-21 08:30:25 +0200 |
|---|---|---|
| committer | ljfa <ljfa-ag@web.de> | 2015-09-21 08:33:16 +0200 |
| commit | 64e6d2abc719869e386caa760bfbe1e65bd7559b (patch) | |
| tree | f666d9f05a11058e31703879f07e297ef40b1f86 /test | |
| parent | 07a9300246630705d5f4e6978cdc5cf8a8b4afd7 (diff) | |
| download | Project-Tick-64e6d2abc719869e386caa760bfbe1e65bd7559b.tar.gz Project-Tick-64e6d2abc719869e386caa760bfbe1e65bd7559b.zip | |
Create ozlibstream::close method
Set failbit on output stream on failure
Diffstat (limited to 'test')
| -rw-r--r-- | test/zlibstream_test.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/test/zlibstream_test.h b/test/zlibstream_test.h index 754f4e5d58..a8357e2692 100644 --- a/test/zlibstream_test.h +++ b/test/zlibstream_test.h @@ -143,8 +143,9 @@ public: { ozlibstream ozls(str, -1, false, 256); ozls.exceptions(std::ios::failbit | std::ios::badbit); - ozls << bigtest; + TS_ASSERT_THROWS_NOTHING(ozls << bigtest); TS_ASSERT(ozls.good()); + TS_ASSERT_THROWS_NOTHING(ozls.close()); } TS_ASSERT(str.good()); { @@ -166,6 +167,7 @@ public: std::string half2 = bigtest.substr(bigtest.size()/2); TS_ASSERT_THROWS_NOTHING(ozls << half1 << std::flush << half2); TS_ASSERT(ozls.good()); + TS_ASSERT_THROWS_NOTHING(ozls.close()); } TS_ASSERT(str.good()); { @@ -183,6 +185,8 @@ public: ozls.exceptions(std::ios::failbit | std::ios::badbit); TS_ASSERT_THROWS_NOTHING(ozls << bigtest); TS_ASSERT(ozls.good()); + TS_ASSERT_THROWS_NOTHING(ozls.close()); + TS_ASSERT_THROWS_NOTHING(ozls.close()); //closing twice shouldn't be a problem } TS_ASSERT(str.good()); { @@ -202,6 +206,7 @@ public: ozls.exceptions(std::ios::failbit | std::ios::badbit); TS_ASSERT_THROWS_NOTHING(ozls << bigtest); TS_ASSERT(ozls.good()); + TS_ASSERT_THROWS_NOTHING(ozls.close()); } TS_ASSERT(str.good()); { |
