示例#1
0
文件: test.c 项目: kbob/schetoo
static void test_all(test_phase_t phase, test_driver_t driver)
{
    int err_count = 0;
    int test_count = 0;
    test_case_descriptor_t *tc;
    for (tc = test_case_descriptors; tc; tc = tc->tcd_next)
	if (tc->tcd_phase == phase) {
	    test_count++;
	    err_count += (*driver)(tc);
	}
    if (err_count) {
	fprintf(stderr, "%d error%s in phase %s.  FAIL.\n",
		err_count, &"s"[err_count == 1], phase_name(phase));
	exit(1);
    } else
	printf("  %3d %s test%s passed.\n",
	       test_count, phase_name(phase), &"s"[test_count == 1]);
}
示例#2
0
void
print_vals(const char *ifname, struct spppreq *sp)
{
	printf("%s:\tphase=%s\n", ifname, phase_name(sp->defs.pp_phase));
	if (sp->defs.myauth.proto) {
		printf("\tmyauthproto=%s myauthname=\"%.*s\"\n",
		       proto_name(sp->defs.myauth.proto),
		       AUTHNAMELEN, sp->defs.myauth.name);
	}
	if (sp->defs.hisauth.proto) {
		printf("\thisauthproto=%s hisauthname=\"%.*s\"%s\n",
		       proto_name(sp->defs.hisauth.proto),
		       AUTHNAMELEN, sp->defs.hisauth.name,
		       authflags(sp->defs.hisauth.flags));
	}
	printf("\tlcp-timeout=%d ms\n", sp->defs.lcp.timeout);
	printf("\t%sable-vj\n", sp->defs.enable_vj? "en": "dis");
	printf("\t%sable-ipv6\n", sp->defs.enable_ipv6? "en": "dis");
}