"failstar" sounds like a name for a cruise liner from the 80s. As "*" isn't a desirable part of directory names, just name the whole thing "fail/", the core parts being stored in "fail/core/". Additionally fixing two build system dependency issues: - missing jobserver -> protomessages dependency - broken bochs -> fail dependency (add_custom_target DEPENDS only allows plain file dependencies ... cmake for the win) git-svn-id: https://www4.informatik.uni-erlangen.de/i4svn/danceos/trunk/devel/fail@956 8c4709b5-6ec9-48aa-a5cd-a96041d1645a
43 lines
1.1 KiB
C++
43 lines
1.1 KiB
C++
#include "MHTestCampaign.hpp"
|
|
#include <controller/CampaignManager.hpp>
|
|
#include <iostream>
|
|
|
|
using namespace fi;
|
|
|
|
|
|
bool MHTestCampaign::run()
|
|
{
|
|
|
|
MHExperimentData* datas[m_parameter_count];
|
|
cout << "[MHTestCampaign] Adding " << m_parameter_count << " values." << endl;
|
|
for(int i = 1; i <= m_parameter_count; i++){
|
|
datas[i] = new MHExperimentData;
|
|
datas[i]->msg.set_input(i);
|
|
|
|
campaignmanager.addParam(datas[i]);
|
|
usleep(100 * 1000); // 100 ms
|
|
}
|
|
campaignmanager.noMoreParameters();
|
|
// test results.
|
|
int f;
|
|
int res = 0;
|
|
int res2 = 0;
|
|
MHExperimentData * exp;
|
|
for(int i = 1; i <= m_parameter_count; i++){
|
|
exp = static_cast<MHExperimentData*>( campaignmanager.getDone() );
|
|
f = exp->msg.output();
|
|
// cout << ">>>>>>>>>>>>>>> Output: " << i << "^2 = " << f << endl;
|
|
res += f;
|
|
res2 += (i*i);
|
|
delete exp;
|
|
}
|
|
if (res == res2) {
|
|
cout << "TEST SUCCESSFUL FINISHED! " << "[" << res << "==" << res2 << "]" << endl;
|
|
}else{
|
|
cout << "TEST FAILED!" << " [" << res << "!=" << res2 << "]" << endl;
|
|
}
|
|
cout << "thats all... " << endl;
|
|
|
|
return true;
|
|
}
|