subtype is unsigned, another test
This commit is contained in:
parent
2d7d198b7c
commit
40afeaba27
@ -516,7 +516,7 @@ static PyObject* _elements_to_dict(PyObject* elements) {
|
||||
{
|
||||
int length;
|
||||
memcpy(&length, string + position, 4);
|
||||
int subtype = (int)string[position + 4];
|
||||
int subtype = (unsigned char)string[position + 4];
|
||||
PyObject* data;
|
||||
if (subtype == 2) {
|
||||
data = PyString_FromStringAndSize(string + position + 9, length - 4);
|
||||
|
||||
@ -114,6 +114,7 @@ class TestBSON(unittest.TestCase):
|
||||
helper({"an object": {"test": u"something"}})
|
||||
helper({"a binary": Binary("test", 100)})
|
||||
helper({"a binary": Binary("test", 128)})
|
||||
helper({"a binary": Binary("test", 254)})
|
||||
helper({"another binary": Binary("test")})
|
||||
helper(SON([(u'test dst', datetime.datetime(1993, 4, 4, 2))]))
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user