示例#1
0
static void test(int step) {
    if (test_sync_trivial) {        
        test_sync_trivial_run(step);
    }
    if (test_write_) {
        test_write(512);
    }
    if (test_leak_malloc) {
        leak_malloc(SLICE, step);
    }
    if (test_leak_calloc) {
        leak_calloc(SLICE, step);
    }
    if (test_leak_realloc) {
        leak_realloc(SLICE, step);
    }
    if (test_sync) {
        test_sync_step(step);
    }
    if (test_dl_) {
        test_dl(step);
    }
    if (test_pi) {
        int num_steps = 1000000;
        printf("Calculating PI (%d steps)...\n", num_steps);
        calc_pi(num_steps);
    }
}
示例#2
0
文件: api.c 项目: dgibson/ccan
int main(void)
{
	plan_tests(89);

	test_lcs();
	test_lev();
	test_rdl();
	test_dl();

	/* Unsupported edit distance measure */
	enum ed_measure badmeasure = (enum ed_measure)-1;
	ok1(edit_distance("ab", 2, "ba", 2, badmeasure) == (ed_dist)-1);

	return exit_status();
}