-
Notifications
You must be signed in to change notification settings - Fork 208
PHPC-313: BSON should throw when encountering 64-bit integer on 32-bit platform #436
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PHPC-313: BSON should throw when encountering 64-bit integer on 32-bit platform #436
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with mongoc_log()
removed and indentation changed.
tmp_len = spprintf(&tmp, 0, "%lld", value); \ | ||
ADD_INDEX_STRINGL(zval, index, tmp, tmp_len); \ | ||
efree(tmp); \ | ||
phongo_throw_exception(PHONGO_ERROR_INVALID_ARGUMENT TSRMLS_CC, "Integer overflow detected on your platform: %lld", value); \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is little value in continuing to call mongoc_log()
if we're throwing a proper exception.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, will remove it.
]; | ||
|
||
foreach ($tests as $json) { | ||
throws(function() use ($json) { var_dump(toPHP(fromJSON($json))); }, 'MongoDB\Driver\Exception\InvalidArgumentException'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This appears to be a tab. PHPT tests should be using 4-space indents.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whatever. I'd rather see .c and .h files following coding standards though. phongo_compat.h is all spaces...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
echo "\n"; | ||
} | ||
|
||
?> | ||
===DONE=== | ||
<?php exit(0); ?> | ||
--EXPECTF-- | ||
%a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Per my earlier comment about mongoc_log()
being useless, I think we should remove this and the --INI--
block.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes.
8763aa3
to
22a39d6
Compare
No description provided.