Skip to content
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

Fixes #3214 UAIFile unittest comparison between signed and unsigned #3215

Closed
wants to merge 1 commit into from

Conversation

arianepaola
Copy link
Contributor

Fixes #3214 UAIFile unittest comparison between signed and unsigned integer expressions

@@ -67,7 +67,7 @@ TEST(UAIFileTest, preamble)
factors_scope_in);

const char net_type_expected[] = "MARKOV";
EXPECT_EQ(net_type.vlen, strlen(net_type_expected));
EXPECT_EQ(net_type.vlen, static_cast<int32_t>(strlen(net_type_expected)));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor: Technically, this is not safe. Think of possible overflows.
You could rather cast the vlen to unsigned int and assert for positivity first.

@karlnapf
Copy link
Member

karlnapf commented Jun 1, 2016

Could you fix the cast so that we can merge?

@arianepaola
Copy link
Contributor Author

arianepaola commented Jun 8, 2016

@vigsterkr @karlnapf @lgoetz
I will be updating the PR shortly.

@karlnapf talked with me about the changes on IRC.

@karlnapf karlnapf mentioned this pull request Oct 30, 2016
@vigsterkr vigsterkr closed this Feb 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants