Ejemplo n.º 1
0
/**
    Run all tests on format library.
**/
static void run_tests( void )
{
    test();
    test_pc();
    test_cC();
    test_n();
    test_s();
    test_p();
    test_di();
    test_bouxX();
    test_eEfFgG();
    test_asterisk();
    test_cont();

    printf( "-----------------------\n"
            "Overall: %s\n", f ? "FAIL" : "PASS" );
}
Ejemplo n.º 2
0
/**
    Run all tests on format library.
**/
static void run_tests( void )
{
    test();
    test_pc();
    test_cC();
    test_n();
    test_s();
    test_p();
    test_di();
    test_bouxX();
    test_eEfFgG();
    test_k();
    test_asterisk();
    test_cont();

    printf( "-----------------------\n"
            "Summary: %s (%u failures)\n", f ? "FAIL" : "PASS", f );
}
Ejemplo n.º 3
0
int
main(int argc, char **argv)
{
    test_create_dynamic() ;
    test_create_static() ;
    test_thread_create() ;
    test_yield() ;
    test_wait() ;
    test_broadcast() ;
    test_pc() ;
    test_pc_big() ;
    test_recursive() ;
    test_sem() ;
    test_lock() ;
    test_func_pointer() ;
    test_ready() ;
    test_kill() ;
    test_reset() ;

    return 0 ;
}
Ejemplo n.º 4
0
static void * case_thread(DirectThread *thread, void *arg)
{
	int ret;
	case_t *caseP = arg;
	bool passflg = false;
	FILE *fp = NULL;
	char command[100];
	struct stat st;
	bool iio_enable;
	
	iio_enable = is_iio_enable();
	printf("iio_enable = %d\n", iio_enable);

	if(caseP->type == 0)
	{
		switch(caseP->index)
		{
			//mem
			case mem:
				sprintf(command, "memtester %s 1 2 > /memerr.log 1> /dev/null", caseP->nod_path);
				// printf("command = %s\n", command);
				ret = system(command);
				// printf("mem ret = %d\n", ret);
				if(!ret && stat("/memerr.log", &st) >= 0) //获取文件信息
				{
					if(st.st_size == 0)
					{
						passflg = true;
					}
				}
				break;
			case ddrsize:
				passflg = test_ddrsize(caseP);
				break;	
			//flash	
			case flash:;
				passflg = test_flash(caseP);
				break;
			//wifi
			case wifi:
				passflg = test_wifi(caseP);
				break;
			case bt:
				passflg = test_bt(caseP);
				break;
			//gsensor	
			case gsensor:
				if(!iio_enable)
					passflg = test_gsensor(caseP);
				else
					passflg = test_iio(caseP, info);
				break;
			case gyro:
				if(!iio_enable)
					passflg = false;
				else
					passflg = test_iio(caseP, info + 1);
				break;
			case comp:
				if(!iio_enable)
					passflg = false;
				else
					passflg = test_iio(caseP, info + 2);
				break;
			case lightsensor:
				passflg = test_lightsensor(caseP);
				break;
			//camera	
			// case camera:
				// passflg = wait_dev_plugin(caseP->nod_path);
				// break;
			//rtc
			case rtc:
				passflg = test_rtc(caseP);
				break;
			case gps:
				passflg = test_gps(caseP);
				break;
			case uart:
				passflg = test_uart(caseP);
				break;
			case ethernet:
				passflg = test_ethernet(caseP);
				break;
		}
	}
	else if(caseP->type == 1)
	{
		switch(caseP->index)
		{
			//sdcard
			case 0:
				passflg = test_mmc(caseP);
				break;
			//usb
			case 1:
				passflg = test_usb(caseP);
				break;
			case 2:
				passflg = test_pc(caseP);
				break;
			//hdmi
			case 3:
				wait_nod_state(caseP, &hdmi_flg);
				//test_hdmi(caseP, &hdmi_flg);
				break;
			//headphone
			case 4:
				wait_nod_state(caseP, &headphone_flg);
				break;
			//key
			case 5:
				passflg = test_key(caseP);
				break;
			//onoff
			case 6:
				passflg = test_key_onff(caseP);
				break;
			//charege
			case 7:
				passflg = test_charge(caseP);
				break;
			//mtv
			case 8:
				passflg = test_mtv(caseP);
				break;
		}
	}
	
	draw_result(caseP, passflg);
}