Esempio n. 1
0
int main( void )
{
	printf( "<test_serial.c> main running! \n" );
	
	serial_test();

	return 0;
}
Esempio n. 2
0
int main( void )
{
	printf( "<main.c> main running! \n" );
	
	serial_test();

	net_test();

	return 0;
}
Esempio n. 3
0
int main (int argc, char **argv) 
{
	size_t l;
	int used = 0;
	int fd, res;
	char buf[1024];
	fd = sock_unix_connect("/var/run/yarrow.socket");
	if (fd <= 0) {
		perror("Sock unix connect");
		exit(1);
	}

	l = 64;
	res = 0;

	printf("sock_unix_connect sock %d\n", fd);

	sprintf(buf, "%u\r\n", l);

	res = write(fd, buf, strlen(buf)+1);
	if(res < 0) {
		perror("Write error");
		
	}

	
/*	res = poll(events,1,50000);
	if (res > 0) {
		printf("events fd %d \n", res);
	}
	else 
		perror("error of poll or timeout");
	
	printf("revents %d\n", events[0].revents);
*/
	l = l*2;
	printf("left %d\n", l);

	while (l) {
		res = read(fd, buf + used, l);	
		l -= res;
		used += res;
	}
	printf("Raed from server %d res %d buf: %s \n", strlen(buf), used, buf);
	monobit_test(buf, used);
	serial_test(buf,used);
	poker_test(buf, used);
	close(fd);

return 0;
}
Esempio n. 4
0
void unit_test(void)
{
#if 0
	//for serial test only
	hardware_init();
	serial_test();
#endif
#if 0
	//for unit test only
	LOOKUP_test();
	SHARPIR_test();
	PID_test();
#endif	
}
Esempio n. 5
0
void
cyg_start(void)
{
    CYG_TEST_INIT();
#ifdef CYGFUN_KERNEL_API_C
    cyg_thread_create(10,                   // Priority - just a number
                      (cyg_thread_entry_t*)serial_test,      // entry
                      (cyg_addrword_t) 0,   // entry data
                      "serial_thread",      // Name
                      &stack[0],            // Stack
                      STACK_SIZE,           // Size
                      &thread_handle,       // Handle
                      &thread_data          // Thread data structure
        );
    cyg_thread_resume(thread_handle);
    cyg_scheduler_start();
#else
    serial_test();
#endif
}