From: Panu Matilainen Date: Mon, 11 Jul 2011 07:13:00 +0000 (+0300) Subject: Add basic test for Ftell() in python X-Git-Tag: tznext/4.11.0.1.tizen20130304~959 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b4da788fd22d3bec5093e899d4c7eb76d952fed8;p=tools%2Flibrpm-tizen.git Add basic test for Ftell() in python --- 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: