From b4da788fd22d3bec5093e899d4c7eb76d952fed8 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Mon, 11 Jul 2011 10:13:00 +0300 Subject: [PATCH] Add basic test for Ftell() in python --- tests/rpmpython.at | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/rpmpython.at b/tests/rpmpython.at index 1669715..6e641ac 100644 --- a/tests/rpmpython.at +++ b/tests/rpmpython.at @@ -39,11 +39,17 @@ data = msg * 10 for iot in [ 'fpio', 'fdio', 'ufdio', 'gzdio' ]: fn = 'pyio.%s' % iot fd = rpm.fd(fn, 'w', iot) + pos = fd.tell() + if pos != -2 and pos != 0: + myprint('bad start pos %d' % fd.tell()) if fd.write(data) != len(data): myprint('%s write fail' % iot) if fn != fd.name: myprint('bad file name %s' % fd.name) fd.flush() + pos = fd.tell() + if pos != -2 and pos != len(data): + myprint('bad end pos %d' % fd.tell()) fd = rpm.fd(fn, 'r', iot) rdata = fd.read() if rdata != data: -- 2.7.4