- Pretty-indenting code
git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@674 3ecf2c5c-341e-0410-92b4-d18e462d057c
This commit is contained in:
parent
7aecc910ba
commit
6b27a8461b
94 changed files with 3073 additions and 3066 deletions
|
@ -39,88 +39,93 @@
|
|||
// FIXME: Eeeeh? Why does this work without explicit namespace resolving?
|
||||
// Is there some using declaration in included HEADERS?? Aaaaagh!
|
||||
|
||||
class TestPythonPolicyManager : public PythonPolicyManager {
|
||||
class TestPythonPolicyManager : public PythonPolicyManager
|
||||
{
|
||||
public:
|
||||
void test_init(const char* policy_name) {
|
||||
void test_init(const char* policy_name)
|
||||
{
|
||||
init();
|
||||
_python_policy = new PythonPolicy(policy_name);
|
||||
|
||||
|
||||
}
|
||||
|
||||
Policy& get_policy() {
|
||||
Policy& get_policy()
|
||||
{
|
||||
return *_python_policy;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
int
|
||||
main(int argc, char** argv) {
|
||||
using namespace sgpem;
|
||||
using namespace std;
|
||||
main(int argc, char** argv)
|
||||
{
|
||||
using namespace sgpem;
|
||||
using namespace std;
|
||||
|
||||
int successes = 0;
|
||||
int successes = 0;
|
||||
|
||||
if(argc != 2) {
|
||||
std::cout << "[EE] Usage:\n\t" << argv[0] <<
|
||||
" path/to/uninstalled/policies" << std::endl;
|
||||
exit(-1);
|
||||
}
|
||||
else
|
||||
// Add argv[1] as the directory to search for uninstalled policies
|
||||
sgpem::GlobalPreferences::get_instance().add_policies_dir(argv[1]);
|
||||
if(argc != 2)
|
||||
{
|
||||
std::cout << "[EE] Usage:\n\t" << argv[0] <<
|
||||
" path/to/uninstalled/policies" << std::endl;
|
||||
exit(-1);
|
||||
}
|
||||
else
|
||||
// Add argv[1] as the directory to search for uninstalled policies
|
||||
sgpem::GlobalPreferences::get_instance().add_policies_dir(argv[1]);
|
||||
|
||||
// Self-register itself to Scheduler, however we don't care about it
|
||||
TestPythonPolicyManager polman;
|
||||
// Self-register itself to Scheduler, however we don't care about it
|
||||
TestPythonPolicyManager polman;
|
||||
|
||||
try
|
||||
{
|
||||
polman.test_init("python_loader_configure");
|
||||
polman.get_policy().configure();
|
||||
}
|
||||
catch(UserInterruptException e)
|
||||
{
|
||||
cout << "configure: Caught UserInterruptException" << endl;
|
||||
successes++;
|
||||
}
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
polman.test_init("python_loader_is_preemptive");
|
||||
polman.get_policy().is_pre_emptive();
|
||||
}
|
||||
catch(UserInterruptException e)
|
||||
{
|
||||
cout << "is_preemptive: Caught UserInterruptException" << endl;
|
||||
successes++;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
polman.test_init("python_loader_get_time_slice");
|
||||
polman.get_policy().get_time_slice();
|
||||
}
|
||||
catch(UserInterruptException e)
|
||||
{
|
||||
cout << "get_time_slice: Caught UserInterruptException" << endl;
|
||||
successes++;
|
||||
}
|
||||
try
|
||||
{
|
||||
polman.test_init("python_loader_configure");
|
||||
polman.get_policy().configure();
|
||||
}
|
||||
catch(UserInterruptException e)
|
||||
{
|
||||
cout << "configure: Caught UserInterruptException" << endl;
|
||||
successes++;
|
||||
}
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
SchedulableQueue sl;
|
||||
polman.test_init("python_loader_sort_queue");
|
||||
polman.get_policy().sort_queue();
|
||||
}
|
||||
catch(UserInterruptException e)
|
||||
{
|
||||
cout << "sort_queue: Caught UserInterruptException" << endl;
|
||||
successes++;
|
||||
}
|
||||
try
|
||||
{
|
||||
polman.test_init("python_loader_is_preemptive");
|
||||
polman.get_policy().is_pre_emptive();
|
||||
}
|
||||
catch(UserInterruptException e)
|
||||
{
|
||||
cout << "is_preemptive: Caught UserInterruptException" << endl;
|
||||
successes++;
|
||||
}
|
||||
|
||||
cout << "Result: catched " << successes
|
||||
<< " exceptions out of 4." << endl;
|
||||
try
|
||||
{
|
||||
polman.test_init("python_loader_get_time_slice");
|
||||
polman.get_policy().get_time_slice();
|
||||
}
|
||||
catch(UserInterruptException e)
|
||||
{
|
||||
cout << "get_time_slice: Caught UserInterruptException" << endl;
|
||||
successes++;
|
||||
}
|
||||
|
||||
exit(0);
|
||||
|
||||
try
|
||||
{
|
||||
SchedulableQueue sl;
|
||||
polman.test_init("python_loader_sort_queue");
|
||||
polman.get_policy().sort_queue();
|
||||
}
|
||||
catch(UserInterruptException e)
|
||||
{
|
||||
cout << "sort_queue: Caught UserInterruptException" << endl;
|
||||
successes++;
|
||||
}
|
||||
|
||||
cout << "Result: catched " << successes
|
||||
<< " exceptions out of 4." << endl;
|
||||
|
||||
exit(0);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue