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
[Review] Request from 'schubi2' @ 'yast/yast-inetd/review_140929_checking_nil' #11
Conversation
@@ -1,4 +1,11 @@ | |||
------------------------------------------------------------------- | |||
Mon Sep 29 10:51:23 CEST 2014 - schubi@suse.de | |||
|
|||
- Checking nil server in GetServerBasename. |
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.
REQ: The changelog entry is IMO not understandable
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.
Yes, you are right.
REQ: Test case is missing, see https://github.com/yast/yast.github.io/blob/master/doc/code-review.md#code-review-rules |
I have added a test case. |
result = server_args.dup if server_args | ||
else | ||
result = server.dup if server | ||
end |
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.
NP: well, if you have now testsuite I think it is time to make method little bit more obvious what it do like:
def GetServerBasename(server, server_args)
arg = server == TCPD_BINARY ? server_args : server
return nil unless arg
arg = arg.dup # do we really modify arg???
server_path = result.strip.split(/[ \t]/).first
return server_path if server_path.empty?
File.basename(server_path)
end
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.
Nice ! I have added. Thanks !
|
||
result | ||
server_path = result.strip.split(/[ \t]/).first |
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.
typo, it should be arg.strip
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.
btw test should show it to you ;)
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.
* marvel * Yes, the testcase should crash here...
I'm sorry for being quite picky, but I'm still missing simple test for
Yes, it's a big test, I know, but tests the API and the change you are doing in GMC phase |
Lukas, yes you are right. That's also the reason why the typo described above has not been found. |
I have added these testcases AND I have found an additional bug :-) |
|
||
context "GetServerBasename: return basename of the real server" do | ||
context "server binary is tcpd" do | ||
let(:tcpd_name) { "/usr/sbin/tcpd" } |
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.
NTH: one empty line (separate let
and context
)
LGTM |
@schubi2 Will you merge it and close the bug? |
I have moved to review_140929_checking_nil_SLE-12-GA which is based on SLE-12-GA branch |
Please review the following changes: