Exemplo n.º 1
0
int main(int argc, char *argv[])
{
  int n;
  int size;

  prog_name = argv[0];

  if (argc != 4) {
    printf("%s: %s num size dir\n", prog_name, prog_name);
    exit(1);
  }

  n = atoi(argv[1]);
  size = atoi(argv[2]);
  topdir = argv[3];

  printf("%s %d %d %s\n", prog_name, n, size, topdir);

  creat_dir();
  
  printstats(topdir, 1);
  
  creat_test(n, size);
  
  printstats(topdir, 0);

  read_test(n, size);
  delete_test(n);

  unlink("t");
  return 0;
}
int main(int argc, char *argv[])
{
    HTEST *hTest = NULL;
    OMX_STRING component = NULL;
    OMX_STRING dump_file = NULL;

    if(argc < 2) {
        printf("Usage: ./bin <dump_file>\n");
        return 0;
    }
    
    OMX_Init();
    component = "OMX.Freescale.std.video_source.v4l.sw-based";
    dump_file = argv[1];
    hTest = create_test(component, dump_file);
    hTest->media_name = argv[1];
    if(hTest == NULL) {
        printf("Create test failed.\n");
        return 0;
    }
            
    load_component(hTest);
    StateTrans(hTest, (OMX_STATETYPE)2);
    StateTrans(hTest, (OMX_STATETYPE)3);
    cmd_process(hTest);
    delete_test(hTest);
    OMX_Deinit();

    return 1;
}
int main(int argc, char *argv[])
{
    HTEST *hTest = NULL;
    OMX_STRING component = NULL;
    OMX_STRING in_file = NULL, out_file = NULL;
	OMX_S32 width, height, bitrate;
    FORMAT fmt;

    if(argc < 6) {
        printf("Unit test of vpu encoder component.\n");
        printf("This test read data from in_file then store the encoded data to out_file.\n");
        printf("Usage: ./bin <in_file> <width> <height> <out_file> <bitrate>\n");
        return 0;
    }

    OMX_Init();
    in_file = argv[1];
	width = atoi(argv[2]);
	height = atoi(argv[3]);
    out_file = argv[4];
	bitrate = atoi(argv[5]);
	fmt = H264;
	if (fmt == H264) {
		component = "OMX.Freescale.std.video_encoder.avc.hw-based";
	} else if (fmt == H263) {
		component = "OMX.Freescale.std.video_encoder.h263.hw-based";
	} else {
		printf("wrong format.\n");
		return 0;
	}
    hTest = create_test(component, in_file, width, height, out_file, fmt, bitrate);
    if(hTest == NULL) {
        printf("Create test failed.\n");
        return 0;
    }

    load_component(hTest);
    StateTrans(hTest, OMX_StateIdle);
    StateTrans(hTest, OMX_StateExecuting);
    wait_eos(hTest);
    StateTrans(hTest, OMX_StateIdle);
    StateTrans(hTest, OMX_StateLoaded);
    unload_component(hTest);

    delete_test(hTest);
    OMX_Deinit();

    printf("Vpu component test is done.\n");

    return 1;
}
int main(int argc, char *argv[])
{
	HTEST *hTest = NULL;
	OMX_STRING component = NULL;
	OMX_STRING in_file = NULL, out_file = NULL;
	FORMAT fmt;

	if(argc < 4)
	{
		printf("Unit test of vpu component.\n");
		printf("This test read data from in_file then store the decoded data to out_file.\n");
		printf("Usage: ./bin <in_file> <out_file> <format>\n");
		printf("format: 0 -- mpeg4\n");
		printf("        1 -- h264\n");
		return 0;
	}

	OMX_Init();
	component = "OMX.Freescale.std.video_decoder.avc.v3.hw-based";
	in_file = argv[1];
	out_file = argv[2];
	fmt = (FORMAT) atoi(argv[3]);
	hTest = create_test(component, in_file, out_file, fmt);
	if(hTest == NULL)
	{
		printf("Create test failed.\n");
		return 0;
	}

#if 1
	load_component(hTest);
	StateTrans(hTest, OMX_StateIdle);
	StateTrans(hTest, OMX_StateExecuting);
	wait_eos(hTest);
	StateTrans(hTest, OMX_StateIdle);
	StateTrans(hTest, OMX_StateLoaded);
	unload_component(hTest);
#else
	cmd_process(hTest);
#endif

	delete_test(hTest);
	OMX_Deinit();

	printf("Vpu component test is done.\n");

	return 1;
}
Exemplo n.º 5
0
int
main(void)
{
#ifdef PET
    pet_test();
    printf("-==PET test OK==-\n");
#else
    decrease_key_test();
    printf("-==decrease_key test OK==-\n");
    delete_test();
    printf("-==delete test OK==-\n");
    delete_min_test();
    printf("-==delete_min test OK==-\n");
    timer_test();
    printf("-==timer test OK==-\n");
#endif
    return 0;
}
IntegralTest::~IntegralTest()
{
     std::for_each( testList_.begin(), testList_.end(), delete_test() );
}
Exemplo n.º 7
0
main(int argc, char *argv[])
{
	int rval = -1, nsess = 8, nmedia = 2, nstreams = 3, level = 0;
	int cc = 0;
	extern char *optarg;
	extern int optind;
	char *uuid = NULL;
	char *label = NULL;
	hi op = BULL;

	progname = argv[0];
	sesfile = "sessions";
	ASSERT( argc > 1 );
	
	mlog_init( argc, argv );

	if (! inv_DEBUG_print(argc, argv))
		return 0;
	
	optind = 1;
	optarg = 0;

	while( ( cc = getopt( argc, argv, GETOPT_CMDSTRING)) != EOF ) {
		switch ( cc ) {
		      case 'w':
			op = WRI;
			break;
		      case 'r':
			op = REC;	
			break;
			
		      case 'q':
			op = QUE;			
			break;
			
		      case 'd':
			op = DEL;			
			break;

		      case 'z':
			op = MP;
			break;
			
		      case 'g':
			op = QUE2;
			break;

		      case 'u':
			uuid = optarg;
			break;

		      case 'L':
			label = optarg;
			break;

		      case 's':
			nsess = atoi(optarg);
			break;
			
		      case 'l':
			level = atoi(optarg);
			break;

		      case 't':
			nstreams = atoi(optarg);
			break;
			
		      case 'm':
			nmedia = atoi( optarg );
			break;
		      case 'v':
			break;
			
		      case 'f':
			sesfile = optarg;
			break;

		      default:
			usage(); 
			break;
		}
	}
	
	
	if ( op == WRI )
		rval = write_test( nsess, nstreams, nmedia, level );
	else if ( op == QUE )
		rval = query_test( level );
	else if ( op == REC )
		rval = recons_test( nsess );
	else if ( op == DEL )
		rval = delete_test( nsess );
	else if ( op == MP )
		rval = mp_test (nstreams);
	else if ( op == QUE2 ) {
		if (uuid)
			rval = sess_queries_byuuid(uuid);
		else if (label)
			rval = sess_queries_bylabel(label);
		}	
	else
		usage();
		
	if (rval < 0 )
		printf( "aborted\n");
	else
		printf( "done\n" );


}