-
Notifications
You must be signed in to change notification settings - Fork 538
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
More parsing tests for literals with leading minus #99
Conversation
Also checks some hex literal cases. This addresses part of KhronosGroup#45 by removing the parseNumber case for "-0" on unsigned integers. We don't care about that platform difference at the level of std::istringstream, since we reject it at a higher parsing level.
|
||
// Valid values. | ||
EXPECT_EQ(SPV_SUCCESS, context.parseNumber("0", ec, &u32, "")); | ||
EXPECT_EQ(0, u32); |
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.
Should be 0u
-- see Travis failures.
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.
Fixed in next commit
MakeInstruction(SpvOpConstant, {1, 2, 0})})}, | ||
{"OpTypeInt 16 1", "-32768", | ||
Concatenate({MakeInstruction(SpvOpTypeInt, {1, 16, 1}), | ||
MakeInstruction(SpvOpConstant, {1, 2, uint32_t(-32768)})})}, |
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.
"Convert arithmetic types using brace initialization."
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.
The style guide has been changing in this regard. That's new advice. We never did go back and change all our existing uint32_t( .. ) to static_cast. I'll use the brace initialization in future.
+2 despite nits. |
Squashed and pushed into master as feda995 |
Update Codeplay's contact details
Also checks some hex literal cases.
This addresses part of
#45
by removing the parseNumber case for "-0" on unsigned
integers. We don't care about that platform difference
at the level of std::istringstream, since we reject it
at a higher parsing level.