Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/cucumber-cpp/internal/hook/HookRegistrar.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class BeforeHook : public Hook {

class AroundStepHook : public Hook {
public:
virtual void invokeHook(Scenario *scenario, CallableStep *step);
virtual void invokeHookWithStep(Scenario *scenario, CallableStep *step);
virtual void skipHook();
protected:
CallableStep *step;
Expand Down
1 change: 1 addition & 0 deletions include/cucumber-cpp/internal/hook/Tag.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class TagExpression {
public:
typedef std::vector<std::string> tag_list;

virtual ~TagExpression() { }
virtual bool matches(const tag_list &tags) = 0;
};

Expand Down
9 changes: 7 additions & 2 deletions include/cucumber-cpp/internal/step/StepManager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ class InvokeArgs {

template<class T> T getInvokeArg(size_type i) const;
const Table & getTableArg() const;

size_type argsSize() const {
return args.size();
}

private:
Table tableArg;
args_type args;
Expand Down Expand Up @@ -91,7 +96,7 @@ class InvokeResult {

bool isSuccess() const;
bool isPending() const;
const InvokeResultType getType() const;
InvokeResultType getType() const;
const std::string &getDescription() const;
};

Expand Down Expand Up @@ -157,7 +162,7 @@ class StepManager {
};


static std::string toSourceString(const char *filePath, const int line) {
static inline std::string toSourceString(const char *filePath, const int line) {
using namespace std;
stringstream s;
string file(filePath);
Expand Down
3 changes: 3 additions & 0 deletions include/cucumber-cpp/internal/utils/Regex.hpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
#ifndef CUKE_REGEX_HPP_
#define CUKE_REGEX_HPP_

#include <string>
#include <vector>

#define BOOST_REGEX_V4_CHAR_REGEX_TRAITS_HPP

#include <boost/regex.hpp>

namespace cucumber {
Expand Down
10 changes: 5 additions & 5 deletions src/CukeEngineImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@ void CukeEngineImpl::invokeStep(const std::string & id, const invoke_args_type &

if (tableArg.shape()[0] > 1 && tableArg.shape()[1] > 0) {
Table & commandTableArg = commandArgs.getVariableTableArg();
for (table_index j = 0; j < tableArg.shape()[1]; ++j) {
for (table_index j = 0; j < table_index(tableArg.shape()[1]); ++j) {
commandTableArg.addColumn(tableArg[0][j]);
}

for (table_index i = 1; i < tableArg.shape()[0]; ++i) {
for (table_index i = 1; i < table_index(tableArg.shape()[0]); ++i) {
Table::row_type row;
for (table_index j = 0; j < tableArg.shape()[1]; ++j) {
for (table_index j = 0; j < table_index(tableArg.shape()[1]); ++j) {
row.push_back(tableArg[i][j]);
}
commandTableArg.addRow(row);
Expand All @@ -87,11 +87,11 @@ void CukeEngineImpl::invokeStep(const std::string & id, const invoke_args_type &
}
}

void CukeEngineImpl::endScenario(const tags_type & tags) {
void CukeEngineImpl::endScenario(const tags_type & /*tags*/) {
cukeCommands.endScenario();
}

std::string CukeEngineImpl::snippetText(const std::string & keyword, const std::string & name, const std::string & multilineArgClass) const {
std::string CukeEngineImpl::snippetText(const std::string & keyword, const std::string & name, const std::string & /*multilineArgClass*/) const {
return cukeCommands.snippetText(keyword, name);
}

Expand Down
4 changes: 2 additions & 2 deletions src/HookRegistrar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ bool Hook::tagsMatch(Scenario *scenario) {
return !scenario || tagExpression->matches(scenario->getTags());
}

void AroundStepHook::invokeHook(Scenario *scenario, CallableStep *step) {
void AroundStepHook::invokeHookWithStep(Scenario *scenario, CallableStep *step) {
this->step = step;
Hook::invokeHook(scenario);
}
Expand Down Expand Up @@ -155,7 +155,7 @@ void StepCallChain::execNext() {
} else {
HookRegistrar::aroundhook_list_type::iterator currentHook = nextHook++;
CallableStepChain callableStepChain(this);
(*currentHook)->invokeHook(scenario, &callableStepChain);
(*currentHook)->invokeHookWithStep(scenario, &callableStepChain);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/StepManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ bool InvokeResult::isPending() const {
return (type == PENDING);
}

const InvokeResultType InvokeResult::getType() const {
InvokeResultType InvokeResult::getType() const {
return type;
}

Expand Down
5 changes: 3 additions & 2 deletions src/connectors/wire/WireProtocol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ void SnippetTextResponse::accept(WireResponseVisitor *visitor) const {

class CommandDecoder {
public:
virtual WireCommand *decode(const mValue & jsonArgs) const = 0;
virtual ~CommandDecoder() { }
virtual WireCommand *decode(const mValue & jsonArgs) const = 0;
};


Expand Down Expand Up @@ -256,7 +257,7 @@ namespace {
return write_string(v, false);
}

void visit(const SuccessResponse *response) {
void visit(const SuccessResponse* /*response*/) {
success();
}

Expand Down
2 changes: 1 addition & 1 deletion src/connectors/wire/WireProtocolCommands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ WireResponse *SnippetTextCommand::run(CukeEngine *engine) const {
}


WireResponse *FailingCommand::run(CukeEngine *engine) const {
WireResponse *FailingCommand::run(CukeEngine* /*engine*/) const {
return new FailureResponse;
}

Expand Down
4 changes: 2 additions & 2 deletions src/connectors/wire/WireServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ namespace cucumber {
namespace internal {

SocketServer::SocketServer(const ProtocolHandler *protocolHandler) :
protocolHandler(protocolHandler),
ios(),
acceptor(ios),
protocolHandler(protocolHandler) {
acceptor(ios) {
}

void SocketServer::listen(const port_type port) {
Expand Down
40 changes: 25 additions & 15 deletions src/drivers/BoostDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,18 @@ namespace internal {


namespace {

bool boost_test_init() {
#ifdef BOOST_TEST_ALTERNATIVE_INIT_API
bool boost_init_unit_test() {
return true;
}

static CukeBoostLogInterceptor *logInterceptor = 0;

}
#else
::boost::unit_test::test_suite*
boost_init_unit_test_suite(int /*argc*/, char* /*argv*/[]) {
return NULL;
}
#endif

static CukeBoostLogInterceptor *logInterceptor = 0;
}


Expand All @@ -31,19 +36,19 @@ class CukeBoostLogInterceptor : public ::boost::unit_test::unit_test_log_formatt
void reset();

// Formatter
void log_start( std::ostream&, counter_t test_cases_amount) {};
void log_start( std::ostream&, counter_t /*test_cases_amount*/) {};
void log_finish( std::ostream&) {};
void log_build_info( std::ostream&) {};

void test_unit_start( std::ostream&, test_unit const& tu) {};
void test_unit_finish( std::ostream&, test_unit const& tu, unsigned long elapsed) {};
void test_unit_skipped( std::ostream&, test_unit const& tu) {};
void test_unit_start( std::ostream&, test_unit const& /*tu*/) {};
void test_unit_finish( std::ostream&, test_unit const& /*tu*/, unsigned long /*elapsed*/) {};
void test_unit_skipped( std::ostream&, test_unit const& /*tu*/) {};

void log_exception( std::ostream&, log_checkpoint_data const&, execution_exception const& ex) {};
void log_exception( std::ostream&, log_checkpoint_data const&, execution_exception const& /*ex*/) {};

void log_entry_start( std::ostream&, log_entry_data const&, log_entry_types let) {};
void log_entry_value( std::ostream&, const_string value);
void log_entry_value( std::ostream&, lazy_ostream const& value) {};
void log_entry_start( std::ostream&, log_entry_data const&, log_entry_types /*let*/) {};
void log_entry_value( std::ostream&, const_string /*value*/);
void log_entry_value( std::ostream&, lazy_ostream const& /*value*/) {};
void log_entry_finish( std::ostream&) {};

void log_exception(std::ostream&, const boost::unit_test::log_checkpoint_data&, boost::unit_test::const_string) {};
Expand Down Expand Up @@ -83,7 +88,12 @@ void BoostStep::initBoostTest() {
if (!framework::is_initialized()) {
int argc = 2;
char *argv[] = { (char *) "", (char *) "" };
framework::init(&boost_test_init, argc, argv);

#ifdef BOOST_TEST_ALTERNATIVE_INIT_API
framework::init(&boost_init_unit_test, argc, argv);
#else
framework::init(&boost_init_unit_test_suite, argc, argv);
#endif
logInterceptor = new CukeBoostLogInterceptor;
::boost::unit_test::unit_test_log.set_formatter(logInterceptor);
::boost::unit_test::unit_test_log.set_threshold_level(log_all_errors);
Expand Down
2 changes: 1 addition & 1 deletion tests/utils/HookRegistrationFixture.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class HookRegistrarDouble : public HookRegistrar {
EmptyCallableStep emptyStep;
aroundhook_list_type &ash = aroundStepHooks();
for (HookRegistrar::aroundhook_list_type::const_iterator h = ash.begin(); h != ash.end(); ++h) {
(*h)->invokeHook(scenario, &emptyStep);
(*h)->invokeHookWithStep(scenario, &emptyStep);
}
}
};
Expand Down