• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ runtest函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中runtest函数的典型用法代码示例。如果您正苦于以下问题:C++ runtest函数的具体用法?C++ runtest怎么用?C++ runtest使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了runtest函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: main

int main (int argc, char *argv[])
{
	char *fn;
	unsigned int verfd = 0;

	fn = getenv("TEST_TESTNET3_VERF");
	if (fn) {
		verfd++;
		runtest(true, fn);
	}

	fn = getenv("TEST_MAINNET_VERF");
	if (fn) {
		verfd++;
		runtest(false, fn);
	}

	if (!verfd) {
		fprintf(stderr,
	"chain-verf: Skipping lengthy, extended chain verification test.\n"
	"chain-verf: Set TEST_TESTNET3_VERF and/or TEST_MAINNET_VERF to a\n"
	"chain-verf: valid pynode blocks.dat file, to enable.\n"
	"chain-verf: (a linear sequence of P2P \"block\" messages)\n"
			);
		return 77;
	}
	
	return 0;
}
开发者ID:digiwhite,项目名称:picocoin,代码行数:29,代码来源:chain-verf.c


示例2: cowMng2

void
cowMng2(size_t length)
{

    int fd = open(fileName, O_RDWR);
    char* shared = (char*)mmap(NULL, length, PROT_READ|PROT_WRITE,
			       MAP_SHARED, fd, 0);

    char* priv = (char*)mmap(NULL, length, PROT_READ|PROT_WRITE,
			     MAP_PRIVATE, fd, 0);

    if (~0UL == (unsigned long)shared) {
	printf("Error: %d %s\n", errno, strerror(errno));
    }

    if (~0UL == (unsigned long)priv) {
	printf("Error: %d %s\n", errno, strerror(errno));
    }

    double result1 = runtest(priv, length, 1);
    double result2 = runtest(shared, length, 1);
    munmap(priv, length);
    munmap(shared, length);
    printf("0x%4lx shared: %6.2lfus private: %6.2lfus\n",
	   length/PAGE_SIZE, result2, result1);
    close(fd);
}
开发者ID:BillTheBest,项目名称:k42,代码行数:27,代码来源:memtouch.C


示例3: hpteEntry

void
hpteEntry(size_t length)
{
    char* start = (char*)mmap(NULL, length, PROT_READ|PROT_WRITE,
			      MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);

    if (~0UL == (unsigned long)start) {
	printf("Error: %d %s\n", errno, strerror(errno));
    }
    double result1 = runtest(start, length, 1);

    int ret = mflush((unsigned long)start, ((unsigned long)start) + length);
    if (ret < 0) {
	if (errno==ENOSYS)
	    return;
	printf("mflush error: %d %s\n", errno, strerror(errno));
    }

    double result2 = runtest(start, length, 1);


    munmap(start, length);
    printf("0x%4lx hpteEntry write: %.2lfus %.2lfus\n",
	   length/PAGE_SIZE, result1, result2);
}
开发者ID:BillTheBest,项目名称:k42,代码行数:25,代码来源:memtouch.C


示例4: forkFault

void
forkFault(size_t length)
{
    char* start = (char*)mmap(NULL, length, PROT_READ|PROT_WRITE,
			      MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);

    if (~0UL == (unsigned long)start) {
	printf("Error: %d %s\n", errno, strerror(errno));
    }
    double result1 = runtest(start, length, 1);
    double result2;
    int pipes[2];
    pipe(pipes);
    pid_t pid = fork();
    if (pid==0) {
	result2 = runtest(start, length, 1);
	write(pipes[1], &result2, sizeof(result2));
	exit(0);
    } else {
	read(pipes[0], &result2, sizeof(result2));
	wait(NULL);
    }

    double result3 = runtest(start, length, 1);

    munmap(start, length);
    printf("0x%4lx fork: pre: %.2lfus child: %.2lfus parent: %.2lfus\n",
	   length/PAGE_SIZE, result1, result2, result3);
}
开发者ID:BillTheBest,项目名称:k42,代码行数:29,代码来源:memtouch.C


示例5: test_numbers

void test_numbers()
{
  runtest("12345T",0x23450001);
  runtest("F.1234T",0xF1234);
  runtest("123456789ABCDT",0xABCD6789);
  runtest("1234.56789AT",0x9A345678);
  runtest("1.15.25+T",0x13A00);
}
开发者ID:hornos,项目名称:ibniz,代码行数:8,代码来源:vm_test.c


示例6: main

int main (int argc, char *argv[])
{
	runtest("data/blk0.json", "data/blk0.ser");
	runtest("data/blk120383.json", "data/blk120383.ser");

	bp_key_static_shutdown();
	return 0;
}
开发者ID:aido,项目名称:picocoin,代码行数:8,代码来源:block.c


示例7: main

int main (int argc, char *argv[])
{
	runtest(true, "tx_valid.json");
	runtest(false, "tx_invalid.json");

	bp_key_static_shutdown();
	return 0;
}
开发者ID:dtebbs,项目名称:picocoin,代码行数:8,代码来源:tx-valid.c


示例8: main

int main(int argc, char **argv)
{
   int i, srclen, dstlen, ifreq;
   double factor;

   printf("\n*** Vary source block size*** \n\n");
   srclen = 10000;
   ifreq = 100;
   for(i=0; i<20; i++) {
      factor = ((rand() % 16) + 1) / 4.0;
      dstlen = (int)(srclen * factor + 10);
      runtest(srclen, (double)ifreq, factor, 64, dstlen);
      runtest(srclen, (double)ifreq, factor, 32, dstlen);
      runtest(srclen, (double)ifreq, factor, 8, dstlen);
      runtest(srclen, (double)ifreq, factor, 2, dstlen);
      runtest(srclen, (double)ifreq, factor, srclen, dstlen);
   }

   printf("\n*** Vary dest block size ***\n\n");
   srclen = 10000;
   ifreq = 100;
   for(i=0; i<20; i++) {
      factor = ((rand() % 16) + 1) / 4.0;
      runtest(srclen, (double)ifreq, factor, srclen, 32);
      dstlen = (int)(srclen * factor + 10);
      runtest(srclen, (double)ifreq, factor, srclen, dstlen);
   }

   printf("\n*** Resample factor 1.0, testing different srclen ***\n\n");
   ifreq = 40;
   for(i=0; i<100; i++) {
      srclen = (rand() % 30000) + 10;
      dstlen = (int)(srclen + 10);
      runtest(srclen, (double)ifreq, 1.0, srclen, dstlen);
   }

   printf("\n*** Resample factor 1.0, testing different sin freq ***\n\n");
   srclen = 10000;
   for(i=0; i<100; i++) {
      ifreq = ((int)rand() % 10000) + 1;
      dstlen = (int)(srclen * 10);
      runtest(srclen, (double)ifreq, 1.0, srclen, dstlen);
   }

   printf("\n*** Resample with different factors ***\n\n");
   srclen = 10000;
   ifreq = 100;
   for(i=0; i<100; i++) {
      factor = ((rand() % 64) + 1) / 4.0;
      dstlen = (int)(srclen * factor + 10);
      runtest(srclen, (double)ifreq, factor, srclen, dstlen);
   }

   return 0;
}
开发者ID:maolin-cdzl,项目名称:libresample,代码行数:55,代码来源:testresample.c


示例9: main

int main(int argc, char **argv)
{
	SaHpiSessionIdT sid = 0;
	SaHpiRptEntryT res;
	SaHpiRdrT rdr;
	SaHpiEntryIdT id = SAHPI_FIRST_ENTRY;
	SaHpiResourceIdT resid;
	int failcount = 0;
	int testnum = 0;
	SaErrorT rc = SA_OK;

        rc = saHpiSessionOpen(SAHPI_UNSPECIFIED_DOMAIN_ID, &sid, NULL);
	if(rc != SA_OK) {
		failed("Failed to open session");
	}

	rc = saHpiDiscover(sid);
	if(rc != SA_OK) {
		failed("Failed to run discover");
	}
						
        rc = saHpiRptEntryGet(sid, id, &id, &res);
        runtest();
        if(rc != SA_OK) {
		dbg("Error %s",oh_lookup_error(rc));
		failed("Couldn't get the first rpt entry");
		/* we're toast, bail */
		goto end;
	}
	else{
		id = SAHPI_FIRST_ENTRY;
		resid = res.ResourceId;
		rc = saHpiRdrGet(sid, resid, id, &id, &rdr);
		if (oh_cmp_ep(&rdr.Entity,&res.ResourceEntity) != SAHPI_TRUE){
			dbg("Error %s", oh_lookup_error(rc));
			failed("Entity path of rdr did not match entity path of resource");
		}
		runtest();
		if(rc != SA_OK){
			dbg("Error %s", oh_lookup_error(rc));
			failed("Couldn't get the first rdr entry");
			goto end;
		}
	}
	
	dbg("Ran %d tests", testnum);
	/* if there is any failures, the test fails */
	end:
		if(failcount) {
			return -1;
		}

	return(0);
}
开发者ID:openhpi1,项目名称:testrepo,代码行数:54,代码来源:sim_sanity_005.c


示例10: main

//
// Main program
//
int main(int argc, char *argv[])
{
	setbuf(stdout, NULL);

	long ranseq = 0;	// random stress test count
	long ranseed = 1;	// random seed for it

	int arg;
	while ((arg = getopt(argc, argv, "r:v")) != -1) {
		switch (arg) {
		case 'r': {
			ranseq = atoi(optarg);
			if (const char *colon = strchr(optarg, ':'))
				ranseed = atoi(colon + 1);
			else
				ranseed = getpid() ^ time(NULL);
			break;
			}
		case 'v':
			verbose = true;
			break;
		default:
			usage();
		}
	}
	if (optind < argc - 1)
		usage();
	const char *sequence = argv[optind];
	if (sequence && !strcmp(sequence, "+"))
		sequence = testCodes;
		
	if (ranseq) {	// repeated random (stress test) sequence
		if (!sequence)
			sequence = testCodes;
		printf("*** Random stress test: %ld iterations from <%s> with seed=%ld\n",
			ranseq, sequence, ranseed);
		srandom(ranseed);
		int setSize = strlen(sequence);
		for (long n = 0; n < ranseq; n++) {
			char type = sequence[random() % setSize];
			printf("\n[%ld:%c]", n, type);
			runtest(type);
		}
		printf("*** Random test sequence complete.\n");
		exit(0);
	} else {		// single-pass selected tests sequence
		if (!sequence)
			sequence = ".";	// default to ping test
		for (const char *s = sequence; *s; s++)
			runtest(*s);
		printf("*** Test sequence complete.\n");
		exit(0);
	}
}
开发者ID:Apple-FOSS-Mirror,项目名称:securityd,代码行数:57,代码来源:testclient.cpp


示例11: main

int
main(void)
{
    int nf = 0;

    failed[0] = '\0';
    printf("Test bitvect_test: ");
    nf += runtest(boot, NULL, NULL);
    nf += runtest(oct_small_num, num_family_setup, num_family_teardown);
    nf += runtest(oct_large_num, num_family_setup, num_family_teardown);
    printf(" +%d-%d/3 %d%%\n%s",
           3-nf, nf, 100*(3-nf)/3, failed);
    return (nf == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
}
开发者ID:Multi2Sim,项目名称:m2s-bench-parsec-3.0-src,代码行数:14,代码来源:bitvect_test.c


示例12: main

int main(int argc, char **argv)
{
	/* Initialisation */

	generate_wellknown_sids();

	/* Create security descriptor */

	sd = build_sec_desc(acl_printer, NULL, NULL_SID, NULL_SID);

	if (!sd) {
		printf("FAIL: could not build security descriptor\n");
		return 1;
	}

	/* Run test */

	runtest();

	/* Return */

        if (!failed) {
		printf("PASS\n");
		return 0;
	} 

	return 1;
}
开发者ID:AllardJ,项目名称:Tomato,代码行数:28,代码来源:se_access_check_printer.c


示例13: dotest

static int dotest(int nchildren, int count, char **argv)
{
pid_t	p;
int	i;

	signal(SIGCHLD, SIG_DFL);

	for (i=0; i<nchildren; i++)
	{
		p=fork();
		if (p == -1)
		{
			perror("fork");
			cleanup();
			return (1);
		}
		if (p == 0)
		{
			close(1);
			if (open("/dev/null", O_WRONLY) != 1)
			{
				perror("open");
				exit(1);
			}
			exit(runtest(count, argv));
		}
	}

	return (cleanup());
}
开发者ID:zixia,项目名称:wmail,代码行数:30,代码来源:authdaemontest.c


示例14: main

int main(int ac, char *av[])
{
	int lc;

	tst_parse_opts(ac, av, NULL, NULL);

	setup();

	for (lc = 0; TEST_LOOPING(lc); lc++) {

		local_flag = PASSED;

		runtest();

		if (local_flag == PASSED) {
			tst_resm(TPASS, "Test passed.");
		} else {
			tst_resm(TFAIL, "Test failed.");
		}

		tst_rmdir();
		/* ??? so we are doing only one loop here ??? */
		tst_exit();
	}

	tst_exit();
}
开发者ID:kraj,项目名称:ltp,代码行数:27,代码来源:ftest03.c


示例15: main2

ram_reply_t main2(int argc, char *argv[])
{
   ramtest_params_t testparams;
   ram_reply_t e = RAM_REPLY_INSANE;

   RAM_FAIL_TRAP(ram_initialize(NULL, NULL));

   RAM_FAIL_TRAP(initdefaults(&testparams));
   e = parseargs(&testparams, argc, argv);
   switch (e)
   {
   default:
      RAM_FAIL_TRAP(e);
   case RAM_REPLY_OK:
      break;
   case RAM_REPLY_INPUTFAIL:
      return e;
   }

   e = runtest(&testparams);
   switch (e)
   {
   default:
      RAM_FAIL_TRAP(e);
   case RAM_REPLY_OK:
      break;
   case RAM_REPLY_INPUTFAIL:
      return e;
   }

   return RAM_REPLY_OK;
}
开发者ID:fmrl,项目名称:ramalloc,代码行数:32,代码来源:defaulttest.c


示例16: main

int main(int argc, char **argv) {
    char *sta, *end;
    int argi = 1, testi;
     
    init_testcase();
     
    do {
	if (argi >= argc)
	    end = sta = NULL;
	else if (ISTEST(argv[argi]))
	    end = sta = argv[argi];
	else if (ISRANGE(argv[argi]))
	    end = (sta = argv[argi]) + 3;
	else {
	    fprintf(stderr, "invalid: %s\n", argv[argi]);
	    fprintf(stderr, "USAGE: ./test\n");
	    fprintf(stderr, " ./test [num] ...\n");
	    fprintf(stderr, " ./test [num]-[num] ...\n");
	    continue;
	}
	 
	for (testi = 0 ; testcase[testi] != NULL ; testi++) {
	    if (sta == NULL || end == NULL || (
			strncmp(sta, testcase[testi]->num, 2) <= 0 &&
			strncmp(end, testcase[testi]->num, 2) >= 0))
		 
		runtest(testcase[testi]);
	}
    } while (++argi < argc);
     
    return 0;
}
开发者ID:daniter-cu,项目名称:fuck_reuben,代码行数:32,代码来源:main.c


示例17: runtests

int runtests(char *dirname, char *ironout)
{
	struct dirent *ent;
	DIR *dir;
	int total = 0;
	int fails = 0;
	dir = opendir(dirname);
	if (!dir) {
		printf("failed: %s does not exist\n", dirname);
		return 1;
	}
	while ((ent = readdir(dir))) {
		char *name = ent->d_name;
		rmtempdir(".", 0);
		if (startswith(name, "test-") && !endswith(name, "~")) {
			char path[MAXPATHLEN];
			sprintf(path, "%s/%s", dirname, name);
			total++;
			if (runtest(path, ironout)) {
				fails++;
			}
		}
	}
	closedir(dir);
	if (fails)
		printf("\n%d of %d failed\n", fails, total);
	else
		printf("%d succeeded\n", total);
	return fails;
}
开发者ID:BackupTheBerlios,项目名称:ironout,代码行数:30,代码来源:runtests.c


示例18: init_crypto_wep_test

static int __init
init_crypto_wep_test(void)
{
	struct ieee80211com ic;
	struct ieee80211vap vap;
	int i, pass, total;

	memset(&ic, 0, sizeof(ic));
	memset(&vap, 0, sizeof(vap));
	vap.iv_ic = &ic;
	if (debug)
		vap.iv_debug = IEEE80211_MSG_CRYPTO;
	ieee80211_crypto_attach(&ic);
	ieee80211_crypto_vattach(&vap);
	pass = 0;
	total = 0;
	for (i = 0; i < ARRAY_SIZE(weptests); i++)
		if (tests & (1 << i)) {
			total++;
			pass += runtest(&vap, &weptests[i]);
		}
	printk("%u of %u 802.11i WEP test vectors passed\n", pass, total);
	ieee80211_crypto_vdetach(&vap);
	ieee80211_crypto_detach(&ic);
	return (pass == total ? 0 : -ENXIO);
}
开发者ID:kfirlavi,项目名称:Amalia,代码行数:26,代码来源:test_wep.c


示例19: main

int main(int ac, char *av[])
{
	int lc;
	char *msg;

	/*
	 * parse standard options
	 */
	if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
		tst_resm(TBROK, "OPTION PARSING ERROR - %s", msg);
		tst_exit();
	}

	for (lc = 0; TEST_LOOPING(lc); lc++) {

		local_flag = PASSED;
		init();
		runtest();

		if (local_flag == PASSED)
			tst_resm(TPASS, "Test passed.");
		else
			tst_resm(TFAIL, "Test failed.");
	}

	cleanup();
	tst_exit();
}
开发者ID:Altiscale,项目名称:sig-core-t_ltp,代码行数:28,代码来源:ftest08.c


示例20: main

int main(int ac, char *av[])
{
	int lc;

	tst_parse_opts(ac, av, NULL, NULL);

	setup();

	for (lc = 0; TEST_LOOPING(lc); lc++) {

		local_flag = PASSED;

		runtest();

		if (local_flag == PASSED)
			tst_resm(TPASS, "Test passed.");
		else
			tst_resm(TFAIL, "Test failed.");

		tst_rmdir();
		tst_exit();

	}

	tst_exit();
}
开发者ID:rocklee104,项目名称:ltp,代码行数:26,代码来源:ftest07.c



注:本文中的runtest函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ runtimeError函数代码示例发布时间:2022-05-30
下一篇:
C++ runstate_is_running函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap