Esempio n. 1
0
int
main (int argc, char *argv [])
{	int		do_all = 0, test_count = 0 ;

	if (BUFFER_LEN < PIPE_TEST_LEN)
	{	fprintf (stderr, "Error : BUFFER_LEN < PIPE_TEST_LEN.\n\n") ;
		exit (1) ;
	} ;

	if (argc != 2)
	{	fprintf (stderr, "This program cannot be run by itself. It needs\n") ;
		fprintf (stderr, "to be run from the stdio_test program.\n") ;
		exit (1) ;
	} ;

	do_all = ! strcmp (argv [1], "all") ;

	if (do_all || ! strcmp (argv [1], "raw"))
	{	stdin_test	(SF_FORMAT_RAW, PIPE_TEST_LEN) ;
		test_count++ ;
	} ;

	if (do_all || ! strcmp (argv [1], "wav"))
	{	stdin_test	(SF_FORMAT_WAV, PIPE_TEST_LEN) ;
		test_count++ ;
	} ;

	if (do_all || ! strcmp (argv [1], "aiff"))
	{	stdin_test	(SF_FORMAT_AIFF, PIPE_TEST_LEN) ;
		test_count++ ;
	} ;

	if (do_all || ! strcmp (argv [1], "au"))
	{	stdin_test	(SF_FORMAT_AU, PIPE_TEST_LEN) ;
		test_count++ ;
	} ;

	if (do_all || ! strcmp (argv [1], "paf"))
	{	stdin_test	(SF_FORMAT_PAF, PIPE_TEST_LEN) ;
		test_count++ ;
	} ;

	if (do_all || ! strcmp (argv [1], "svx"))
	{	stdin_test	(SF_FORMAT_SVX, PIPE_TEST_LEN) ;
		test_count++ ;
	} ;

	if (do_all || ! strcmp (argv [1], "nist"))
	{	stdin_test	(SF_FORMAT_NIST, PIPE_TEST_LEN) ;
		test_count++ ;
	} ;

	if (do_all || ! strcmp (argv [1], "ircam"))
	{	stdin_test	(SF_FORMAT_IRCAM, PIPE_TEST_LEN) ;
		test_count++ ;
	} ;

	if (do_all || ! strcmp (argv [1], "voc"))
	{	stdin_test	(SF_FORMAT_VOC, PIPE_TEST_LEN) ;
		test_count++ ;
	} ;

	if (do_all || ! strcmp (argv [1], "w64"))
	{	stdin_test	(SF_FORMAT_W64, PIPE_TEST_LEN) ;
		test_count++ ;
	} ;

	if (do_all || ! strcmp (argv [1], "mat4"))
	{	stdin_test	(SF_FORMAT_MAT4, PIPE_TEST_LEN) ;
		test_count++ ;
	} ;

	if (do_all || ! strcmp (argv [1], "mat5"))
	{	stdin_test	(SF_FORMAT_MAT5, PIPE_TEST_LEN) ;
		test_count++ ;
	} ;

	if (do_all || ! strcmp (argv [1], "pvf"))
	{	stdin_test	(SF_FORMAT_PVF, PIPE_TEST_LEN) ;
		test_count++ ;
	} ;

	if (do_all || ! strcmp (argv [1], "htk"))
	{	stdin_test	(SF_FORMAT_HTK, PIPE_TEST_LEN) ;
		test_count++ ;
	} ;

	if (test_count == 0)
	{	fprintf (stderr, "\n*****************************************\n") ;
		fprintf (stderr, "*  stdin_test : No '%s' test defined.\n", argv [1]) ;
		fprintf (stderr, "*****************************************\n") ;
		return 1 ;
	} ;

	return 0 ;
} /* main */
Esempio n. 2
0
int
main (int argc, char *argv [])
{	int	count, bDoAll = 0, nTests = 0 ;

	if (argc != 3 || !(count = atoi (argv [2])))
	{	fprintf (stderr, "This program cannot be run by itself. It needs\n") ;
		fprintf (stderr, "to be run from the stdio_test program.\n") ;
		exit (1) ;
		} ;

	bDoAll = ! strcmp (argv [1], "all") ;

	if (bDoAll || ! strcmp (argv [1], "raw"))
	{	stdin_test	("raw", SF_FORMAT_RAW, count) ;
		nTests++ ;
		} ;

	if (bDoAll || ! strcmp (argv [1], "wav"))
	{	stdin_test	("wav", SF_FORMAT_WAV, count) ;
		nTests++ ;
		} ;

	if (bDoAll || ! strcmp (argv [1], "aiff"))
	{	stdin_test	("aiff", SF_FORMAT_AIFF, count) ;
		nTests++ ;
		} ;

	if (bDoAll || ! strcmp (argv [1], "au"))
	{	stdin_test	("au", SF_FORMAT_AU, count) ;
		nTests++ ;
		} ;

	if (bDoAll || ! strcmp (argv [1], "paf"))
	{	stdin_test	("paf", SF_FORMAT_PAF, count) ;
		nTests++ ;
		} ;

	if (bDoAll || ! strcmp (argv [1], "svx"))
	{	stdin_test	("svx", SF_FORMAT_SVX, count) ;
		nTests++ ;
		} ;

	if (bDoAll || ! strcmp (argv [1], "nist"))
	{	stdin_test	("nist", SF_FORMAT_NIST, count) ;
		nTests++ ;
		} ;

	if (bDoAll || ! strcmp (argv [1], "ircam"))
	{	stdin_test	("ircam", SF_FORMAT_IRCAM, count) ;
		nTests++ ;
		} ;

	if (bDoAll || ! strcmp (argv [1], "voc"))
	{	stdin_test	("voc", SF_FORMAT_VOC, count) ;
		nTests++ ;
		} ;

	if (bDoAll || ! strcmp (argv [1], "w64"))
	{	stdin_test	("w64", SF_FORMAT_W64, count) ;
		nTests++ ;
		} ;

	if (bDoAll || ! strcmp (argv [1], "mat4"))
	{	stdin_test	("mat4", SF_FORMAT_MAT4, count) ;
		nTests++ ;
		} ;

	if (bDoAll || ! strcmp (argv [1], "mat5"))
	{	stdin_test	("mat5", SF_FORMAT_MAT5, count) ;
		nTests++ ;
		} ;

	if (nTests == 0)
	{	printf ("************************************\n") ;
		printf ("*  No '%s' test defined.\n", argv [1]) ;
		printf ("************************************\n") ;
		return 1 ;
		} ;

	return 0;
} /* main */