-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Removed commented code answer-module also depends on boost_date-time
- Loading branch information
Rodrigo Fernandes
committed
Oct 1, 2013
1 parent
292d167
commit 02018fb
Showing
8 changed files
with
94 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
find_package(Boost COMPONENTS unit_test_framework REQUIRED QUIET) | ||
|
||
add_executable(moduleTest | ||
ModuleTest.cpp | ||
) | ||
|
||
include_directories( | ||
${Boost_INCLUDE_DIRS} | ||
) | ||
|
||
target_link_libraries(moduleTest | ||
${Boost_LIBRARIES} | ||
answer-module | ||
) | ||
|
||
add_test(module moduleTest) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#define BOOST_TEST_MODULE ModuleTest | ||
#include <boost/test/included/unit_test.hpp> | ||
|
||
#include "answer/Module.hh" | ||
|
||
using namespace std; | ||
|
||
class TestModule: public answer::Module{ | ||
public: | ||
virtual FlowStatus inFlow ( answer::Context& context ); | ||
virtual FlowStatus outFlow ( answer::Context& context ); | ||
virtual FlowStatus outFlowFault ( answer::Context& context ); | ||
}; | ||
|
||
answer::Module::FlowStatus TestModule::inFlow ( answer::Context& context ) { | ||
return OK; | ||
} | ||
|
||
answer::Module::FlowStatus TestModule::outFlow ( answer::Context& context ) { | ||
return OK; | ||
} | ||
|
||
answer::Module::FlowStatus TestModule::outFlowFault ( answer::Context& context ) { | ||
return OK; | ||
} | ||
|
||
ANSWER_REGISTER_MODULE(TestModule); | ||
|
||
BOOST_AUTO_TEST_CASE( module ) | ||
{ | ||
BOOST_CHECK(true); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
find_package(Boost COMPONENTS unit_test_framework REQUIRED QUIET) | ||
|
||
add_executable(registrationTest | ||
RegistrationTest.cpp | ||
) | ||
|
||
include_directories( | ||
${Boost_INCLUDE_DIRS} | ||
) | ||
|
||
target_link_libraries(registrationTest | ||
${Boost_LIBRARIES} | ||
answer | ||
) | ||
|
||
add_test(registration registrationTest) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#define BOOST_TEST_MODULE SerializationTest | ||
#include <boost/test/included/unit_test.hpp> | ||
|
||
//Normally this is defined in the build file, it's usually the project name | ||
#define ANSWER_SERVICE_NAME "SerializationTest" | ||
|
||
#include "answer/Operation.hh" | ||
|
||
using namespace std; | ||
|
||
class Operation{ | ||
public: | ||
int test(string X){ | ||
return X.size(); | ||
} | ||
}; | ||
|
||
ANSWER_REGISTER_OPERATION(Operation::test); | ||
|
||
BOOST_AUTO_TEST_CASE( registration ) | ||
{ | ||
list<string> operations = answer::OperationStore::Instance().operationList(); | ||
BOOST_CHECK(operations.front() == string("SerializationTest/test")); | ||
} | ||
|