void BaseTest::run( int start_from ) { int test_case_idx, count = get_test_case_count(); int64 t_start = cvGetTickCount(); double freq = cv::getTickFrequency(); bool ff = can_do_fast_forward(); int progress = 0, code; int64 t1 = t_start; for( test_case_idx = ff && start_from >= 0 ? start_from : 0; count < 0 || test_case_idx < count; test_case_idx++ ) { ts->update_context( this, test_case_idx, ff ); progress = update_progress( progress, test_case_idx, count, (double)(t1 - t_start)/(freq*1000) ); code = prepare_test_case( test_case_idx ); if( code < 0 || ts->get_err_code() < 0 ) return; if( code == 0 ) continue; run_func(); if( ts->get_err_code() < 0 ) return; if( validate_test_results( test_case_idx ) < 0 || ts->get_err_code() < 0 ) return; } }
int main() { adj_table adj = prepare_test_case(); adj_table::TopologicalOrderContainer order; adj.topological_sort(order); const size_t from = 0, to = 1; printf("%u path(s) from %u to %u.\n", count_paths(adj, order, from, to), from, to); }
int CV_SLMLTest::run_test_case( int testCaseIdx ) { int code = CvTS::OK; code = prepare_test_case( testCaseIdx ); if( code == CvTS::OK ) { data.mix_train_and_test_idx(); code = train( testCaseIdx ); if( code == CvTS::OK ) { get_error( testCaseIdx, CV_TEST_ERROR, &test_resps1 ); save( tmpnam( fname1 ) ); load( fname1); get_error( testCaseIdx, CV_TEST_ERROR, &test_resps2 ); save( tmpnam( fname2 ) ); } else ts->printf( CvTS::LOG, "model can not be trained" ); } return code; }
int main() { adj_table adj = prepare_test_case(); dfs(adj); }