Пример #1
0
static void
nextinit(int brace)
{
	if (!brace) {
		if (initstk->i_type == NULL &&
		    !issclt(initstk->i_subt->t_tspec)) {
			/* {}-enclosed initializer required */
			error(181);
		}
		/*
		 * Make sure an entry with a scalar type is at the top
		 * of the stack.
		 */
		if (!initerr)
			testinit();
		while (!initerr && (initstk->i_type == NULL ||
				    !issclt(initstk->i_type->t_tspec))) {
			if (!initerr)
				pushinit();
		}
	} else {
		if (initstk->i_type != NULL &&
		    issclt(initstk->i_type->t_tspec)) {
			/* invalid initializer */
			error(176);
			initerr = 1;
		}
		if (!initerr)
			testinit();
		if (!initerr)
			pushinit();
		if (!initerr)
			initstk->i_brace = 1;
	}
}
int main(int argc, char **argv) {
	gint r = 0;
	chassis_log *log = NULL;

	/*g_thread_init(NULL);*/
	g_test_init(&argc, &argv, NULL);
	g_test_bug_base("http://bugs.mysql.com/");

	log = chassis_log_new();
	log->min_lvl = G_LOG_LEVEL_DEBUG;
	g_log_set_default_handler(chassis_log_func, log);
	log->log_file_fd = STDERR_FILENO;
	g_log_set_always_fatal (G_LOG_LEVEL_ERROR);

	testinit();

	g_test_add_func("/core/backend/test_adjust_backend", test_adjust_backend);

	r = g_test_run();

	testclear();
	chassis_log_free(log);

	return r;
}
Пример #3
0
int main(int argc, char *argv[]) {
	int i;
	u4 seed=0xFFFFFFFF;
	// pull a numeric seed from the command line
	if (argc>=2) seed=atoi(argv[1]);
	// print some information
	printf("CSPRNG        : %s\nInternal state: %u bits\nMinimum cycle : 2**%u\nMaximum cycle : 2**%u\nAverage cycle : 2**%u\n",
		mote8_Name(),mote8_StateBits(),mote8_Cycle(),mote8_StateBits(),mote8_StateBits()-2);
	// seed MOTE and mix
	testinit(seed);
	for (i=0;i<56;i++) mote8_Random();
	#ifdef STREAM
	// show some MOD 26 stream output
	for (i=0; i<672; i++) printf("%c",mote8_Random() % 26 + 'A');
	printf("\n");
	#endif
	return 0;
}
Пример #4
0
void testike(void)
{
 unsigned char buf[36]={0,};
 testinit();

 memset(buf, 0, 36);
 setid(1);
 ike_run_acceptor(buf);

 setid(0);
 ike_run_originator(buf);


 setid(1);
 ike_2(buf);
 setid(0);
 ike_3(buf);
 setid(1);
 ike_4(buf);
 stemu(buf);
 ike_6(buf);
 setid(0);
 ike_5(buf);
 setid(1);
 ike_8(buf);
 setid(0);
 ike_7(buf);
 stemu(buf);
 ike_9(buf);
 setid(1);
 ike_10(buf);
 setid(0);
 ike_11(buf);
 ikeres();

}