Moved deprecated files/folders to temp-folder, FI-stuff removed, cleaned up aspect (file-)names and code (-> coding-style).

git-svn-id: https://www4.informatik.uni-erlangen.de/i4svn/danceos/trunk/devel/fail@1320 8c4709b5-6ec9-48aa-a5cd-a96041d1645a
This commit is contained in:
adrian
2012-06-07 18:57:26 +00:00
parent b7d904140e
commit d474a5b952
119 changed files with 110 additions and 55385 deletions

View File

@ -0,0 +1,62 @@
#include "jobserver/JobServer.hpp"
#include <iostream>
#include "experiments/AnExperiment.hpp"
#include <boost/thread.hpp>
fail::JobServer js;
using namespace std;
static const int nums = 30;
void exec_js(){
js.waitForConnections();
cout << "That's it.." << endl;
}
int main(int argc, char**argv){
cout << "Testing Jobserver" << endl;
boost::thread th(exec_js);
AnExperimentData* datas[nums];
for(int i = 1; i <= nums; i++){
datas[i] = new AnExperimentData;
datas[i]->setInput(i);
js.addExperiment(datas[i]);
usleep(100 * 1000); // 100 ms
}
js.setNoMoreExperiments();
// test results.
int f;
int res = 0;
int res2 = 0;
AnExperimentData * exp;
for(int i = 1; i <= nums; i++){
exp = static_cast<AnExperimentData*>( js.m_doneJobs.Dequeue() );
f = exp->getOutput();
// 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, waiting for server thread. " << endl;
js.done();
th.join();
return 0;
}