tools/tests: fix compilation errors caused by bind and placeholders
refs #2175
Change-Id: I65eadb0d0ccf468c3d478236335dbf09aa4dcc71
diff --git a/tests/daemon/mgmt/strategy-choice-manager.cpp b/tests/daemon/mgmt/strategy-choice-manager.cpp
index f8af3bb..2ae23c5 100644
--- a/tests/daemon/mgmt/strategy-choice-manager.cpp
+++ b/tests/daemon/mgmt/strategy-choice-manager.cpp
@@ -225,9 +225,9 @@
{
shared_ptr<Interest> command(make_shared<Interest>("/localhost/nfd/strategy-choice"));
- getFace()->onReceiveData +=
- bind(&StrategyChoiceManagerFixture::validateControlResponse, this, _1,
- command->getName(), 400, "Malformed command");
+ getFace()->onReceiveData += [this, command] (const Data& response) {
+ this->validateControlResponse(response, command->getName(), 400, "Malformed command");
+ };
getFace()->sendInterest(*command);
g_io.run_one();
@@ -239,9 +239,9 @@
{
shared_ptr<Interest> command(make_shared<Interest>("/localhost/nfd/strategy-choice"));
- getFace()->onReceiveData +=
- bind(&StrategyChoiceManagerFixture::validateControlResponse, this, _1,
- command->getName(), 400, "Malformed command");
+ getFace()->onReceiveData += [this, command] (const Data& response) {
+ this->validateControlResponse(response, command->getName(), 400, "Malformed command");
+ };
getManager().onStrategyChoiceRequest(*command);
@@ -262,9 +262,9 @@
shared_ptr<Interest> command(make_shared<Interest>(commandName));
- getFace()->onReceiveData +=
- bind(&StrategyChoiceManagerFixture::validateControlResponse, this, _1,
- command->getName(), 401, "Signature required");
+ getFace()->onReceiveData += [this, command] (const Data& response) {
+ this->validateControlResponse(response, command->getName(), 401, "Signature required");
+ };
getManager().onStrategyChoiceRequest(*command);
@@ -287,9 +287,9 @@
shared_ptr<Interest> command(make_shared<Interest>(commandName));
generateCommand(*command);
- getFace()->onReceiveData +=
- bind(&StrategyChoiceManagerFixture::validateControlResponse, this, _1,
- command->getName(), 403, "Unauthorized command");
+ getFace()->onReceiveData += [this, command] (const Data& response) {
+ this->validateControlResponse(response, command->getName(), 403, "Unauthorized command");
+ };
getManager().onStrategyChoiceRequest(*command);
@@ -311,9 +311,9 @@
shared_ptr<Interest> command(make_shared<Interest>(commandName));
generateCommand(*command);
- getFace()->onReceiveData +=
- bind(&StrategyChoiceManagerFixture::validateControlResponse, this, _1,
- command->getName(), 501, "Unsupported command");
+ getFace()->onReceiveData += [this, command] (const Data& response) {
+ this->validateControlResponse(response, command->getName(), 501, "Unsupported command");
+ };
getManager().onValidatedStrategyChoiceRequest(command);
@@ -329,9 +329,9 @@
shared_ptr<Interest> command(make_shared<Interest>(commandName));
generateCommand(*command);
- getFace()->onReceiveData +=
- bind(&StrategyChoiceManagerFixture::validateControlResponse, this, _1,
- command->getName(), 400, "Malformed command");
+ getFace()->onReceiveData += [this, command] (const Data& response) {
+ this->validateControlResponse(response, command->getName(), 400, "Malformed command");
+ };
getManager().onValidatedStrategyChoiceRequest(command);
@@ -352,9 +352,10 @@
shared_ptr<Interest> command(make_shared<Interest>(commandName));
- getFace()->onReceiveData +=
- bind(&StrategyChoiceManagerFixture::validateControlResponse, this, _1,
- command->getName(), 200, "Success", encodedParameters);
+ getFace()->onReceiveData += [this, command, encodedParameters] (const Data& response) {
+ this->validateControlResponse(response, command->getName(),
+ 200, "Success", encodedParameters);
+ };
getManager().onValidatedStrategyChoiceRequest(command);
@@ -377,9 +378,10 @@
shared_ptr<Interest> command(make_shared<Interest>(commandName));
- getFace()->onReceiveData +=
- bind(&StrategyChoiceManagerFixture::validateControlResponse, this, _1,
- command->getName(), 200, "Success", encodedParameters);
+ getFace()->onReceiveData += [this, command, encodedParameters] (const Data& response) {
+ this->validateControlResponse(response, command->getName(),
+ 200, "Success", encodedParameters);
+ };
getManager().onValidatedStrategyChoiceRequest(command);
@@ -406,9 +408,10 @@
responseParameters.setName("/test");
responseParameters.setStrategy("/localhost/nfd/strategy/test-strategy-c/%FD%02");
- getFace()->onReceiveData +=
- bind(&StrategyChoiceManagerFixture::validateControlResponse, this, _1,
- command->getName(), 200, "Success", responseParameters.wireEncode());
+ getFace()->onReceiveData += [this, command, responseParameters] (const Data& response) {
+ this->validateControlResponse(response, command->getName(),
+ 200, "Success", responseParameters.wireEncode());
+ };
getManager().onValidatedStrategyChoiceRequest(command);
@@ -430,9 +433,9 @@
shared_ptr<Interest> command(make_shared<Interest>(commandName));
- getFace()->onReceiveData +=
- bind(&StrategyChoiceManagerFixture::validateControlResponse, this, _1,
- command->getName(), 400, "Malformed command");
+ getFace()->onReceiveData += [this, command] (const Data& response) {
+ this->validateControlResponse(response, command->getName(), 400, "Malformed command");
+ };
getManager().onValidatedStrategyChoiceRequest(command);
@@ -452,9 +455,9 @@
shared_ptr<Interest> command(make_shared<Interest>(commandName));
- getFace()->onReceiveData +=
- bind(&StrategyChoiceManagerFixture::validateControlResponse, this, _1,
- command->getName(), 400, "Malformed command");
+ getFace()->onReceiveData += [this, command] (const Data& response) {
+ this->validateControlResponse(response, command->getName(), 400, "Malformed command");
+ };
getManager().onValidatedStrategyChoiceRequest(command);
@@ -478,9 +481,9 @@
shared_ptr<Interest> command(make_shared<Interest>(commandName));
generateCommand(*command);
- getFace()->onReceiveData +=
- bind(&StrategyChoiceManagerFixture::validateControlResponse, this, _1,
- command->getName(), 504, "Unsupported strategy");
+ getFace()->onReceiveData += [this, command] (const Data& response) {
+ this->validateControlResponse(response, command->getName(), 504, "Unsupported strategy");
+ };
getManager().onValidatedStrategyChoiceRequest(command);
@@ -552,9 +555,10 @@
shared_ptr<Interest> command(make_shared<Interest>(commandName));
generateCommand(*command);
- getFace()->onReceiveData +=
- bind(&StrategyChoiceManagerFixture::validateControlResponse, this, _1,
- command->getName(), 200, "Success", encodedParameters);
+ getFace()->onReceiveData += [this, command, encodedParameters] (const Data& response) {
+ this->validateControlResponse(response, command->getName(),
+ 200, "Success", encodedParameters);
+ };
getManager().onValidatedStrategyChoiceRequest(command);
@@ -578,9 +582,10 @@
shared_ptr<Interest> command(make_shared<Interest>(commandName));
generateCommand(*command);
- getFace()->onReceiveData +=
- bind(&StrategyChoiceManagerFixture::validateControlResponse, this, _1,
- command->getName(), 403, "Cannot unset root prefix strategy");
+ getFace()->onReceiveData += [this, command] (const Data& response) {
+ this->validateControlResponse(response, command->getName(),
+ 403, "Cannot unset root prefix strategy");
+ };
getManager().onValidatedStrategyChoiceRequest(command);
@@ -607,9 +612,9 @@
shared_ptr<Interest> command(make_shared<Interest>(commandName));
generateCommand(*command);
- getFace()->onReceiveData +=
- bind(&StrategyChoiceManagerFixture::validateControlResponse, this, _1,
- command->getName(), 400, "Malformed command");
+ getFace()->onReceiveData += [this, command] (const Data& response) {
+ this->validateControlResponse(response, command->getName(), 400, "Malformed command");
+ };
getManager().onValidatedStrategyChoiceRequest(command);