From: Alex M. <al...@us...> - 2005-11-07 19:21:24
|
Update of /cvsroot/gmpy/gmpy/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14385 Modified Files: gmpy_test_cvr.py gmpy_test_mpz.py Log Message: Tweaked tests to pass on Python 2.2 (as well as 2.3, 2.4); disabled attempts to check memory leaks except in Linux and Darwin (MacOSX). Index: gmpy_test_cvr.py =================================================================== RCS file: /cvsroot/gmpy/gmpy/test/gmpy_test_cvr.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** gmpy_test_cvr.py 6 Nov 2005 03:14:41 -0000 1.4 --- gmpy_test_cvr.py 7 Nov 2005 19:21:16 -0000 1.5 *************** *** 3,8 **** # test-version 1.01 r''' ! >>> _g.gmp_version() in ('4.1.4', '4.0.1', '3.1.1') ! True >>> _g.version() '1.01' --- 3,8 ---- # test-version 1.01 r''' ! >>> print int(_g.gmp_version() in ('4.1.4', '4.1.2', '4.0.1', '3.1.1')) ! 1 >>> _g.version() '1.01' Index: gmpy_test_mpz.py =================================================================== RCS file: /cvsroot/gmpy/gmpy/test/gmpy_test_mpz.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** gmpy_test_mpz.py 7 Nov 2005 18:08:17 -0000 1.6 --- gmpy_test_mpz.py 7 Nov 2005 19:21:16 -0000 1.7 *************** *** 15,27 **** b=_g.mpz(456) ! def _memsize(): ! """ this function tries to return a measurement of how much memory ! this process is consuming (if it doesn't manage to, it returns 0). ! """ ! import os ! try: x = int(os.popen('ps -p %d -o vsz|tail -1' % os.getpid()).read()) ! except: x = 0 ! # print 'ms:', x ! return x def factorize(x): --- 15,31 ---- b=_g.mpz(456) ! if sys.platform in ('linux2', 'darwin'): ! def _memsize(): ! """ this function tries to return a measurement of how much memory ! this process is consuming (if it doesn't manage to, it returns 0). ! """ ! import os ! try: x = int(os.popen('ps -p %d -o vsz|tail -1' % os.getpid()).read()) ! except: x = 0 ! # print 'ms:', x ! return x ! else: ! def _memsize(): ! return 0 def factorize(x): |