-
Notifications
You must be signed in to change notification settings - Fork 42
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
Fix env behavior to return true on empty vars #97
Conversation
Signed-off-by: Michael Carroll <michael@openrobotics.org>
34c5bb8
to
8301a26
Compare
Codecov Report
@@ Coverage Diff @@
## ign-common3 #97 +/- ##
===============================================
+ Coverage 73.94% 73.95% +0.01%
===============================================
Files 69 69
Lines 9390 9408 +18
===============================================
+ Hits 6943 6958 +15
- Misses 2447 2450 +3
Continue to review full report at Codecov.
|
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.
Due to the different behavior on Windows, it sounds like we shouldn't rely on empty env vars for any cross-platform code 😕
Besides that and the ABI issue, the rest looks good to me.
I believe that is true, but it also breaks expectations on Linux a bit if you are just checking for a value to be set rather than checking the value itself. |
Signed-off-by: Michael Carroll <michael@openrobotics.org>
Signed-off-by: Michael Carroll <michael@openrobotics.org>
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.
Code checker is angry:
./src/Util_TEST.cc:181: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4]
./src/Util.cc:342: Missing space before ( in if( [whitespace/parens] [5]
./src/Util.cc:355: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4]
./include/ignition/common/Util.hh:220: Line ends in whitespace. Consider deleting these extra spaces.
And Windows CI failed:
D:\Jenkins\workspace\ignition_common-ci-pr_any-windows7-amd64\ws\ign-common\src\Util_TEST.cc(179): error C3861: 'setenv': identifier not found
Clears up differences between platforms Signed-off-by: Michael Carroll <michael@openrobotics.org>
Signed-off-by: Michael Carroll <michael@openrobotics.org>
Signed-off-by: Michael Carroll <michael@openrobotics.org>
Signed-off-by: Michael Carroll <michael@openrobotics.org>
Signed-off-by: Michael Carroll <michael@openrobotics.org>
Empty environment variables are valid on Linux (and other posix systems), we should return
true
in those cases.Closes #96
Signed-off-by: Michael Carroll michael@openrobotics.org