コード例 #1
0
int test_main(int, char *[]) {
   clock_t start = clock();

   std::ofstream file("test_actual.txt");
   BOOST_CHECK(file.is_open());
   test_scheduler(file);
   test_schedule(file);
   file.close();

   BOOST_CHECK(files_match("test_expected.txt", "test_actual.txt"));

   std::cout << "Run time: " << static_cast<double>( clock() - start ) / CLOCKS_PER_SEC << " seconds" << std::endl;
   return 0;
}
コード例 #2
0
int main(void)
{	
	mutex_init(&m);	
	int i;
	for (i=0;i<100;i++)
	{
		if (test_scheduler()==-1)
		{
			printf("%s\n","Failed");
			return 0;
		}
		printf("Iteration: %d\n",i);
	}
	printf("%s\n","Success!");
}
コード例 #3
0
ファイル: suspend_pool_external.cpp プロジェクト: hapoo/hpx
int main(int argc, char* argv[])
{
    std::vector<hpx::resource::scheduling_policy> schedulers =
        {
            hpx::resource::scheduling_policy::local,
            hpx::resource::scheduling_policy::local_priority_fifo,
            hpx::resource::scheduling_policy::local_priority_lifo,
            hpx::resource::scheduling_policy::abp_priority_fifo,
            hpx::resource::scheduling_policy::abp_priority_lifo,
            hpx::resource::scheduling_policy::static_,
            hpx::resource::scheduling_policy::static_priority
        };

    for (auto const scheduler : schedulers)
    {
        test_scheduler(argc, argv, scheduler);
    }

    return hpx::util::report_errors();
}
コード例 #4
0
ファイル: sched_test.c プロジェクト: StratifyLabs/PosixTest
int sched_test(){

	if ( test_min_max(sched_get_priority_max, "sched_get_priority_max") < 0 ){
		printf("sched_get_priority_max() test failed\n");
		return -1;
	}

	if ( test_min_max(sched_get_priority_min, "sched_get_priority_min") < 0 ){
		printf("sched_get_priority_max() test failed\n");
		return -1;
	}


	if ( test_schedparam() < 0 ){
		printf("sched_get_priority_max() test failed\n");
		return -1;
	}

	if ( test_scheduler() < 0 ){
		printf("sched_get_priority_max() test failed\n");
		return -1;
	}

	if ( sched_yield() < 0 ){
		perror("failed to yield");
		return -1;
	}

	if ( test_rr_interval() < 0 ){
		printf("sched_get_priority_max() test failed\n");
		return -1;
	}


	return 0;
}