int main(int argc, char **argv)
{
	struct section_fixture sfix;
	struct ptunit_suite suite;

	sfix.init = sfix_init;
	sfix.fini = sfix_fini;

	suite = ptunit_mk_suite(argc, argv);

	ptu_run_f(suite, init, sfix);

	ptu_run(suite, begin_null);
	ptu_run(suite, end_null);
	ptu_run(suite, end_bad);

	ptu_run_f(suite, begin, sfix);
	ptu_run_f(suite, end, sfix);

	ptu_run(suite, asid_null);
	ptu_run(suite, asid);

	ptu_run_f(suite, read, sfix);
	ptu_run_f(suite, read_default_asid, sfix);
	ptu_run_f(suite, read_offset, sfix);
	ptu_run_f(suite, read_truncated, sfix);
	ptu_run_f(suite, read_nomem_vaddr, sfix);
	ptu_run_f(suite, read_nomem_asid, sfix);

	ptunit_report(&suite);
	return suite.nr_fails;
}
int main(int argc, char **argv)
{
	struct test_fixture tfix;
	struct ptunit_suite suite;

	tfix.init = tfix_init;
	tfix.fini = NULL;

	suite = ptunit_mk_suite(argc, argv);

	ptu_run(suite, encoder_init_null);
	ptu_run(suite, encoder_fini_null);
	ptu_run(suite, alloc_encoder_null);
	ptu_run(suite, free_encoder_null);

	ptu_run(suite, sync_set_null);
	ptu_run_f(suite, sync_set_eos, tfix);

	ptu_run(suite, get_offset_null);
	ptu_run_f(suite, get_offset_init, tfix);
	ptu_run_f(suite, sync_set_get_offset, tfix);

	ptu_run(suite, get_config_null);
	ptu_run_f(suite, get_config, tfix);

	ptu_run(suite, next_null);

	return ptunit_report(&suite);
}
int main(int argc, char **argv)
{
	struct image_fixture dfix, ifix, rfix;
	struct ptunit_suite suite;

	/* Dfix provides image destruction. */
	dfix.init = NULL;
	dfix.fini = dfix_fini;

	/* Ifix provides an empty image. */
	ifix.init = ifix_init;
	ifix.fini = ifix_fini;

	/* Rfix provides an image with two sections added. */
	rfix.init = rfix_init;
	rfix.fini = ifix_fini;

	suite = ptunit_mk_suite(argc, argv);

	ptu_run(suite, init);
	ptu_run_f(suite, init_name, dfix);
	ptu_run(suite, init_null);

	ptu_run(suite, fini);
	ptu_run(suite, fini_empty);
	ptu_run(suite, fini_null);

	ptu_run_f(suite, name, dfix);
	ptu_run(suite, name_none);
	ptu_run(suite, name_null);

	ptu_run_f(suite, read_empty, ifix);
	ptu_run_f(suite, overlap, ifix);
	ptu_run_f(suite, adjacent, ifix);

	ptu_run_f(suite, read, rfix);
	ptu_run_f(suite, read_asid, ifix);
	ptu_run_f(suite, read_bad_asid, rfix);
	ptu_run_f(suite, read_null_asid, rfix);
	ptu_run_f(suite, read_callback, rfix);
	ptu_run_f(suite, read_nomem, rfix);
	ptu_run_f(suite, read_truncated, rfix);

	ptu_run_f(suite, remove_section, rfix);
	ptu_run_f(suite, remove_bad_vaddr, rfix);
	ptu_run_f(suite, remove_bad_asid, rfix);
	ptu_run_f(suite, remove_by_filename, rfix);
	ptu_run_f(suite, remove_by_filename_bad_asid, rfix);
	ptu_run_f(suite, remove_none_by_filename, rfix);
	ptu_run_f(suite, remove_all_by_filename, ifix);
	ptu_run_f(suite, remove_by_asid, rfix);

	ptu_run_f(suite, copy_empty, ifix);
	ptu_run_f(suite, copy, rfix);
	ptu_run_f(suite, copy_duplicate, rfix);
	ptu_run_f(suite, copy_self, rfix);

	ptunit_report(&suite);
	return suite.nr_fails;
}
int main(int argc, char **argv)
{
	struct section_fixture sfix;
	struct ptunit_suite suite;

	sfix.init = sfix_init;
	sfix.fini = sfix_fini;

	suite = ptunit_mk_suite(argc, argv);

	ptu_run_f(suite, create, sfix);
	ptu_run_f(suite, create_bad_offset, sfix);
	ptu_run_f(suite, create_truncated, sfix);
	ptu_run_f(suite, create_empty, sfix);

	ptu_run(suite, filename_null);
	ptu_run(suite, size_null);
	ptu_run(suite, get_null);
	ptu_run(suite, put_null);
	ptu_run(suite, map_null);
	ptu_run(suite, unmap_null);

	ptu_run_f(suite, get_overflow, sfix);
	ptu_run_f(suite, map_change, sfix);
	ptu_run_f(suite, map_put, sfix);
	ptu_run_f(suite, unmap_nomap, sfix);
	ptu_run_f(suite, map_overflow, sfix);
	ptu_run_f(suite, get_put, sfix);
	ptu_run_f(suite, map_unmap, sfix);
	ptu_run_f(suite, read, sfix);
	ptu_run_f(suite, read_offset, sfix);
	ptu_run_f(suite, read_truncated, sfix);
	ptu_run_f(suite, read_from_truncated, sfix);
	ptu_run_f(suite, read_nomem, sfix);
	ptu_run_f(suite, read_overflow, sfix);
	ptu_run_f(suite, read_overflow_32bit, sfix);
	ptu_run_f(suite, read_nomap, sfix);
	ptu_run_f(suite, read_unmap_map, sfix);
	ptu_run_f(suite, stress, sfix);

	ptunit_report(&suite);
	return suite.nr_fails;
}
int main(int argc, char **argv)
{
	struct ptunit_suite suite;

	pt_ild_init();

	suite = ptunit_mk_suite(argc, argv);

	ptu_run(suite, push);
	ptu_run(suite, jmp_rel);
	ptu_run(suite, long_nop);
	ptu_run(suite, mov_al_64);
	ptu_run(suite, mov_al_32);
	ptu_run(suite, mov_al_32_em64);
	ptu_run(suite, mov_al_32_em16);
	ptu_run(suite, mov_al_16_em32);
	ptu_run(suite, mov_al_16);
	ptu_run(suite, rdtsc);
	ptu_run(suite, pcmpistri);
	ptu_run(suite, vmovdqa);
	ptu_run(suite, vpandn);
	ptu_run(suite, syscall);
	ptu_run(suite, sysret);
	ptu_run(suite, sysenter);
	ptu_run(suite, sysexit);
	ptu_run(suite, int3);
	ptu_run(suite, intn);
	ptu_run(suite, iret);
	ptu_run(suite, call_9a_cd);
	ptu_run(suite, call_9a_cp);
	ptu_run(suite, call_ff_3);
	ptu_run(suite, jmp_ff_5);
	ptu_run(suite, jmp_ea_cd);
	ptu_run(suite, jmp_ea_cp);
	ptu_run(suite, ret_ca);
	ptu_run(suite, vmlaunch);
	ptu_run(suite, vmresume);
	ptu_run(suite, vmcall);
	ptu_run(suite, vmptrld);
	ptu_run(suite, jrcxz);
	ptu_run(suite, mov_eax_moffs64);
	ptu_run(suite, mov_eax_moffs64_32);
	ptu_run(suite, mov_rax_moffs64);
	ptu_run(suite, mov_rax_moffs64_32);
	ptu_run(suite, mov_ax_moffs64);
	ptu_run(suite, mov_ax_moffs64_32);
	ptu_run(suite, mov_eax_moffs32);
	ptu_run(suite, mov_ax_moffs32);
	ptu_run(suite, mov_ax_moffs16);
	ptu_run(suite, les);
	ptu_run(suite, les_disp16);
	ptu_run(suite, les_disp32);
	ptu_run(suite, les_ind_disp8);
	ptu_run(suite, les_ind_disp16);
	ptu_run(suite, les_ind_disp32);
	ptu_run(suite, lds);
	ptu_run(suite, lds_disp16);
	ptu_run(suite, lds_disp32);
	ptu_run(suite, lds_ind_disp8);
	ptu_run(suite, lds_ind_disp16);
	ptu_run(suite, lds_ind_disp32);
	ptu_run(suite, vpshufb);
	ptu_run(suite, bound);
	ptu_run(suite, evex_cutoff);
	ptu_run(suite, ptwrite_r32);
	ptu_run(suite, ptwrite_m32);
	ptu_run(suite, ptwrite_r64);
	ptu_run(suite, ptwrite_m64);

	return ptunit_report(&suite);
}
int main(int argc, char **argv)
{
	struct ptunit_suite suite;

	suite = ptunit_mk_suite(argc, argv);

	ptu_run(suite, from_user_null);
	ptu_run(suite, from_user_default);
	ptu_run(suite, from_user_small);
	ptu_run(suite, from_user_big);
	ptu_run(suite, from_user);
	ptu_run(suite, from_user_cr3);

	ptu_run(suite, match_null);
	ptu_run(suite, match_default);
	ptu_run(suite, match_default_mixed);
	ptu_run(suite, match_cr3);
	ptu_run(suite, match_vmcs);
	ptu_run(suite, match);
	ptu_run(suite, match_cr3_false);
	ptu_run(suite, match_vmcs_false);

	ptunit_report(&suite);
	return suite.nr_fails;
}
Exemple #7
0
int main(int argc, char **argv)
{
	struct ptunit_suite suite;

	suite = ptunit_mk_suite(argc, argv);

	ptu_run(suite, init);
	ptu_run(suite, init_null);
	ptu_run(suite, is_empty_initial);
	ptu_run(suite, is_empty_no);
	ptu_run(suite, is_empty_yes);
	ptu_run(suite, is_empty_null);
	ptu_run(suite, query_taken);
	ptu_run(suite, query_not_taken);
	ptu_run(suite, query_empty);
	ptu_run(suite, query_null);
	ptu_run(suite, update_tnt);
	ptu_run(suite, update_tnt_not_empty);
	ptu_run(suite, update_tnt_null_tnt);
	ptu_run(suite, update_tnt_null_packet);

	ptunit_report(&suite);
	return suite.nr_fails;
}
Exemple #8
0
int main(int argc, const char **argv)
{
	struct ptunit_suite suite;

	pti_ild_init();

	suite = ptunit_mk_suite(argc, argv);

	ptu_run(suite, push);
	ptu_run(suite, jmp_rel);
	ptu_run(suite, long_nop);
	ptu_run(suite, mov_al_64);
	ptu_run(suite, mov_al_32);
	ptu_run(suite, mov_al_16);
	ptu_run(suite, rdtsc);
	ptu_run(suite, pcmpistri);
	ptu_run(suite, vmovdqa);
	ptu_run(suite, vpandn);
	ptu_run(suite, syscall);
	ptu_run(suite, sysret);
	ptu_run(suite, sysenter);
	ptu_run(suite, sysexit);
	ptu_run(suite, int3);
	ptu_run(suite, intn);
	ptu_run(suite, iret);
	ptu_run(suite, call_9a_cd);
	ptu_run(suite, call_9a_cp);
	ptu_run(suite, call_ff_3);
	ptu_run(suite, jmp_ff_5);
	ptu_run(suite, jmp_ea_cd);
	ptu_run(suite, jmp_ea_cp);
	ptu_run(suite, ret_ca);

	ptunit_report(&suite);
	return suite.nr_fails;
}
Exemple #9
0
int main(int argc, char **argv)
{
	struct evq_fixture efix, pfix;
	struct ptunit_suite suite;

	efix.init = efix_init;
	efix.fini = NULL;

	pfix.init = efix_init_pending;
	pfix.fini = NULL;

	suite = ptunit_mk_suite(argc, argv);

	ptu_run(suite, standalone_null);
	ptu_run_f(suite, standalone, efix);

	ptu_run_p(suite, enqueue_null, evb_psbend);
	ptu_run_p(suite, enqueue_null, evb_tip);
	ptu_run_p(suite, enqueue_null, evb_fup);

	ptu_run_p(suite, dequeue_null, evb_psbend);
	ptu_run_p(suite, dequeue_null, evb_tip);
	ptu_run_p(suite, dequeue_null, evb_fup);

	ptu_run_fp(suite, dequeue_empty, efix, evb_psbend);
	ptu_run_fp(suite, dequeue_empty, efix, evb_tip);
	ptu_run_fp(suite, dequeue_empty, efix, evb_fup);

	ptu_run_fp(suite, enqueue_all_dequeue, efix, evb_psbend, 1);
	ptu_run_fp(suite, enqueue_all_dequeue, efix, evb_psbend, 2);
	ptu_run_fp(suite, enqueue_all_dequeue, efix, evb_tip, 1);
	ptu_run_fp(suite, enqueue_all_dequeue, efix, evb_tip, 3);
	ptu_run_fp(suite, enqueue_all_dequeue, efix, evb_fup, 1);
	ptu_run_fp(suite, enqueue_all_dequeue, efix, evb_fup, 4);

	ptu_run_fp(suite, enqueue_one_dequeue, efix, evb_psbend, evb_max * 2);
	ptu_run_fp(suite, enqueue_one_dequeue, efix, evb_tip, evb_max * 2);
	ptu_run_fp(suite, enqueue_one_dequeue, efix, evb_fup, evb_max * 2);

	ptu_run_fp(suite, overflow, efix, evb_psbend, 1);
	ptu_run_fp(suite, overflow, efix, evb_tip, 2);
	ptu_run_fp(suite, overflow, efix, evb_fup, 3);

	ptu_run_p(suite, clear_null, evb_psbend);
	ptu_run_p(suite, clear_null, evb_tip);
	ptu_run_p(suite, clear_null, evb_fup);

	ptu_run_fp(suite, clear, efix, evb_psbend);
	ptu_run_fp(suite, clear, pfix, evb_psbend);
	ptu_run_fp(suite, clear, efix, evb_tip);
	ptu_run_fp(suite, clear, pfix, evb_tip);
	ptu_run_fp(suite, clear, efix, evb_fup);
	ptu_run_fp(suite, clear, pfix, evb_fup);

	ptu_run_p(suite, empty_null, evb_psbend);
	ptu_run_p(suite, empty_null, evb_tip);
	ptu_run_p(suite, empty_null, evb_fup);

	ptu_run_p(suite, pending_null, evb_psbend);
	ptu_run_p(suite, pending_null, evb_tip);
	ptu_run_p(suite, pending_null, evb_fup);

	ptu_run_p(suite, find_null, evb_psbend, ptev_enabled);
	ptu_run_p(suite, find_null, evb_tip, ptev_disabled);
	ptu_run_p(suite, find_null, evb_fup, ptev_paging);

	ptu_run_fp(suite, find_empty, efix, evb_psbend, ptev_enabled);
	ptu_run_fp(suite, find_empty, efix, evb_tip, ptev_disabled);
	ptu_run_fp(suite, find_empty, efix, evb_fup, ptev_paging);

	ptu_run_fp(suite, find_none_evb, efix, evb_psbend, ptev_enabled);
	ptu_run_fp(suite, find_none_evb, efix, evb_tip, ptev_disabled);
	ptu_run_fp(suite, find_none_evb, efix, evb_fup, ptev_paging);

	ptu_run_fp(suite, find_none_evt, efix, evb_psbend, ptev_enabled, 3);
	ptu_run_fp(suite, find_none_evt, efix, evb_tip, ptev_disabled, 4);
	ptu_run_fp(suite, find_none_evt, efix, evb_fup, ptev_paging, 2);

	ptu_run_fp(suite, find, efix, evb_psbend, ptev_enabled, 0, 3);
	ptu_run_fp(suite, find, efix, evb_tip, ptev_disabled, 2, 0);
	ptu_run_fp(suite, find, efix, evb_fup, ptev_paging, 1, 4);

	ptunit_report(&suite);
	return suite.nr_fails;
}