Add fflush() calls to fuzzershell to keep stderr and stdout synchronized.

FossilOrigin-Name: 2b98a25237d1b3e64aec2772b622e8b3be2df454
This commit is contained in:
drh 2015-04-25 00:20:15 +00:00
parent 048810b63b
commit 9f18f7434e
3 changed files with 21 additions and 9 deletions

View File

@ -1,5 +1,5 @@
C Add\sthe\s--oom\soption\sto\sfuzzershell.
D 2015-04-24T23:45:23.568
C Add\sfflush()\scalls\sto\sfuzzershell\sto\skeep\sstderr\sand\sstdout\ssynchronized.
D 2015-04-25T00:20:15.042
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
F Makefile.in 31b38b9da2e4b36f54a013bd71a5c3f6e45ca78f
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@ -1205,7 +1205,7 @@ F tool/diffdb.c 7524b1b5df217c20cd0431f6789851a4e0cb191b
F tool/extract.c 054069d81b095fbdc189a6f5d4466e40380505e2
F tool/fast_vacuum.c 5ba0d6f5963a0a63bdc42840f678bad75b2ebce1
F tool/fragck.tcl 5265a95126abcf6ab357f7efa544787e5963f439
F tool/fuzzershell.c 96fb9b18a3e77777290b59bee9a2759dab3a8ef9
F tool/fuzzershell.c 2c43450b64facf45668c13757bccf104370bbbde
F tool/genfkey.README cf68fddd4643bbe3ff8e31b8b6d8b0a1b85e20f4
F tool/genfkey.test 4196a8928b78f51d54ef58e99e99401ab2f0a7e5
F tool/getlock.c f4c39b651370156cae979501a7b156bdba50e7ce
@ -1253,7 +1253,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1
F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
P dc88fe7e641c52d27fba8c753cee590db87388c5
R b6b6b08ed6fc824093828aadd4063979
P 14a9e4a377bf2974f5db148c8f86e2c5ffdfa28d
R 4c614aefb4895c61e9e71626f64617fb
U drh
Z 5f3b959ee8a94e01f097246d319ba4ca
Z ca0e19da89eb1b89a5b2a79cf11e1cd5

View File

@ -1 +1 @@
14a9e4a377bf2974f5db148c8f86e2c5ffdfa28d
2b98a25237d1b3e64aec2772b622e8b3be2df454

View File

@ -164,6 +164,7 @@ static void sqlexec(sqlite3 *db, const char *zFormat, ...){
*/
static void shellLog(void *pNotUsed, int iErrCode, const char *zMsg){
printf("LOG: (%d) %s\n", iErrCode, zMsg);
fflush(stdout);
}
/*
@ -181,6 +182,7 @@ static int execCallback(void *NotUsed, int argc, char **argv, char **colv){
printf("NULL\n");
}
}
fflush(stdout);
return 0;
}
static int execNoop(void *NotUsed, int argc, char **argv, char **colv){
@ -194,6 +196,7 @@ static int execNoop(void *NotUsed, int argc, char **argv, char **colv){
*/
static void traceCallback(void *NotUsed, const char *zMsg){
printf("TRACE: %s\n", zMsg);
fflush(stdout);
}
#endif
@ -594,7 +597,10 @@ int main(int argc, char **argv){
char *z = strstr(&zIn[i], ">****/");
if( z ){
z += 6;
if( verboseFlag ) printf("%.*s\n", (int)(z-&zIn[i]), &zIn[i]);
if( verboseFlag ){
printf("%.*s\n", (int)(z-&zIn[i]), &zIn[i]);
fflush(stdout);
}
i += (int)(z-&zIn[i]);
multiTest = 1;
}
@ -617,6 +623,7 @@ int main(int argc, char **argv){
if( verboseFlag ){
printf("INPUT (offset: %d, size: %d): [%s]\n",
i, (int)strlen(&zIn[i]), &zIn[i]);
fflush(stdout);
}else if( multiTest && !quietFlag ){
int pct = oomFlag ? 100*iNext/nIn : ((10*iNext)/nIn)*10;
if( pct!=lastPct ){
@ -641,7 +648,10 @@ int main(int argc, char **argv){
oomCnt = g.iOomCntdown = 1;
g.nOomFault = 0;
g.bOomOnce = 1;
if( verboseFlag ) printf("Once.%d\n", oomCnt);
if( verboseFlag ){
printf("Once.%d\n", oomCnt);
fflush(stdout);
}
}else{
oomCnt = 0;
}
@ -710,6 +720,7 @@ int main(int argc, char **argv){
if( oomCnt ){
if( verboseFlag ){
printf("%s.%d\n", g.bOomOnce ? "Once" : "Multi", oomCnt);
fflush(stdout);
}
nTest++;
}
@ -725,6 +736,7 @@ int main(int argc, char **argv){
if( zErrMsg ){
printf("ERROR-MSG: [%s]\n", zErrBuf);
}
fflush(stdout);
}
/* Simulate an error if the TEST_FAILURE environment variable is "5" */
if( zFailCode ){