Commit 84ab6fa4 authored by Paolo Ambrosio's avatar Paolo Ambrosio
Browse files

Fix compiler warning about hidden virtual function definition

Alternative to hvellyr/cucumber-cpp@0e76db6
Hooks need a wider refactoring that is out of scope for this
parent 385b7533
......@@ -21,7 +21,7 @@ public:
class Hook {
public:
void setTags(const std::string &csvTagNotation);
virtual void invokeHook(Scenario *scenario);
virtual void invokeHook(Scenario *scenario, CallableStep *step);
virtual void skipHook();
virtual void body() = 0;
protected:
......@@ -49,7 +49,7 @@ class AfterHook : public Hook {
class UnconditionalHook : public Hook {
public:
virtual void invokeHook(Scenario *);
virtual void invokeHook(Scenario *scenario, CallableStep *step);
};
class BeforeAllHook : public UnconditionalHook {
......
#include <cucumber-cpp/internal/hook/HookRegistrar.hpp>
#include <cucumber-cpp/internal/CukeCommands.hpp>
namespace cucumber {
namespace internal {
void Hook::invokeHook(Scenario *scenario) {
void Hook::invokeHook(Scenario *scenario, CallableStep *) {
if (tagsMatch(scenario)) {
body();
} else {
......@@ -26,14 +25,14 @@ bool Hook::tagsMatch(Scenario *scenario) {
void AroundStepHook::invokeHook(Scenario *scenario, CallableStep *step) {
this->step = step;
Hook::invokeHook(scenario);
Hook::invokeHook(scenario, NULL);
}
void AroundStepHook::skipHook() {
step->call();
}
void UnconditionalHook::invokeHook(Scenario*) {
void UnconditionalHook::invokeHook(Scenario*, CallableStep *) {
body();
}
......@@ -68,7 +67,6 @@ InvokeResult HookRegistrar::execStepChain(Scenario *scenario, StepInfo *stepInfo
return scc.exec();
}
void HookRegistrar::addAfterStepHook(AfterStepHook *afterStepHook) {
afterStepHooks().push_front(afterStepHook);
}
......@@ -99,7 +97,7 @@ void HookRegistrar::execAfterHooks(Scenario *scenario) {
void HookRegistrar::execHooks(HookRegistrar::hook_list_type &hookList, Scenario *scenario) {
for (HookRegistrar::hook_list_type::iterator hook = hookList.begin(); hook != hookList.end(); ++hook) {
(*hook)->invokeHook(scenario);
(*hook)->invokeHook(scenario, NULL);
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment