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

60 lines
2.3 KiB
Plaintext
Executable File

std::cout << "wfOutput:" << std::endl
<< "\tisOk: " << wfOutput.isOK.getValue() << std::endl;
if (!wfOutput.isOK.getValue()) {
std::stringstream ss;
ss << "Test Failure: isOk [" << wfOutput.isOK.getValue() << "] is not true.";
throw wfr::exception::wfr_fatal_error(ss.str());
}
#include <algorithm>
auto elemMin = std::min(wfInput.elements1Count.getValue(), wfInput.elements2Count.getValue());
if (elemMin <= 0) {
std::stringstream ss;
ss << "Test Failure: elemMin [" << elemMin << "] is not greater than zero.";
throw wfr::exception::wfr_fatal_error(ss.str());
}
if (wfOutput.elements1.getSize() != elemMin) {
#include <sstream>
std::stringstream ss;
ss << "Test Failure: elements1 collection size [" << wfOutput.elements1.getSize() << "] is not equal elemMin [" << elemMin << "].";
throw wfr::exception::wfr_fatal_error(ss.str());
}
std::cout << "\telements1: [ ";
bool isFirst = true;
for (wfr_id_t t = 0; t < wfOutput.elements1.getSize(); t++) {
if (wfOutput.elements1.getEntryValue(t) != t+1) {
#include <sstream>
std::stringstream ss;
ss << "Test Failure: elements1 collection value index [" << t << "] does not have correct value [" << wfOutput.elements1.getEntryValue(t)<< "].";
throw wfr::exception::wfr_fatal_error(ss.str());
}
if (isFirst) {
isFirst = false;
} else {
std::cout << ", ";
}
std::cout << wfOutput.elements1.getEntryValue(t);
}
std::cout << " ]" << std::endl;
if (wfOutput.elements2.getSize() != elemMin) {
#include <sstream>
std::stringstream ss;
ss << "Test Failure: elements2 collection size [" << wfOutput.elements2.getSize() << "] is not equal elemMin [" << elemMin << "].";
throw wfr::exception::wfr_fatal_error(ss.str());
}
std::cout << "\telements2: [ ";
isFirst = true;
for (wfr_id_t t = 0; t < wfOutput.elements2.getSize(); t++) {
if (wfOutput.elements2.getEntryValue(t) != t+1) {
#include <sstream>
std::stringstream ss;
ss << "Test Failure: elements2 collection value index [" << t << "] does not have correct value [" << wfOutput.elements2.getEntryValue(t)<< "].";
throw wfr::exception::wfr_fatal_error(ss.str());
}
if (isFirst) {
isFirst = false;
} else {
std::cout << ", ";
}
std::cout << wfOutput.elements2.getEntryValue(t);
}
std::cout << " ]" << std::endl;