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

Type hinting should not accept empty values #2639

Merged

Conversation

bazsi
Copy link
Collaborator

@bazsi bazsi commented Mar 20, 2019

This is a more comprehensive fix to #2636

@bazsi bazsi force-pushed the type-hinting-shouldnot-accept-empty-values branch from 36bd006 to 1f44ec5 Compare March 20, 2019 10:26
@kira-syslogng
Copy link
Contributor

Build SUCCESS

Kokan
Kokan previously approved these changes Mar 21, 2019
@Kokan
Copy link
Collaborator

Kokan commented Mar 21, 2019

@bazsi oh actually it has a conflict (probably because of astyle PR merged). Could you please rebase ?

@furiel furiel changed the title Type hinting shouldnot accept empty values Type hinting should not accept empty values Mar 21, 2019
MrAnno
MrAnno previously approved these changes Mar 21, 2019
bazsi added 5 commits March 22, 2019 10:07
…t_eq

For boolean values, we should use cr_assert() instead of cr_assert_eq().

Signed-off-by: Balazs Scheidler <balazs.scheidler@oneidentity.com>
We actually passed garbage to the negative tests as cr_make_param_array()
didn't handle straight gchar * arrays.

Signed-off-by: Balazs Scheidler <balazs.scheidler@oneidentity.com>
Empty strings are not valid numbers, so in case they are empty, we
shouldn't accept them. One can still fall back to representing the
value as a string.

Signed-off-by: Balazs Scheidler <balazs.scheidler@oneidentity.com>
Earlier the type hinted representation of values was a bit complex,
containing a shared case in a switch statement and then a lot of
conditionals around the key of the switch.

This one breaks that one up, as I was planning to handle the "empty-value"
case here, when I found a better option of doing the same in
the type hinting code.

Nevertheless this version I consider easier to read, so albeit this
could be improved even more, I think this is worth checking in.

Signed-off-by: Balazs Scheidler <balazs.scheidler@oneidentity.com>
Signed-off-by: Balazs Scheidler <balazs.scheidler@oneidentity.com>
@bazsi bazsi dismissed stale reviews from MrAnno and Kokan via 8b1c172 March 22, 2019 09:08
@bazsi bazsi force-pushed the type-hinting-shouldnot-accept-empty-values branch from 1f44ec5 to 8b1c172 Compare March 22, 2019 09:08
@bazsi
Copy link
Collaborator Author

bazsi commented Mar 22, 2019

I have rebased this to master, no other changes. Previous approves would be appreciated.

Copy link
Collaborator

@Kokan Kokan left a comment

Choose a reason for hiding this comment

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

Thanks.

@kira-syslogng
Copy link
Contributor

Build SUCCESS

@Kokan Kokan merged commit bd42c0f into syslog-ng:master Mar 22, 2019
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.

4 participants