-
Notifications
You must be signed in to change notification settings - Fork 32
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
Explicit convert UINT64_MAX to unsigned #217
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,7 +62,10 @@ static void checkIt(id obj, const char* json) { | |
checkIt(@123456789, "123456789"); | ||
checkIt(@123456789012, "123456789012"); | ||
checkIt(@(INT64_MAX), "9223372036854775807"); | ||
checkIt(@(UINT64_MAX), "18446744073709551615"); | ||
// checkIt(@(UINT64_MAX), "18446744073709551615"); | ||
// The above may fail to turn UINT64_MAX to unsigned. In the following, | ||
// we apply an explicit conversion | ||
checkIt(@([@UINT64_MAX unsignedLongLongValue]), "18446744073709551615"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is unnecessarily convoluted. You create an NSNumber, turn it back into a native number, then create another NSNumber from that. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for the advice. This is test code and won't be in the product. I will change when ported the the master branch. |
||
} | ||
|
||
TEST_CASE("Obj-C Floats", "[Encoder]") { | ||
|
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.
Can we remove this line?
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.
okay. I was waving between whether to remove it.