Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
Pyston
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
Pyston
Commits
707fd328
Commit
707fd328
authored
Feb 10, 2016
by
Marius Wachtler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make the pycrypto integration test run the testsuite
parent
11522d5e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
5 deletions
+25
-5
test/integration/pycrypto_0001-fastmath-Add-support-for-Pyston.patch
...ation/pycrypto_0001-fastmath-Add-support-for-Pyston.patch
+20
-5
test/integration/pycrypto_test.py
test/integration/pycrypto_test.py
+5
-0
No files found.
test/integration/pycrypto_0001-fastmath-Add-support-for-Pyston.patch
View file @
707fd328
...
...
@@ -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, 2
1 insertions(+
)
src/_fastmath.c |
30 ++++++++++++++++++++++++++++--
1 file changed, 2
8 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
test/integration/pycrypto_test.py
View file @
707fd328
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"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment