Files
2017-04-11 15:49:55 +02:00

42 lines
2.4 KiB
Plaintext
Executable File

auto myiter = WFR_SELF_GETITERATIONID();
std::cout << "AtomicActivity1 [" << myiter << "]:" << std::endl
<< "\telements1Count: " << sin->elements1Count.getValue() << std::endl
<< "\telement1in: " << sin->element1in.getValue() << std::endl
<< "\tloopPort1: " << sin->loopPort1.getValue() << std::endl
<< "\telements2Count: " << sin->elements2Count.getValue() << std::endl
<< "\telement2in: " << sin->element2in.getValue() << std::endl
<< "\tloopPort2: " << sin->loopPort2.getValue() << std::endl;
#include <sstream>
if (myiter == 0 && sin->elements1Count.getValue() != sin->loopPort1.getValue()) {
std::stringstream ss;
ss << "Test Failure: loopPort1 value [" << sin->loopPort1.getValue() << "] is not equal telements1Count [" << sin->elements1Count.getValue() << "] during first iteration.";
throw wfr::exception::wfr_fatal_error(ss.str());
}
if (myiter > 0 && myiter != sin->loopPort1.getValue()) {
std::stringstream ss;
ss << "Test Failure: loopPort1 value [" << sin->loopPort1.getValue() << "] is not equal myiter [" << myiter << "] during subsequent iteration.";
throw wfr::exception::wfr_fatal_error(ss.str());
}
if (myiter == 0 && sin->elements2Count.getValue() != sin->loopPort2.getValue()) {
std::stringstream ss;
ss << "Test Failure: loopPort2 value [" << sin->loopPort2.getValue() << "] is not equal telements2Count [" << sin->elements2Count.getValue() << "] during first iteration.";
throw wfr::exception::wfr_fatal_error(ss.str());
}
if (myiter > 0 && myiter != sin->loopPort2.getValue()) {
std::stringstream ss;
ss << "Test Failure: loopPort2 value [" << sin->loopPort2.getValue() << "] is not equal myiter [" << myiter << "] during subsequent iteration.";
throw wfr::exception::wfr_fatal_error(ss.str());
}
if ( myiter+1 != sin->element1in.getValue()) {
std::stringstream ss;
ss << "Test Failure: element1in value [" << sin->element1in.getValue() << "] is not equal myiter+1 [" << myiter+1 << "].";
throw wfr::exception::wfr_fatal_error(ss.str());
}
if ( myiter+1 != sin->element2in.getValue()) {
std::stringstream ss;
ss << "Test Failure: element2in value [" << sin->element2in.getValue() << "] is not equal myiter+1 [" << myiter+1 << "].";
throw wfr::exception::wfr_fatal_error(ss.str());
}
sout->element1.setValue(sin->element1in.getValue());
sout->element2.setValue(sin->element2in.getValue());
sout->isOk.setValue(true);