|
@@ -54,23 +54,31 @@ class TestRpnCompile(unittest.TestCase):
|
54
|
54
|
res = pyrpn.RPNExpr(expr, argc)
|
55
|
55
|
|
56
|
56
|
def test_long_code(self):
|
57
|
|
- """ Compile long expressions """
|
|
57
|
+ """ Compile longs expressions (from 256 to 65536 op )"""
|
58
|
58
|
for i in range(0x100,0x10000,0x500):
|
59
|
59
|
with self.subTest('Testing expression with %X ops' % i):
|
60
|
60
|
for argc in range(1,32, 8):
|
|
61
|
+ sys.stderr.write('.')
|
|
62
|
+ sys.stderr.flush()
|
61
|
63
|
args = [random.randint(0,IMAX) for _ in range(argc)]
|
62
|
64
|
expr = pyrpn.RPNExpr(pyrpn.random_expr(argc, i), argc)
|
63
|
65
|
del(expr)
|
64
|
66
|
|
65
|
67
|
def test_very_long(self):
|
66
|
|
- """ Compile a very long expression """
|
|
68
|
+ """ Compile 3 very long expression (5242K op) """
|
67
|
69
|
argc = 4
|
68
|
70
|
codelen = 0x500000
|
69
|
71
|
import time
|
70
|
72
|
for i in range(3):
|
71
|
73
|
args = [random.randint(0,IMAX) for _ in range(argc)]
|
|
74
|
+ sys.stderr.write('Generate')
|
|
75
|
+ sys.stderr.flush()
|
72
|
76
|
expr_str = pyrpn.random_expr(argc, codelen)
|
|
77
|
+ sys.stderr.write('d Compile')
|
|
78
|
+ sys.stderr.flush()
|
73
|
79
|
expr = pyrpn.RPNExpr(expr_str, argc)
|
|
80
|
+ sys.stderr.write('d ')
|
|
81
|
+ sys.stderr.flush()
|
74
|
82
|
del(expr)
|
75
|
83
|
|
76
|
84
|
def test_pickling(self):
|