summaryrefslogtreecommitdiff
path: root/tests/wocky-test-stream.h
diff options
context:
space:
mode:
authorSjoerd Simons <sjoerd.simons@collabora.co.uk>2011-07-26 10:05:41 +0100
committerWill Thompson <will.thompson@collabora.co.uk>2011-07-27 13:38:26 +0100
commit1051de8fc4fdb26ed08f7029a1ff9a571775708c (patch)
tree14057a8a6d0f9c651cc531d39cc0c3082c9f756e /tests/wocky-test-stream.h
parent502a365c34c9b684bb586e0761c0ce762fcd5d2b (diff)
Add an incomplete write mode to the test-stream
To stress the various bit of code a bit more, make writes by default never succeed completely. Only write half the buffer that is given to us as this causes some more code-paths to be tested. Unfortunately some tests seem to be too sensitive to this. So switch them back to the old write mode.
Diffstat (limited to 'tests/wocky-test-stream.h')
-rw-r--r--tests/wocky-test-stream.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/wocky-test-stream.h b/tests/wocky-test-stream.h
index e084cde..b37a678 100644
--- a/tests/wocky-test-stream.h
+++ b/tests/wocky-test-stream.h
@@ -80,9 +80,19 @@ typedef enum {
WOCK_TEST_STREAM_READ_EXACT,
} WockyTestSTreamReadMode;
+typedef enum {
+ /* all writes are only half-done, default */
+ WOCKY_TEST_STREAM_WRITE_INCOMPLETE = 0,
+ /* Always succeed in writing everything */
+ WOCKY_TEST_STREAM_WRITE_COMPLETE = 1,
+} WockyTestStreamWriteMode;
+
void wocky_test_stream_set_mode (GInputStream *stream,
WockyTestSTreamReadMode mode);
+void wocky_test_stream_set_write_mode (GOutputStream *stream,
+ WockyTestStreamWriteMode mode);
+
G_END_DECLS
#endif /* #ifndef __WOCKY_TEST_STREAM_H__*/