mirror of
https://github.com/vgmstream/vgmstream.git
synced 2025-01-18 07:44:43 +01:00
Add test.exe 'file not found' error for clarity
This commit is contained in:
parent
6072d17f50
commit
c60efdfbdf
45
test/test.c
45
test/test.c
@ -64,6 +64,7 @@ int main(int argc, char ** argv) {
|
|||||||
int i,j,k;
|
int i,j,k;
|
||||||
int opt;
|
int opt;
|
||||||
/* config */
|
/* config */
|
||||||
|
char * infilename = NULL;
|
||||||
char * outfilename = NULL;
|
char * outfilename = NULL;
|
||||||
char * outfilename_reset = NULL;
|
char * outfilename_reset = NULL;
|
||||||
int ignore_loop = 0;
|
int ignore_loop = 0;
|
||||||
@ -156,6 +157,15 @@ int main(int argc, char ** argv) {
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
infilename = argv[optind];
|
||||||
|
|
||||||
|
#ifdef WIN32
|
||||||
|
/* make stdout output work with windows */
|
||||||
|
if (play_sdtout) {
|
||||||
|
_setmode(fileno(stdout),_O_BINARY);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (play_forever && !play_sdtout) {
|
if (play_forever && !play_sdtout) {
|
||||||
fprintf(stderr,"A file of infinite size? Not likely.\n");
|
fprintf(stderr,"A file of infinite size? Not likely.\n");
|
||||||
return 1;
|
return 1;
|
||||||
@ -166,13 +176,6 @@ int main(int argc, char ** argv) {
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef WIN32
|
|
||||||
/* make stdout output work with windows */
|
|
||||||
if (play_sdtout) {
|
|
||||||
_setmode(fileno(stdout),_O_BINARY);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (ignore_loop && force_loop) {
|
if (ignore_loop && force_loop) {
|
||||||
fprintf(stderr,"-e and -i are incompatible\n");
|
fprintf(stderr,"-e and -i are incompatible\n");
|
||||||
return 1;
|
return 1;
|
||||||
@ -182,25 +185,27 @@ int main(int argc, char ** argv) {
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
if (force_loop && really_force_loop) {
|
if (force_loop && really_force_loop) {
|
||||||
fprintf(stderr,"-E and -e are somewhat redundant, are you confused?\n");
|
fprintf(stderr,"-E and -e are incompatible\n");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* manually init streamfile to pass the stream index */
|
/* manually init streamfile to pass the stream index */
|
||||||
{
|
{
|
||||||
//s = init_vgmstream(argv[optind]);
|
//s = init_vgmstream(infilename);
|
||||||
STREAMFILE *streamFile = open_stdio_streamfile(argv[optind]);
|
STREAMFILE *streamFile = open_stdio_streamfile(infilename);
|
||||||
if (streamFile) {
|
if (!streamFile) {
|
||||||
streamFile->stream_index = stream_index;
|
fprintf(stderr,"file %s not found\n",infilename);
|
||||||
vgmstream = init_vgmstream_from_STREAMFILE(streamFile);
|
return 1;
|
||||||
close_streamfile(streamFile);
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
streamFile->stream_index = stream_index;
|
||||||
|
vgmstream = init_vgmstream_from_STREAMFILE(streamFile);
|
||||||
|
close_streamfile(streamFile);
|
||||||
|
|
||||||
if (!vgmstream) {
|
if (!vgmstream) {
|
||||||
fprintf(stderr,"failed opening %s\n",argv[optind]);
|
fprintf(stderr,"failed opening %s\n",infilename);
|
||||||
return 1;
|
return 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* force only if there aren't already loop points */
|
/* force only if there aren't already loop points */
|
||||||
@ -274,10 +279,10 @@ int main(int argc, char ** argv) {
|
|||||||
printf("set loop=0\n");
|
printf("set loop=0\n");
|
||||||
}
|
}
|
||||||
else if (print_metaonly) {
|
else if (print_metaonly) {
|
||||||
printf("metadata for %s\n",argv[optind]);
|
printf("metadata for %s\n",infilename);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
printf("decoding %s\n",argv[optind]);
|
printf("decoding %s\n",infilename);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!play_sdtout && !print_adxencd && !print_oggenc && !print_batchvar) {
|
if (!play_sdtout && !print_adxencd && !print_oggenc && !print_batchvar) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user