Will Berkeley has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/11411 )

Change subject: [WIP] Add helper macro for tool invocations
......................................................................


Patch Set 1:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/11411/1/src/kudu/tools/kudu-admin-test.cc
File src/kudu/tools/kudu-admin-test.cc:

http://gerrit.cloudera.org:8080/#/c/11411/1/src/kudu/tools/kudu-admin-test.cc@142
PS1, Line 142: // Note the type specifier and extra parentheses. Unfortunately, 
these are
             : // necessary for the macro to parse correctly.
> Would you still need that if tool_cmd was embedded in the call to RunKuduTo
Unfortunately, no. It doesn't allow the parentheses or the 'vector<string>' to 
be dropped.

Seems it needs the parentheses because C++ requires them around initializer 
lists when the list is a macro argument.

The type specifier is more ad hoc...if I don't include it, from the compiler 
error message it seems that it splits up the initializer list into strings, e.g.

 ../../src/kudu/tools/kudu-admin-test.cc:227:5: warning: expression result 
unused [-Wunused-value]
    "tablet",
    ^~~~~~~~

 ../../src/kudu/tools/kudu-admin-test.cc:149:22: note: expanded from macro 
'ASSERT_TOOL_OK'
  const Status& _s = RunKuduTool(tool_cmd, &_out, &_err); \
                     ^~~~~~~~~~~
../../src/kudu/tools/tool_test_util.h:37:8: note: candidate function not 
viable: no known conversion from 'const char *' to 'const 
std::vector<std::string>' (aka 'const vector<basic_string<char, 
char_traits<char>, allocator<char> > >') for 1st argument
Status RunKuduTool(const std::vector<std::string>& args,
       ^



--
To view, visit http://gerrit.cloudera.org:8080/11411
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I7ffd357d79982ee5c93f8d3c7cfd7cc1f0863f07
Gerrit-Change-Number: 11411
Gerrit-PatchSet: 1
Gerrit-Owner: Will Berkeley <[email protected]>
Gerrit-Reviewer: Adar Dembo <[email protected]>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Will Berkeley <[email protected]>
Gerrit-Comment-Date: Mon, 10 Sep 2018 20:42:20 +0000
Gerrit-HasComments: Yes

Reply via email to