szaszm commented on a change in pull request #1128:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1128#discussion_r666946827
##########
File path: libminifi/test/keyvalue-tests/PersistableKeyValueStoreServiceTest.cpp
##########
@@ -33,17 +33,14 @@
static std::string config_yaml; // NOLINT
-static inline void configYamlHandler(Catch::ConfigData&, const std::string&
path) {
- config_yaml = path;
-}
-
int main(int argc, char* argv[]) {
Catch::Session session;
- auto& cli =
const_cast<Catch::Clara::CommandLine<Catch::ConfigData>&>(session.cli());
- cli["--config-yaml"]
- .describe("path to the config.yaml containing the
PersistableKeyValueStoreService controller service configuration")
- .bind(&configYamlHandler, "path");
+ const auto& const_cli = session.cli();
+ auto& cli =
const_cast<minifi::utils::remove_cvref_t<decltype(const_cli)>&>(const_cli);
Review comment:
Good point. I only read the clara docs, not the one you linked. I'll
rewrite this part to avoid this ugly `const_cast`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]