git » libjio » commit 76a37f8

tests/behaviour: Add a test for jreadv()/jwritev()

author Alberto Bertogli
2009-07-13 05:45:55 UTC
committer Alberto Bertogli
2009-07-13 05:45:55 UTC
parent 3eddb4c1f277e30fbbb86f2f9f30a247f87d6c73

tests/behaviour: Add a test for jreadv()/jwritev()

Signed-off-by: Alberto Bertogli <albertito@blitiri.com.ar>

tests/behaviour/t_normal.py +14 -0

diff --git a/tests/behaviour/t_normal.py b/tests/behaviour/t_normal.py
index cb8ab91..5a84e54 100644
--- a/tests/behaviour/t_normal.py
+++ b/tests/behaviour/t_normal.py
@@ -332,4 +332,18 @@ def test_n20():
 	fsck_verify(n)
 	cleanup(n)
 
+def test_n21():
+	"jwritev and jreadv"
+	f, jf = bitmp()
+	n = f.name
+
+	jf.writev(["hello ", "world"])
+	l = [bytearray("......"), bytearray(".....")]
+	jf.lseek(0, 0)
+	jf.readv(l)
+
+	assert content(n) == "hello world"
+	assert l[0] == "hello " and l[1] == "world"
+	fsck_verify(n)
+	cleanup(n)