Ejemplo n.º 1
0
int sock_test()
{
    int rc;
    
    pj_create_random_string(bigdata, BIG_DATA_LEN);

    rc = format_test();
    if (rc != 0)
	return rc;

    rc = gethostbyname_test();
    if (rc != 0)
	return rc;

    rc = simple_sock_test();
    if (rc != 0)
	return rc;

    rc = ioctl_test();
    if (rc != 0)
	return rc;

    rc = udp_test();
    if (rc != 0)
	return rc;

    rc = tcp_test();
    if (rc != 0)
	return rc;

    return 0;
}
Ejemplo n.º 2
0
int main(int argc, char *argv[])
{
	int dsp, mixer, retval = 0, i;

	printf("Winbond W90N745 Audio Module Test Code, written by QFu\n");

	printf("\nSelect Device : \n");
	for(i = 0; i< 2; i++){
		printf("%d. %s and %s (%s)\n", i,
			dsp_device[i], mixer_device[i],
			interface_type[i]);
	}
	printf("\nEnter your choice:");
	scanf("%d", &choice);
	getchar();

	if(choice <0 || choice >1)
		return 0;

	dsp = open(dsp_device[choice], O_RDWR);
	if( dsp < 0 ){
		printf("Open device %s error\n", dsp_device[choice]);
		return -1;
	}

	mixer = open(mixer_device[choice], O_RDWR);
	if ( mixer < 0){
		printf("Open %s error\n", mixer_device[choice]);
		return -1;
	}

	retval = ioctl_test(dsp, mixer);
	printf("***IOCTRL Test ... %s\n", retval?"Failed":"Pass");
	if (retval) goto quit;

	retval = 	play_test(dsp);
	printf("***Play And SampleRate Test ... %s\n", retval?"Failed":"Pass");
	if (retval) goto quit;

	retval = mixer_test(dsp, mixer);
	printf("***Mixer Volume  Test ... %s\n", retval?"Failed":"Pass");
	if (retval) goto quit;

	retval = record_test(dsp, mixer);
	printf("***Record Test .. %s\n", retval?"Failed":"Pass");
	if ( retval)goto quit;

	retval = poll_test(dsp);
	printf("***None Block Mode & Poll Mode Test ... %s\n", retval?"Failed":"Pass");
	if (retval) goto quit;

quit:

	close(dsp);

	return retval;

}
Ejemplo n.º 3
0
int sock_test()
{
    int rc;
    
    pj_create_random_string(bigdata, BIG_DATA_LEN);

// Enable this to demonstrate the error witn S60 3rd Edition MR2
#if 0
    rc = connect_test();
    if (rc != 0)
    	return rc;
#endif
    
    rc = format_test();
    if (rc != 0)
	return rc;

    rc = parse_test();
    if (rc != 0)
	return rc;

    rc = purity_test();
    if (rc != 0)
	return rc;

    rc = gethostbyname_test();
    if (rc != 0)
	return rc;

    rc = simple_sock_test();
    if (rc != 0)
	return rc;

    rc = ioctl_test();
    if (rc != 0)
	return rc;

    rc = udp_test();
    if (rc != 0)
	return rc;

    rc = tcp_test();
    if (rc != 0)
	return rc;

    return 0;
}