Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Gwenaël Samain
cython
Commits
055de7b8
Commit
055de7b8
authored
Aug 15, 2008
by
Dag Sverre Seljebotn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Buffers: Update test-case strings, clean up endianness
parent
62ef7487
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
10 deletions
+6
-10
Cython/Compiler/Buffer.py
Cython/Compiler/Buffer.py
+4
-8
tests/run/bufaccess.pyx
tests/run/bufaccess.pyx
+2
-2
No files found.
Cython/Compiler/Buffer.py
View file @
055de7b8
...
...
@@ -454,17 +454,13 @@ def get_ts_check_item(dtype, writer):
char
=
dtype
.
typestring
if
char
is
not
None
:
# Can use direct comparison
if
char
is
'O'
:
byteorder
=
'|'
else
:
byteorder
=
'1'
code
=
dedent
(
"""
\
if (*ts == '
%s
') ++ts;
if (*ts == '
1
') ++ts;
if (*ts != '%s') {
PyErr_Format(PyExc_ValueError, "Buffer datatype mismatch (expect
ing '%s'
got '%%s')", ts);
PyErr_Format(PyExc_ValueError, "Buffer datatype mismatch (expect
ed '%s',
got '%%s')", ts);
return NULL;
} else return ts + 1;
"""
,
2
)
%
(
byteorder
,
char
,
char
)
"""
,
2
)
%
(
char
,
char
)
else
:
# Cannot trust declared size; but rely on int vs float and
# signed/unsigned to be correctly declared
...
...
@@ -541,7 +537,7 @@ def get_getbuffer_code(dtype, code):
ts = __Pyx_ConsumeWhitespace(ts);
if (*ts != 0) {
PyErr_Format(PyExc_ValueError,
"Expected non-struct buffer data type (
rejecting on
'%%s')", ts);
"Expected non-struct buffer data type (
expected end, got
'%%s')", ts);
goto fail;
}
if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones;
...
...
tests/run/bufaccess.pyx
View file @
055de7b8
...
...
@@ -447,7 +447,7 @@ def fmtst1(buf):
>>> fmtst1(IntMockBuffer("A", range(3)))
Traceback (most recent call last):
...
ValueError: Buffer datatype mismatch (
rejecting on
'i')
ValueError: Buffer datatype mismatch (
expected 'f', got
'i')
"""
cdef
object
[
float
]
a
=
buf
...
...
@@ -457,7 +457,7 @@ def fmtst2(object[int] buf):
>>> fmtst2(FloatMockBuffer("A", range(3)))
Traceback (most recent call last):
...
ValueError: Buffer datatype mismatch (
rejecting on
'f')
ValueError: Buffer datatype mismatch (
expected 'i', got
'f')
"""
@
testcase
...
...
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