您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ t_info函数代码示例

51自学网 2021-06-03 08:39:16
  C++
这篇教程C++ t_info函数代码示例写得很实用,希望能帮到您。

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

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

示例1: tx_sde

static voidtx_sde(isc_task_t *task, isc_event_t *event) {	isc_result_t	isc_result;	UNUSED(task);	UNUSED(event);	/*	 * Signal shutdown processing complete.	 */	isc_result = isc_mutex_lock(&Tx_mx);	if (isc_result != ISC_R_SUCCESS) {		t_info("isc_mutex_lock failed %s/n",		       isc_result_totext(isc_result));		++Tx_nprobs;	}	isc_result = isc_condition_signal(&Tx_cv);	if (isc_result != ISC_R_SUCCESS) {		t_info("isc_condition_signal failed %s/n",		       isc_result_totext(isc_result));		++Tx_nprobs;	}	isc_result = isc_mutex_unlock(&Tx_mx);	if (isc_result != ISC_R_SUCCESS) {		t_info("isc_mutex_unlock failed %s/n",		       isc_result_totext(isc_result));		++Tx_nprobs;	}	isc_event_free(&event);}
开发者ID:jhbsz,项目名称:netbsd,代码行数:33,


示例2: t5_start_event

static voidt5_start_event(isc_task_t *task, isc_event_t *event) {	isc_result_t	isc_result;	UNUSED(task);	t_info("t5_start_event/n");	isc_result = isc_mutex_lock(&T5_mx);	if (isc_result != ISC_R_SUCCESS) {		t_info("isc_mutex_lock failed %s/n",		       isc_result_totext(isc_result));		++T5_nprobs;	}	while (! T5_startflag) {		(void) isc_condition_wait(&T5_cv, &T5_mx);	}	isc_result = isc_mutex_unlock(&T5_mx);	if (isc_result != ISC_R_SUCCESS) {		t_info("isc_mutex_unlock failed %s/n",		       isc_result_totext(isc_result));		++T5_nprobs;	}	isc_event_free(&event);}
开发者ID:jhbsz,项目名称:netbsd,代码行数:27,


示例3: test_dns_resolver_settimeout_to_default

static voidtest_dns_resolver_settimeout_to_default(void) {	dns_resolver_t *resolver = NULL;	int test_result;	unsigned int default_timeout, timeout;	t_assert("test_dns_resolver_settimeout_to_default", 1, T_REQUIRED, "%s",		 "_settimeout() can change the timeout back to a default value"		 " by specifying 0 as the timeout.");	setup();	CHECK(make_resolver(&resolver));	default_timeout = dns_resolver_gettimeout(resolver);	t_info("The default timeout is %d second%s/n", default_timeout,	       (default_timeout == 1 ? "" : "s"));	dns_resolver_settimeout(resolver, default_timeout - 1);	timeout = dns_resolver_gettimeout(resolver);	t_info("The new timeout is %d second%s/n", timeout,	       (timeout == 1 ? "" : "s"));	dns_resolver_settimeout(resolver, 0);	timeout = dns_resolver_gettimeout(resolver);	test_result = (timeout == default_timeout) ? T_PASS : T_FAIL;	destroy_resolver(&resolver);	teardown();	t_result(test_result);}
开发者ID:ElRevo,项目名称:xia-core,代码行数:30,


示例4: t5_tick_event

static voidt5_tick_event(isc_task_t *task, isc_event_t *event) {	isc_result_t	isc_result;	isc_time_t	expires;	isc_interval_t	interval;	UNUSED(task);	++T5_eventcnt;	t_info("t5_tick_event %d/n", T5_eventcnt);	/*	 * On the first tick, purge all remaining tick events	 * and then shut down the task.	 */	if (T5_eventcnt == 1) {		isc_time_settoepoch(&expires);		isc_interval_set(&interval, T5_SECONDS, 0);		isc_result = isc_timer_reset(T5_tickertimer,					     isc_timertype_ticker, &expires,					     &interval, ISC_TRUE);		if (isc_result != ISC_R_SUCCESS) {			t_info("isc_timer_reset failed %s/n",			       isc_result_totext(isc_result));			++T5_nfails;		}		isc_task_shutdown(task);	}	isc_event_free(&event);}
开发者ID:jhbsz,项目名称:netbsd,代码行数:30,


示例5: t1_add

/* * Adapted from the original rbt_test.c. */static intt1_add(char *name, dns_rbt_t *rbt, isc_mem_t *mctx, isc_result_t *dns_result) {	int		nprobs;	dns_name_t	*dns_name;	nprobs = 0;	if (name && dns_result) {		if (create_name(name, mctx, &dns_name) == 0) {			if (T_debug)				t_info("dns_rbt_addname succeeded/n");			*dns_result = dns_rbt_addname(rbt, dns_name, dns_name);			if (*dns_result != ISC_R_SUCCESS) {				delete_name(dns_name, mctx);				t_info("dns_rbt_addname failed %s/n",				       dns_result_totext(*dns_result));				++nprobs;			}		} else {			++nprobs;		}	} else {		++nprobs;	}	return(nprobs);}
开发者ID:pombredanne,项目名称:NetBSD,代码行数:28,


示例6: t_info

//data should be allocatedbool Tdcmtk::getPixelsToFlt(float* data){	if (!m_dataSet)	{		t_info("fails to open the file");		return false;	}	if (m_nBits == 16 && m_bSined) 	{		const Sint16 *v = 0;		getPixels_SInt16(v);		for (int i = 0, s = m_W * m_H; i < s; ++i) data[i] = v[i];		delete[] v;	}	else if (m_nBits == 16 && !m_bSined)	{		const Uint16 *v = 0;		getPixels_UInt16(v);		for (int i = 0, s = m_W * m_H; i < s; ++i) data[i] = v[i];		delete[] v;	}	else	{		t_info("this file type is not implemeted yet/n");		return false;	}	return true;}
开发者ID:HidetomoKataoka,项目名称:SimpleDcmViewer,代码行数:31,


示例7: t_namechk

static intt_namechk(isc_result_t dns_result, dns_fixedname_t *dns_name, char *exp_name,	  dns_fixedname_t *dns_origin, char *exp_origin,	  isc_result_t exp_result){	int	nfails;	nfails = 0;	if (fixedname_cmp(dns_name, exp_name)) {		t_info("/texpected name of %s, got %s/n",				exp_name, fixedname_totext(dns_name));		++nfails;	}	if (exp_origin != NULL) {		t_info("checking for DNS_R_NEWORIGIN/n");		if (dns_result == exp_result) {			if (fixedname_cmp(dns_origin, exp_origin)) {				t_info("/torigin %s, expected %s/n",				       fixedname_totext(dns_origin),				       exp_origin);				++nfails;			}		} else {			t_info("/tgot %s/n", dns_result_totext(dns_result));			++nfails;		}	}	return(nfails);}
开发者ID:pombredanne,项目名称:NetBSD,代码行数:30,


示例8: ck

/* * Compare binary digest or HMAC to string of hex digits from an RFC */static voidck(const char *name, const IN_ *in, const OUT_ *out){	char buf[sizeof(dbuf)*2+1];	const char *str_name;	unsigned int l;	d2str(buf, sizeof(buf), dbuf.b, out->digest_len);	str_name = in->name != NULL ? in->name : (const char *)in->str;	if (T_debug != 0)		t_info("%s(%s) = %s/n", name, str_name, buf);	if (strcasecmp(buf, out->str)) {		t_info("%s(%s)/n%9s %s/n%9s %s/n",		       name, str_name,		       "is", buf,		       "should be", out->str);		++nprobs;		return;	}	/*	 * check that the hash or HMAC is no longer than we think it is	 */	for (l = out->digest_len; l < sizeof(dbuf); ++l) {		if (dbuf.b[l] != DIGEST_FILL) {			t_info("byte #%d after end of %s(%s) changed to %02x/n",			       l-out->digest_len, name, str_name, dbuf.b[l]);			++nprobs;			break;		}	}}
开发者ID:Stichting-MINIX-Research-Foundation,项目名称:minix,代码行数:37,


示例9: create_name

static intcreate_name(char *s, isc_mem_t *mctx, dns_name_t **dns_name) {	int		nfails;	int		length;	isc_result_t	result;	isc_buffer_t	source;	isc_buffer_t	target;	dns_name_t	*name;	nfails = 0;	if (s && *s) {		length = strlen(s);		isc_buffer_init(&source, s, length);		isc_buffer_add(&source, length);		/*		 * The buffer for the actual name will immediately follow the		 * name structure.		 */		name = isc_mem_get(mctx, sizeof(*name) + DNSNAMELEN);		if (name == NULL) {			t_info("isc_mem_get failed/n");			++nfails;		} else {			dns_name_init(name, NULL);			isc_buffer_init(&target, name + 1, DNSNAMELEN);			result = dns_name_fromtext(name, &source, dns_rootname,						   0, &target);			if (result != ISC_R_SUCCESS) {				++nfails;				t_info("dns_name_fromtext(%s) failed %s/n",				       s, dns_result_totext(result));				 isc_mem_put(mctx, name,					     sizeof(*name) + DNSNAMELEN);			} else				*dns_name = name;		}	} else {		++nfails;		t_info("create_name: empty name/n");	}	return(nfails);}
开发者ID:pombredanne,项目名称:NetBSD,代码行数:50,


示例10: rbt_init

/* * Initialize a database from filename. */static intrbt_init(char *filename, dns_rbt_t **rbt, isc_mem_t *mctx) {	int		rval;	isc_result_t	dns_result;	char		*p;	FILE		*fp;	fp = fopen(filename, "r");	if (fp == NULL) {		t_info("No such file %s/n", filename);		return(1);	}	dns_result = dns_rbt_create(mctx, delete_name, mctx, rbt);	if (dns_result != ISC_R_SUCCESS) {		t_info("dns_rbt_create failed %s/n",				dns_result_totext(dns_result));		fclose(fp);		return(1);	}	while ((p = t_fgetbs(fp)) != NULL) {		/*		 * Skip any comment lines.		 */		if ((*p == '#') || (*p == '/0') || (*p == ' ')) {			(void)free(p);			continue;		}		if (T_debug)			t_info("adding name %s to the rbt/n", p);		rval = t1_add(p, *rbt, mctx, &dns_result);		if ((rval != 0) || (dns_result != ISC_R_SUCCESS)) {			t_info("add of %s failed/n", p);			dns_rbt_destroy(rbt);			fclose(fp);			return(1);		}		(void) free(p);	}	fclose(fp);	return(0);}
开发者ID:pombredanne,项目名称:NetBSD,代码行数:49,


示例11: test_master_x

static inttest_master_x(const char *filename) {	FILE		*fp;	char		*p;	int		line;	int		cnt;	int		result;	result = T_UNRESOLVED;	fp = fopen(filename, "r");	if (fp != NULL) {		line = 0;		while ((p = t_fgetbs(fp)) != NULL) {			++line;			/*			 * Skip comment lines.			 */			if ((isspace(*p & 0xff)) || (*p == '#')) {				(void)free(p);				continue;			}			/*			 * Name of data file, origin, zclass, expected result.			 */			cnt = t_bustline(p, Tokens);			if (cnt == 4) {				result = test_master(Tokens[0], Tokens[1],					     Tokens[2],					     t_dns_result_fromtext(Tokens[3]));			} else {				t_info("bad format in %s at line %d/n",				       filename, line);			}			(void)free(p);		}		(void)fclose(fp);	} else {		t_info("Missing datafile %s/n", filename);	}	return(result);}
开发者ID:each,项目名称:bind9-collab,代码行数:46,


示例12: t5_once_event

static voidt5_once_event(isc_task_t *task, isc_event_t *event) {	isc_result_t	isc_result;	t_info("t5_once_event/n");	/*	 * Allow task1 to start processing events.	 */	isc_result = isc_mutex_lock(&T5_mx);	if (isc_result != ISC_R_SUCCESS) {		t_info("isc_mutex_lock failed %s/n",		       isc_result_totext(isc_result));		++T5_nprobs;	}	T5_startflag = 1;	isc_result = isc_condition_broadcast(&T5_cv);	if (isc_result != ISC_R_SUCCESS) {		t_info("isc_condition_broadcast failed %s/n",		       isc_result_totext(isc_result));		++T5_nprobs;	}	isc_result = isc_mutex_unlock(&T5_mx);	if (isc_result != ISC_R_SUCCESS) {		t_info("isc_mutex_unlock failed %s/n",		       isc_result_totext(isc_result));		++T5_nprobs;	}	isc_event_free(&event);	isc_task_shutdown(task);}
开发者ID:jhbsz,项目名称:netbsd,代码行数:36,


示例13: print_data

static isc_result_tprint_data(void *data) {	isc_result_t	dns_result;	isc_buffer_t	target;	char		*buffer[DNSNAMELEN];	isc_buffer_init(&target, buffer, sizeof(buffer));	dns_result = dns_name_totext(data, ISC_FALSE, &target);	if (dns_result != ISC_R_SUCCESS) {		t_info("dns_name_totext failed %s/n",				dns_result_totext(dns_result));	}	return(dns_result);}
开发者ID:pombredanne,项目名称:NetBSD,代码行数:15,


示例14: t1_add_callback

static isc_result_tt1_add_callback(void *arg, dns_name_t *owner, dns_rdataset_t *dataset) {	char buf[BIGBUFLEN];	isc_buffer_t target;	isc_result_t result;	UNUSED(arg);	isc_buffer_init(&target, buf, BIGBUFLEN);	result = dns_rdataset_totext(dataset, owner, ISC_FALSE, ISC_FALSE,				     &target);	if (result != ISC_R_SUCCESS)		t_info("dns_rdataset_totext: %s/n", dns_result_totext(result));	return(result);}
开发者ID:VargMon,项目名称:netbsd-cvs-mirror,代码行数:16,


示例15: test_dns_resolver_gettimeout

static voidtest_dns_resolver_gettimeout(void) {	dns_resolver_t *resolver = NULL;	int test_result;	unsigned int timeout;	t_assert("test_dns_resolver_gettimeout", 1, T_REQUIRED, "%s",		 "The default timeout is returned from _gettimeout()");	setup();	CHECK(make_resolver(&resolver));	timeout = dns_resolver_gettimeout(resolver);	t_info("The default timeout is %d second%s/n", timeout, (timeout == 1 ? "" : "s"));	test_result = (timeout > 0) ? T_PASS : T_FAIL;	destroy_resolver(&resolver);	teardown();	t_result(test_result);}
开发者ID:ElRevo,项目名称:xia-core,代码行数:20,


示例16: t3

static voidt3(void) {	int		result;	int		isc_result;	isc_time_t	expires;	isc_interval_t	interval;	t_assert("isc_timer_create", 3, T_REQUIRED, "%s", a3);	if (threaded) {		Tx_nfails	= 0;		Tx_nprobs	= 0;		Tx_nevents	= 1;		Tx_seconds	= T3_SECONDS;		Tx_nanoseconds	= T3_NANOSECONDS;		isc_interval_set(&interval, Tx_seconds + 1, Tx_nanoseconds);		isc_result = isc_time_nowplusinterval(&expires, &interval);		if (isc_result == ISC_R_SUCCESS) {			isc_interval_set(&interval, Tx_seconds,					 Tx_nanoseconds);			t_timers_x(isc_timertype_once, &expires, &interval,				   t3_te);		} else {			t_info("isc_time_nowplusinterval failed %s/n",			       isc_result_totext(isc_result));			++Tx_nprobs;		}		result = T_UNRESOLVED;		if ((Tx_nfails == 0) && (Tx_nprobs == 0))			result = T_PASS;		else if (Tx_nfails)			result = T_FAIL;		t_result(result);	} else		require_threads();}
开发者ID:jhbsz,项目名称:netbsd,代码行数:41,


示例17: test_dns_resolver_settimeout_over_maximum

static voidtest_dns_resolver_settimeout_over_maximum(void) {	dns_resolver_t *resolver = NULL;	int test_result;	unsigned int timeout;	t_assert("test_dns_resolver_settimeout_over_maximum", 1, T_REQUIRED, "%s",		 "_settimeout() cannot set the value larger than the maximum.");	setup();	CHECK(make_resolver(&resolver));	dns_resolver_settimeout(resolver, 4000000);	timeout = dns_resolver_gettimeout(resolver);	t_info("The new timeout is %d second%s/n", timeout,	       (timeout == 1 ? "" : "s"));	test_result = (timeout < 4000000 && timeout > 0) ? T_PASS : T_FAIL;	destroy_resolver(&resolver);	teardown();	t_result(test_result);}
开发者ID:ElRevo,项目名称:xia-core,代码行数:23,


示例18: t_getTagValInt

bool t_getTagValInt(DcmDataset *DataSet, DcmTagKey tagKey, int &value){    DcmElement *elem = NULL;    DcmTag tag(tagKey);    if ( DataSet->findAndGetElement(tag, elem).bad() || elem->getLength() == 0) return false;    Sint16 rvS16;    Sint32 rvS32;    Uint8  rvU8 ;    Uint16 rvU16;    Uint32 rvU32;    if      ( elem->getSint16( rvS16 ).good() ) { value = (int)rvS16; }    else if ( elem->getSint32( rvS32 ).good() ) { value = (int)rvS32; }    else if ( elem->getUint8 ( rvU8  ).good() ) { value = (int)rvU8 ; }    else if ( elem->getUint16( rvU16 ).good() ) { value = (int)rvU16; }    else if ( elem->getUint32( rvU32 ).good() ) { value = (int)rvU32; }    else {        t_info("%s is not integer value", tag.getTagName());        return false;    }    return true;}
开发者ID:HidetomoKataoka,项目名称:SimpleDcmViewer,代码行数:23,


示例19: test_atomic_xaddq

static voidtest_atomic_xaddq() {	int test_result;	isc_task_t *tasks[TASKS];	isc_event_t *event;	int i;	t_assert("test_atomic_xaddq", 1, T_REQUIRED, "%s",		 "ensure that isc_atomic_xaddq() works.");	setup();	memset(counters, 0, sizeof(counters));	counter_64 = 0;	/*	 * Create our tasks, and allocate an event to get the counters going.	 */	for (i = 0 ; i < TASKS ; i++) {		tasks[i] = NULL;		CHECK(isc_task_create(task_manager, 0, &tasks[i]));		event = isc_event_allocate(mctx, NULL, 1000, do_xaddq,					   &counters[i], sizeof(struct isc_event));		isc_task_sendanddetach(&tasks[i], &event);	}	teardown();	test_result = T_PASS;	t_info("64-bit counter %"ISC_PRINT_QUADFORMAT"d, expected %"ISC_PRINT_QUADFORMAT"d/n",	       counter_64, EXPECTED_COUNT_64);	if (counter_64 != EXPECTED_COUNT_64)		test_result = T_FAIL;	t_result(test_result);	counter_64 = 0;}
开发者ID:GabrielCastro,项目名称:bind,代码行数:37,


示例20: test_dns_rbtnodechain_init

static inttest_dns_rbtnodechain_init(const char *filename) {	FILE		*fp;	char		*p;	int		line;	int		cnt;	int		result;	int		nfails;	int		nprobs;	nfails = 0;	nprobs = 0;	fp = fopen(filename, "r");	if (fp != NULL) {		line = 0;		while ((p = t_fgetbs(fp)) != NULL) {			++line;			/*			 * Skip comment lines.			 */			if ((isspace((unsigned char)*p)) || (*p == '#')) {				(void)free(p);				continue;			}			cnt = t_bustline(p, Tokens);			if (cnt == 10) {				result = t_dns_rbtnodechain_init(						Tokens[0],  /* dbfile */						Tokens[1],  /* startname */						Tokens[2],  /* nextname */						Tokens[3],  /* nextorigin */						Tokens[4],  /* prevname */						Tokens[5],  /* prevorigin */						Tokens[6],  /* firstname */						Tokens[7],  /* firstorigin */						Tokens[8],  /* lastname */						Tokens[9]); /* lastorigin */				if (result != T_PASS) {					if (result == T_FAIL)						++nfails;					else						++nprobs;				}			} else {				t_info("bad format in %s at line %d/n",						filename, line);				++nprobs;			}			(void)free(p);		}		(void)fclose(fp);	} else {		t_info("Missing datafile %s/n", filename);		++nprobs;	}	result = T_UNRESOLVED;	if ((nfails == 0) && (nprobs == 0))		result = T_PASS;	else if (nfails)		result = T_FAIL;	return(result);}
开发者ID:pombredanne,项目名称:NetBSD,代码行数:70,


示例21: t_dns_rbtnodechain_init

static intt_dns_rbtnodechain_init(char *dbfile, char *findname,			char *nextname, char *nextorigin,			char *prevname, char *prevorigin,			char *firstname, char *firstorigin,			char *lastname, char *lastorigin){	int			result;	int			len;	int			nfails;	dns_rbt_t		*rbt;	dns_rbtnode_t		*node;	dns_rbtnodechain_t	chain;	isc_mem_t		*mctx;	isc_entropy_t		*ectx;	isc_result_t		isc_result;	isc_result_t		dns_result;	dns_fixedname_t		dns_findname;	dns_fixedname_t		dns_foundname;	dns_fixedname_t		dns_firstname;	dns_fixedname_t		dns_lastname;	dns_fixedname_t		dns_prevname;	dns_fixedname_t		dns_nextname;	dns_fixedname_t		dns_origin;	isc_buffer_t		isc_buffer;	result = T_UNRESOLVED;	nfails = 0;	mctx = NULL;	ectx = NULL;	isc_result = isc_mem_create(0, 0, &mctx);	if (isc_result != ISC_R_SUCCESS) {		t_info("isc_mem_create failed %s/n",		       isc_result_totext(isc_result));		return(result);	}	isc_result = isc_entropy_create(mctx, &ectx);	if (isc_result != ISC_R_SUCCESS) {		t_info("isc_entropy_create: %s: exiting/n",		       dns_result_totext(isc_result));		isc_mem_destroy(&mctx);		return(T_UNRESOLVED);	}	isc_result = isc_hash_create(mctx, ectx, DNS_NAME_MAXWIRE);	if (isc_result != ISC_R_SUCCESS) {		t_info("isc_hash_create: %s: exiting/n",		       dns_result_totext(isc_result));		isc_entropy_detach(&ectx);		isc_mem_destroy(&mctx);		return(T_UNRESOLVED);	}	dns_rbtnodechain_init(&chain, mctx);	rbt = NULL;	if (rbt_init(dbfile, &rbt, mctx)) {		t_info("rbt_init %s failed/n", dbfile);		isc_hash_destroy();		isc_entropy_detach(&ectx);		isc_mem_destroy(&mctx);		return(result);	}	len = strlen(findname);	isc_buffer_init(&isc_buffer, findname, len);	isc_buffer_add(&isc_buffer, len);	dns_fixedname_init(&dns_foundname);	dns_fixedname_init(&dns_findname);	dns_fixedname_init(&dns_firstname);	dns_fixedname_init(&dns_origin);	dns_fixedname_init(&dns_lastname);	dns_fixedname_init(&dns_prevname);	dns_fixedname_init(&dns_nextname);	dns_result = dns_name_fromtext(dns_fixedname_name(&dns_findname),					&isc_buffer, NULL, 0, NULL);	if (dns_result != ISC_R_SUCCESS) {		t_info("dns_name_fromtext failed %s/n",		       dns_result_totext(dns_result));		return(result);	}	/*	 * Set the starting node.	 */	node = NULL;	dns_result = dns_rbt_findnode(rbt, dns_fixedname_name(&dns_findname),				      dns_fixedname_name(&dns_foundname),				      &node, &chain, DNS_RBTFIND_EMPTYDATA,				      NULL, NULL);	if (dns_result != ISC_R_SUCCESS) {		t_info("dns_rbt_findnode failed %s/n",		       dns_result_totext(dns_result));//.........这里部分代码省略.........
开发者ID:pombredanne,项目名称:NetBSD,代码行数:101,


示例22: test_dns_rbt_x

static inttest_dns_rbt_x(const char *filename) {	FILE		*fp;	char		*p;	int		line;	int		cnt;	int		result;	int		nfails;	int		nprobs;	nfails = 0;	nprobs = 0;	fp = fopen(filename, "r");	if (fp != NULL) {		line = 0;		while ((p = t_fgetbs(fp)) != NULL) {			++line;			/*			 * Skip comment lines.			 */			if ((isspace((unsigned char)*p)) || (*p == '#')) {				(void)free(p);				continue;			}			/*			 * Name of db file, command, testname,			 * expected result.			 */			cnt = t_bustline(p, Tokens);			if (cnt == 4) {				result = test_rbt_gen(Tokens[0], Tokens[1],					     Tokens[2],					     t_dns_result_fromtext(Tokens[3]));				if (result != T_PASS)					++nfails;			} else {				t_info("bad format in %s at line %d/n",						filename, line);				++nprobs;			}			(void)free(p);		}		(void)fclose(fp);	} else {		t_info("Missing datafile %s/n", filename);		++nprobs;	}	result = T_UNRESOLVED;	if ((nfails == 0) && (nprobs == 0))		result = T_PASS;	else if (nfails)		result = T_FAIL;	return(result);}
开发者ID:pombredanne,项目名称:NetBSD,代码行数:61,


示例23: t9_walkchain

static intt9_walkchain(dns_rbtnodechain_t *chain, dns_rbt_t *rbt) {	int		cnt;	int		order;	unsigned int	nlabels;	int		nprobs;	isc_result_t	dns_result;	dns_fixedname_t	name;	dns_fixedname_t	origin;	dns_fixedname_t	fullname1;	dns_fixedname_t	fullname2;	cnt = 0;	nprobs = 0;	do {		if (cnt == 0) {			dns_fixedname_init(&name);			dns_fixedname_init(&origin);			dns_result = dns_rbtnodechain_first(chain, rbt,						dns_fixedname_name(&name),						dns_fixedname_name(&origin));			if (dns_result != DNS_R_NEWORIGIN) {				t_info("dns_rbtnodechain_first returned %s, "				       "expecting DNS_R_NEWORIGIN/n",				       dns_result_totext(dns_result));				++nprobs;				break;			}			t_info("first name:/t<%s>/n", fixedname_totext(&name));			t_info("first origin:/t<%s>/n",			       fixedname_totext(&origin));		} else {			dns_fixedname_init(&fullname1);			dns_result = dns_name_concatenate(			       dns_fixedname_name(&name),			       dns_name_isabsolute(dns_fixedname_name(&name)) ?					    NULL : dns_fixedname_name(&origin),			       dns_fixedname_name(&fullname1), NULL);			if (dns_result != ISC_R_SUCCESS) {				t_info("dns_name_concatenate failed %s/n",				       dns_result_totext(dns_result));				++nprobs;				break;			}			/*			 * Expecting origin not to get touched if next			 * doesn't return NEWORIGIN.			 */			dns_fixedname_init(&name);			dns_result = dns_rbtnodechain_next(chain,						  dns_fixedname_name(&name),						  dns_fixedname_name(&origin));			if ((dns_result != ISC_R_SUCCESS) &&			    (dns_result != DNS_R_NEWORIGIN)) {				if (dns_result != ISC_R_NOMORE) {					t_info("dns_rbtnodechain_next "					       "failed %s/n",					       dns_result_totext(dns_result));					++nprobs;				}				break;			}			t_info("next name:/t<%s>/n", fixedname_totext(&name));			t_info("next origin:/t<%s>/n",			       fixedname_totext(&origin));			dns_fixedname_init(&fullname2);			dns_result = dns_name_concatenate(			       dns_fixedname_name(&name),			       dns_name_isabsolute(dns_fixedname_name(&name)) ?					    NULL : dns_fixedname_name(&origin),			       dns_fixedname_name(&fullname2), NULL);			if (dns_result != ISC_R_SUCCESS) {				t_info("dns_name_concatenate failed %s/n",				       dns_result_totext(dns_result));				++nprobs;				break;			}			t_info("comparing/t<%s>/n",			       fixedname_totext(&fullname1));			t_info("/twith/t<%s>/n", fixedname_totext(&fullname2));			(void)dns_name_fullcompare(						dns_fixedname_name(&fullname1),						dns_fixedname_name(&fullname2),						&order, &nlabels);			if (order >= 0) {			    t_info("unexpected order %s %s %s/n",			       dnsname_totext(dns_fixedname_name(&fullname1)),			       order == -1 ? "<" : (order == 0 ? "==" : ">"),			       dnsname_totext(dns_fixedname_name(&fullname2)));				++nprobs;			}//.........这里部分代码省略.........
开发者ID:pombredanne,项目名称:NetBSD,代码行数:101,


示例24: test_rbt_gen

static inttest_rbt_gen(char *filename, char *command, char *testname,	     isc_result_t exp_result){	int		rval;	int		result;	dns_rbt_t	*rbt;	isc_result_t	isc_result;	isc_result_t	dns_result;	isc_mem_t	*mctx;	isc_entropy_t	*ectx;	dns_name_t	*dns_name;	result = T_UNRESOLVED;	if (strcmp(command, "create") != 0)		t_info("testing using name %s/n", testname);	mctx = NULL;	ectx = NULL;	isc_result = isc_mem_create(0, 0, &mctx);	if (isc_result != ISC_R_SUCCESS) {		t_info("isc_mem_create: %s: exiting/n",		       dns_result_totext(isc_result));		return(T_UNRESOLVED);	}	isc_result = isc_entropy_create(mctx, &ectx);	if (isc_result != ISC_R_SUCCESS) {		t_info("isc_entropy_create: %s: exiting/n",		       dns_result_totext(isc_result));		isc_mem_destroy(&mctx);		return(T_UNRESOLVED);	}	isc_result = isc_hash_create(mctx, ectx, DNS_NAME_MAXWIRE);	if (isc_result != ISC_R_SUCCESS) {		t_info("isc_hash_create: %s: exiting/n",		       dns_result_totext(isc_result));		isc_entropy_detach(&ectx);		isc_mem_destroy(&mctx);		return(T_UNRESOLVED);	}	rbt = NULL;	if (rbt_init(filename, &rbt, mctx) != 0) {		if (strcmp(command, "create") == 0)			result = T_FAIL;		isc_hash_destroy();		isc_entropy_detach(&ectx);		isc_mem_destroy(&mctx);		return(result);	}	/*	 * Now try the database command.	 */	if (strcmp(command, "create") == 0) {		result = T_PASS;	} else if (strcmp(command, "add") == 0) {		if (create_name(testname, mctx, &dns_name) == 0) {			dns_result = dns_rbt_addname(rbt, dns_name, dns_name);			if (dns_result != ISC_R_SUCCESS)				delete_name(dns_name, mctx);			if (dns_result == exp_result) {				if (dns_result == ISC_R_SUCCESS) {					rval = t1_search(testname, rbt, mctx,							 &dns_result);					if (rval == 0) {					     if (dns_result == ISC_R_SUCCESS) {						     result = T_PASS;					     } else {						     result = T_FAIL;					     }					} else {						t_info("t1_search failed/n");						result = T_UNRESOLVED;					}				} else {					result = T_PASS;				}			} else {				t_info("dns_rbt_addname returned %s, "				       "expected %s/n",				       dns_result_totext(dns_result),				       dns_result_totext(exp_result));				result = T_FAIL;			}		} else {			t_info("create_name failed/n");			result = T_UNRESOLVED;		}	} else if ((strcmp(command, "delete") == 0) ||		   (strcmp(command, "nuke") == 0)) {		rval = t1_delete(testname, rbt, mctx, &dns_result);		if (rval == 0) {			if (dns_result == exp_result) {//.........这里部分代码省略.........
开发者ID:pombredanne,项目名称:NetBSD,代码行数:101,


示例25: t_timers5

static intt_timers5(void) {	char		*p;	int		result;	isc_mem_t	*mctx;	isc_taskmgr_t	*tmgr;	unsigned int	workers;	isc_result_t	isc_result;	isc_timermgr_t	*timermgr;	isc_event_t	*event;	isc_time_t	expires;	isc_interval_t	interval;	T5_startflag = 0;	T5_shutdownflag = 0;	T5_eventcnt = 0;	workers = 2;	p = t_getenv("ISC_TASK_WORKERS");	if (p != NULL)		workers = atoi(p);	mctx = NULL;	isc_result = isc_mem_create(0, 0, &mctx);	if (isc_result != ISC_R_SUCCESS) {		t_info("isc_mem_create failed %s/n",		       isc_result_totext(isc_result));		return(T_UNRESOLVED);	}	isc_result = isc_mutex_init(&T5_mx);	if (isc_result != ISC_R_SUCCESS) {		t_info("isc_mutex_init failed %s/n",		       isc_result_totext(isc_result));		isc_mem_destroy(&mctx);		return(T_UNRESOLVED);	}	isc_result = isc_condition_init(&T5_cv);	if (isc_result != ISC_R_SUCCESS) {		t_info("isc_condition_init failed %s/n",		       isc_result_totext(isc_result));		DESTROYLOCK(&T5_mx);		isc_mem_destroy(&mctx);		return(T_UNRESOLVED);	}	tmgr = NULL;	isc_result = isc_taskmgr_create(mctx, workers, 0, &tmgr);	if (isc_result != ISC_R_SUCCESS) {		t_info("isc_taskmgr_create failed %s/n",		       isc_result_totext(isc_result));		DESTROYLOCK(&T5_mx);		(void) isc_condition_destroy(&T5_cv);		isc_mem_destroy(&mctx);		return(T_UNRESOLVED);	}	timermgr = NULL;	isc_result = isc_timermgr_create(mctx, &timermgr);	if (isc_result != ISC_R_SUCCESS) {		t_info("isc_timermgr_create failed %s/n",		       isc_result_totext(isc_result));		isc_taskmgr_destroy(&tmgr);		DESTROYLOCK(&T5_mx);		(void) isc_condition_destroy(&T5_cv);		isc_mem_destroy(&mctx);		return(T_UNRESOLVED);	}	T5_task1 = NULL;	isc_result = isc_task_create(tmgr, 0, &T5_task1);	if (isc_result != ISC_R_SUCCESS) {		t_info("isc_task_create failed %s/n",		       isc_result_totext(isc_result));		isc_timermgr_destroy(&timermgr);		isc_taskmgr_destroy(&tmgr);		DESTROYLOCK(&T5_mx);		(void) isc_condition_destroy(&T5_cv);		isc_mem_destroy(&mctx);		return(T_UNRESOLVED);	}	isc_result = isc_task_onshutdown(T5_task1, t5_shutdown_event, NULL);	if (isc_result != ISC_R_SUCCESS) {		t_info("isc_task_onshutdown failed %s/n",		       isc_result_totext(isc_result));		isc_timermgr_destroy(&timermgr);		isc_task_destroy(&T5_task1);		isc_taskmgr_destroy(&tmgr);		DESTROYLOCK(&T5_mx);		(void) isc_condition_destroy(&T5_cv);		isc_mem_destroy(&mctx);		return(T_UNRESOLVED);	}	T5_task2 = NULL;	isc_result = isc_task_create(tmgr, 0, &T5_task2);	if (isc_result != ISC_R_SUCCESS) {		t_info("isc_task_create failed %s/n",//.........这里部分代码省略.........
开发者ID:jhbsz,项目名称:netbsd,代码行数:101,


示例26: tx_te

static voidtx_te(isc_task_t *task, isc_event_t *event) {	isc_result_t	isc_result;	isc_time_t	now;	isc_time_t	base;	isc_time_t	ulim;	isc_time_t	llim;	isc_interval_t	interval;	isc_eventtype_t	expected_event_type;	++Tx_eventcnt;	t_info("tick %d/n", Tx_eventcnt);	expected_event_type = ISC_TIMEREVENT_LIFE;	if ((isc_timertype_t) event->ev_arg == isc_timertype_ticker)		expected_event_type = ISC_TIMEREVENT_TICK;	if (event->ev_type != expected_event_type) {		t_info("expected event type %d, got %d/n",			expected_event_type, (int) event->ev_type);		++Tx_nfails;	}	isc_result = isc_time_now(&now);	if (isc_result == ISC_R_SUCCESS) {		interval.seconds = Tx_seconds;		interval.nanoseconds = Tx_nanoseconds;		isc_result = isc_time_add(&Tx_lasttime, &interval, &base);		if (isc_result != ISC_R_SUCCESS) {			t_info("isc_time_add failed %s/n",			       isc_result_totext(isc_result));			++Tx_nprobs;		}	} else {		t_info("isc_time_now failed %s/n",			isc_result_totext(isc_result));		++Tx_nprobs;	}	if (isc_result == ISC_R_SUCCESS) {		interval.seconds = Tx_FUDGE_SECONDS;		interval.nanoseconds = Tx_FUDGE_NANOSECONDS;		isc_result = isc_time_add(&base, &interval, &ulim);		if (isc_result != ISC_R_SUCCESS) {			t_info("isc_time_add failed %s/n",			       isc_result_totext(isc_result));			++Tx_nprobs;		}	}	if (isc_result == ISC_R_SUCCESS) {		isc_result = isc_time_subtract(&base, &interval, &llim);		if (isc_result != ISC_R_SUCCESS) {			t_info("isc_time_subtract failed %s/n",			       isc_result_totext(isc_result));			++Tx_nprobs;		}	}	if (isc_result == ISC_R_SUCCESS) {		if (isc_time_compare(&llim, &now) > 0) {			t_info("timer range error: early by "			       "%lu microseconds/n",			       (unsigned long)isc_time_microdiff(&base, &now));			++Tx_nfails;		} else if (isc_time_compare(&ulim, &now) < 0) {			t_info("timer range error: late by "			       "%lu microseconds/n",			       (unsigned long)isc_time_microdiff(&now, &base));			++Tx_nfails;		}		Tx_lasttime = now;	}	if (Tx_eventcnt == Tx_nevents) {		isc_result = isc_time_now(&Tx_endtime);		if (isc_result != ISC_R_SUCCESS) {			t_info("isc_time_now failed %s/n",				isc_result_totext(isc_result));			++Tx_nprobs;		}		isc_timer_detach(&Tx_timer);		isc_task_shutdown(task);	}	isc_event_free(&event);}
开发者ID:jhbsz,项目名称:netbsd,代码行数:88,


示例27: main

//.........这里部分代码省略.........	sa.sa_flags = 0;	sigfillset(&sa.sa_mask);	sa.sa_handler = t_sighandler;	(void)sigaction(SIGINT,  &sa, NULL);	(void)sigaction(SIGALRM, &sa, NULL);	/*	 * Output start stanza to journal.	 */	snprintf(T_buf, sizeof(T_buf), "%s:", argv[0]);	len = strlen(T_buf);	(void) t_getdate(T_buf + len, T_BIGBUF - len);	t_putinfo("S", T_buf);	/*	 * Setup the test environment using the config file.	 */	if (T_config == NULL)		T_config = T_DEFAULT_CONFIG;	t_initconf(T_config);	if (T_debug)		t_dumpconf(T_config);	/*	 * Now invoke all the test cases.	 */	tnum = 0;	pts = &T_testlist[0];	while (*pts->pfv != NULL) {		if (T_tvec[tnum / 8] & (0x01 << (tnum % 8))) {			if (subprocs) {				T_pid = fork();				if (T_pid == 0) {					(*pts->pfv)();					exit(0);				} else if (T_pid > 0) {					T_int = 0;					sa.sa_handler = t_sighandler;					(void)sigaction(SIGALRM, &sa, NULL);					alarm(T_timeout);					deadpid = (pid_t) -1;					while (deadpid != T_pid) {					    deadpid =						    waitpid(T_pid, &status, 0);					    if (deadpid == T_pid) {						    if (WIFSIGNALED(status)) {							if (WTERMSIG(status) ==							    SIGTERM)								t_info(						  "the test case timed out/n");							else								t_info(					 "the test case caused exception %d/n",							     WTERMSIG(status));							t_result(T_UNRESOLVED);						    }					    } else if ((deadpid == -1) &&						       (errno == EINTR) &&						       T_int) {						    kill(T_pid, SIGTERM);						    T_int = 0;					    }					    else if ((deadpid == -1) &&						     ((errno == ECHILD) ||						      (errno == ESRCH)))						    break;					}					alarm(0);					sa.sa_handler = SIG_IGN;					(void)sigaction(SIGALRM, &sa, NULL);				} else {					t_info("fork failed, errno == %d/n",					       errno);					t_result(T_UNRESOLVED);				}			}			else {				(*pts->pfv)();			}		}		++pts;		++tnum;	}	snprintf(T_buf, sizeof(T_buf), "%s:", argv[0]);	len = strlen(T_buf);	(void) t_getdate(T_buf + len, T_BIGBUF - len);	t_putinfo("E", T_buf);	return(0);}
开发者ID:Leon555,项目名称:Mac-src-essentials,代码行数:101,


示例28: t_dns_rbtnodechain_last

static intt_dns_rbtnodechain_last(char *dbfile, char *expected_lastname,			char *expected_lastorigin,			char *expected_prevname,			char *expected_prevorigin){	int			result;	int			nfails;	dns_rbt_t		*rbt;	dns_rbtnodechain_t	chain;	isc_mem_t		*mctx;	isc_entropy_t		*ectx;	isc_result_t		isc_result;	isc_result_t		dns_result;	dns_fixedname_t		dns_name;	dns_fixedname_t		dns_origin;	isc_result_t		expected_result;	result = T_UNRESOLVED;	nfails = 0;	mctx = NULL;	ectx = NULL;	dns_fixedname_init(&dns_name);	dns_fixedname_init(&dns_origin);	isc_result = isc_mem_create(0, 0, &mctx);	if (isc_result != ISC_R_SUCCESS) {		t_info("isc_mem_create failed %s/n",		       isc_result_totext(isc_result));		return(result);	}	isc_result = isc_entropy_create(mctx, &ectx);	if (isc_result != ISC_R_SUCCESS) {		t_info("isc_entropy_create: %s: exiting/n",		       dns_result_totext(isc_result));		isc_mem_destroy(&mctx);		return(T_UNRESOLVED);	}	isc_result = isc_hash_create(mctx, ectx, DNS_NAME_MAXWIRE);	if (isc_result != ISC_R_SUCCESS) {		t_info("isc_hash_create: %s: exiting/n",		       dns_result_totext(isc_result));		isc_entropy_detach(&ectx);		isc_mem_destroy(&mctx);		return(T_UNRESOLVED);	}	dns_rbtnodechain_init(&chain, mctx);	rbt = NULL;	if (rbt_init(dbfile, &rbt, mctx)) {		t_info("rbt_init %s failed/n", dbfile);		isc_hash_destroy();		isc_entropy_detach(&ectx);		isc_mem_destroy(&mctx);		return(result);	}	t_info("testing for last name of %s, origin of %s/n",	       expected_lastname, expected_lastorigin);	dns_result = dns_rbtnodechain_last(&chain, rbt,					   dns_fixedname_name(&dns_name),					   dns_fixedname_name(&dns_origin));	if (dns_result != DNS_R_NEWORIGIN) {		t_info("dns_rbtnodechain_last unexpectedly returned %s/n",		       dns_result_totext(dns_result));	}	nfails += t_namechk(dns_result, &dns_name, expected_lastname,			    &dns_origin, expected_lastorigin, DNS_R_NEWORIGIN);	t_info("testing for previous name of %s, origin of %s/n",	       expected_prevname, expected_prevorigin);	dns_fixedname_init(&dns_name);	dns_result = dns_rbtnodechain_prev(&chain,					   dns_fixedname_name(&dns_name),					   dns_fixedname_name(&dns_origin));	if ((dns_result != ISC_R_SUCCESS) &&	    (dns_result != DNS_R_NEWORIGIN)) {		t_info("dns_rbtnodechain_prev unexpectedly returned %s/n",		       dns_result_totext(dns_result));	}	if (strcasecmp(expected_lastorigin, expected_prevorigin) == 0)		expected_result = ISC_R_SUCCESS;	else		expected_result = DNS_R_NEWORIGIN;	nfails += t_namechk(dns_result, &dns_name, expected_prevname,			    &dns_origin, expected_prevorigin, expected_result);	if (nfails)		result = T_FAIL;	else//.........这里部分代码省略.........
开发者ID:pombredanne,项目名称:NetBSD,代码行数:101,



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


C++ t_lex函数代码示例
C++ t_getbytes函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。