In current version of FBAE, there is no test environment ==> Tests can only be made by analyzing traces in verbose mode. This is not satisfactory, especially if traces are numerous and mixed up.
Thus, a test environment must be provided.
One idea to answer to this requirement is to develop a StubSessionLayer and a StubComLayer to test one developer's XAlgoLayer, an implementation of AlgoLayer, thanks to Googletest:
StubSessionLayer::callbackDeliver(rank_t senderRank, std::string && msg) stores message in a std::vector<std::pair<rank_t, std::string>> . This vector can be analyzed by subsequent tests (see below).
StubComLayer::sendMsg(std::string && msg) stores message in a std::vector<std::string> . This vector can be analyzed by subsequent tests (see below).
Then, for each test of XAlgoLayer, with Googletest:
Set initial state of XAlgoLayer (this includes creation of StubSessionLayer and StubComLayer instances)
Create a msgString corresponding to the message we want XAlgoLayer to react to.
Call XAlgoLayer::callbackHandleMessage(msgString)
Analyze contents of vector (mentioned here above) in StubSessionLayer and in StubComLayer to check that XAlgoLayer::callbackHandleMessage() worked properly.
In current version of FBAE, there is no test environment ==> Tests can only be made by analyzing traces in verbose mode. This is not satisfactory, especially if traces are numerous and mixed up.
Thus, a test environment must be provided.
One idea to answer to this requirement is to develop a
StubSessionLayer
and aStubComLayer
to test one developer'sXAlgoLayer
, an implementation ofAlgoLayer
, thanks toGoogletest
:StubSessionLayer::callbackDeliver(rank_t senderRank, std::string && msg)
stores message in astd::vector<std::pair<rank_t, std::string>>
. This vector can be analyzed by subsequent tests (see below).StubComLayer::sendMsg(std::string && msg)
stores message in astd::vector<std::string>
. This vector can be analyzed by subsequent tests (see below).Then, for each test of
XAlgoLayer
, withGoogletest
:XAlgoLayer
(this includes creation ofStubSessionLayer
andStubComLayer
instances)msgString
corresponding to the message we wantXAlgoLayer
to react to.XAlgoLayer::callbackHandleMessage(msgString)
StubSessionLayer
and inStubComLayer
to check thatXAlgoLayer::callbackHandleMessage()
worked properly.