mirror of
https://github.com/xiph/opus.git
synced 2025-05-30 07:07:42 +00:00
Testing tools improvements (no impact on draft)
This commit is contained in:
parent
10ebc02ecf
commit
e699c1989c
6 changed files with 44 additions and 11 deletions
|
@ -91,7 +91,7 @@ int test_decoder_code0(void)
|
|||
}
|
||||
}
|
||||
|
||||
decsize=opus_decoder_get_size(2);
|
||||
decsize=opus_decoder_get_size(1);
|
||||
decbak=(OpusDecoder *)malloc(decsize);
|
||||
if(decbak==NULL)test_failed();
|
||||
|
||||
|
@ -335,19 +335,30 @@ int test_decoder_code0(void)
|
|||
int main(int _argc, char **_argv)
|
||||
{
|
||||
const char * oversion;
|
||||
const char * env_seed;
|
||||
int env_used;
|
||||
|
||||
if(_argc>2)
|
||||
{
|
||||
fprintf(stderr,"Usage: %s [<seed>]\n",_argv[0]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
env_used=0;
|
||||
env_seed=getenv("SEED");
|
||||
if(_argc>1)iseed=atoi(_argv[1]);
|
||||
else if(env_seed)
|
||||
{
|
||||
iseed=atoi(env_seed);
|
||||
env_used=1;
|
||||
}
|
||||
else iseed=(opus_uint32)time(NULL)^((getpid()&65535)<<16);
|
||||
Rw=Rz=iseed;
|
||||
|
||||
oversion=opus_get_version_string();
|
||||
if(!oversion)test_failed();
|
||||
fprintf(stderr,"Testing %s decoder. Random seed: %u (%.4X)\n", oversion, iseed, fast_rand() % 65535);
|
||||
if(env_used)fprintf(stderr," Random seed set from the environment (SEED=%s).\n", env_seed);
|
||||
|
||||
test_decoder_code0();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue