Commit 6f423915 authored by Marius Wachtler's avatar Marius Wachtler

Merge pull request #1094 from undingen/pycrypto_test

Make the pycrypto integration test run the testsuite
parents 11522d5e 076a7888
......@@ -91,8 +91,6 @@ test_email [unknown]
test_enumerate assert instead of exception in BoxedEnumerate
test_exceptions we are missing recursion-depth checking
test_extcall f(**kw) crashes if kw isn't a dict
test_file2k we abort when you try to open() a directory
test_file_eintr not sure
test_fileio [unknown]
test_fork1 [unknown]
test_frozen [unknown]
......
......@@ -4,11 +4,11 @@ Date: Tue, 28 Apr 2015 11:49:32 +0200
Subject: [PATCH] fastmath: Add support for Pyston
---
src/_fastmath.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
src/_fastmath.c | 30 ++++++++++++++++++++++++++++--
1 file changed, 28 insertions(+), 2 deletions(-)
diff --git a/src/_fastmath.c b/src/_fastmath.c
index e369f5a..c4cf2aa 100644
index e369f5a..854a984 100644
--- a/src/_fastmath.c
+++ b/src/_fastmath.c
@@ -29,7 +29,14 @@
......@@ -54,6 +54,21 @@ index e369f5a..c4cf2aa 100644
typedef struct
{
@@ -1427,8 +1448,13 @@ getStrongPrime (PyObject *self, PyObject *args, PyObject *kwargs)
Py_BLOCK_THREADS;
res = 1;
res &= getRandomRange (X, lower_bound, upper_bound, randfunc);
- res &= getRandomNBitInteger (y[0], 101, randfunc);
- res &= getRandomNBitInteger (y[1], 101, randfunc);
+ // Pyston change: abort on the first error encountered
+ // res &= getRandomNBitInteger (y[0], 101, randfunc);
+ // res &= getRandomNBitInteger (y[1], 101, randfunc);
+ if (res)
+ res &= getRandomNBitInteger (y[0], 101, randfunc);
+ if (res)
+ res &= getRandomNBitInteger (y[1], 101, randfunc);
Py_UNBLOCK_THREADS;
if (!res)
{
--
2.1.0
1.9.1
import subprocess, sys, os, shutil, StringIO
sys.path.append(os.path.dirname(__file__) + "/../lib")
import test_helper
PATCHES = ["pycrypto_0001-fastmath-Add-support-for-Pyston.patch"]
PATCHES = [os.path.abspath(os.path.join(os.path.dirname(__file__), p)) for p in PATCHES]
......@@ -56,6 +58,9 @@ enc_data = public_key.encrypt(test_string, 32)
assert enc_data != test_string
assert key.decrypt(enc_data) == test_string
expected = [{'ran': 1891}]
test_helper.run_test([sys.executable, "setup.py", "test"], pycrypto_dir, expected)
print "-- Tests finished"
print "-- Unpatching pycrypto"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment