/* *************************************
* Special i/o constants
**************************************/
-#define nullString "null"
#define stdinmark "stdin"
#define stdoutmark "stdout"
#ifdef _WIN32
$ZSTD -t *.zst
$ECHO "test good and bad files (*) "
$ZSTD -t * && die "bad files not detected !"
+$ECHO "test --rm and --test combined "
+$ZSTD -t --rm tmp1.zst
+ls -ls tmp1.zst # check file is still present
$ECHO "\n**** zstd round-trip tests **** "
int argNb,
bench=0,
decode=0,
+ testmode=0,
forceStdout=0,
main_pause=0,
nextEntryIsDictionary=0,
if (!strcmp(argument, "--no-dictID")) { FIO_setDictIDFlag(0); continue; }
if (!strcmp(argument, "--sparse")) { FIO_setSparseWrite(2); continue; }
if (!strcmp(argument, "--no-sparse")) { FIO_setSparseWrite(0); continue; }
- if (!strcmp(argument, "--test")) { decode=1; outFileName=nulmark; FIO_overwriteMode(); continue; }
+ if (!strcmp(argument, "--test")) { testmode=1; decode=1; continue; }
if (!strcmp(argument, "--train")) { dictBuild=1; outFileName=g_defaultDictName; continue; }
if (!strcmp(argument, "--maxdict")) { nextArgumentIsMaxDict=1; continue; }
if (!strcmp(argument, "--dictID")) { nextArgumentIsDictID=1; continue; }
case 'C': argument++; FIO_setChecksumFlag(2); break;
/* test compressed file */
- case 't': decode=1; outFileName=nulmark; argument++; break;
+ case 't': testmode=1; decode=1; argument++; break;
/* destination file name */
case 'o': nextArgumentIsOutFileName=1; argument++; break;
#endif
{ /* decompression */
#ifndef ZSTD_NODECOMPRESS
+ if (testmode) { outFileName=nulmark; FIO_setRemoveSrcFile(0); } /* test mode */
if (filenameIdx==1 && outFileName)
operationResult = FIO_decompressFilename(outFileName, filenameTable[0], dictFileName);
else