/ Check-in [7b3d2190]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Add fuzzcheck to all makefiles and fix compiler warnings.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | fuzzcheck
Files: files | file ages | folders
SHA1:7b3d21906a9650377cda56b94facdff75b2cb858
User & Date: drh 2015-05-25 22:29:26
Context
2015-05-25
22:38
Add the fuzzcheck test program. check-in: 341cb6ab user: drh tags: trunk
22:29
Add fuzzcheck to all makefiles and fix compiler warnings. Closed-Leaf check-in: 7b3d2190 user: drh tags: fuzzcheck
22:18
Merge in trunk fixes. check-in: c71c2e1a user: drh tags: fuzzcheck
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to Makefile.in.

   551    551   		$(LIBREADLINE) $(TLIBS) -rpath "$(libdir)"
   552    552   
   553    553   sqldiff$(TEXE):	$(TOP)/tool/sqldiff.c sqlite3.c sqlite3.h
   554    554   	$(LTLINK) -o $@ $(TOP)/tool/sqldiff.c	sqlite3.c $(TLIBS)
   555    555   
   556    556   fuzzershell$(TEXE):	$(TOP)/tool/fuzzershell.c sqlite3.c sqlite3.h
   557    557   	$(LTLINK) -o $@ $(TOP)/tool/fuzzershell.c	sqlite3.c $(TLIBS)
          558  +
          559  +fuzzcheck$(TEXE):	$(TOP)/test/fuzzcheck.c sqlite3.c sqlite3.h
          560  +	$(LTLINK) -o $@ $(TOP)/test/fuzzcheck.c	sqlite3.c $(TLIBS)
   558    561   
   559    562   mptester$(TEXE):	sqlite3.c $(TOP)/mptest/mptest.c
   560    563   	$(LTLINK) -o $@ -I. $(TOP)/mptest/mptest.c sqlite3.c \
   561    564   		$(TLIBS) -rpath "$(libdir)"
   562    565   
   563    566   MPTEST1=./mptester$(TEXE) mptest.db $(TOP)/mptest/crash01.test --repeat 20
   564    567   MPTEST2=./mptester$(TEXE) mptest.db $(TOP)/mptest/multiwrite01.test --repeat 20

Changes to Makefile.msc.

  1207   1207   		/link /pdb:sqlite3sh.pdb $(LTLINKOPTS) $(SHELL_LINK_OPTS) $(LTLIBPATHS) $(LIBRESOBJS) $(LIBREADLINE) $(LTLIBS) $(TLIBS)
  1208   1208   
  1209   1209   sqldiff.exe:	$(TOP)\tool\sqldiff.c sqlite3.c sqlite3.h
  1210   1210   	$(LTLINK) $(TOP)\tool\sqldiff.c sqlite3.c
  1211   1211   
  1212   1212   fuzzershell.exe:	$(TOP)\tool\fuzzershell.c sqlite3.c sqlite3.h
  1213   1213   	$(LTLINK) $(TOP)\tool\fuzzershell.c sqlite3.c
         1214  +
         1215  +fuzzcheck.exe:	$(TOP)\test\fuzzcheck.c sqlite3.c sqlite3.h
         1216  +	$(LTLINK) $(TOP)\test\fuzzcheck.c sqlite3.c
  1214   1217   
  1215   1218   mptester.exe:	$(TOP)\mptest\mptest.c $(SHELL_CORE_DEP) $(LIBRESOBJS) sqlite3.h
  1216   1219   	$(LTLINK) $(SHELL_COMPILE_OPTS) $(TOP)\mptest\mptest.c \
  1217   1220   		/link $(LTLINKOPTS) $(LTLIBPATHS) $(SHELL_LINK_OPTS) $(LIBRESOBJS) $(LIBREADLINE) $(LTLIBS) $(TLIBS)
  1218   1221   
  1219   1222   MPTEST1 = mptester mptest.db $(TOP)\mptest\crash01.test --repeat 20
  1220   1223   MPTEST2 = mptester mptest.db $(TOP)\mptest\multiwrite01.test --repeat 20

Changes to test/fuzzcheck.c.

   320    320     VFile *pVFile = pHandle->pVFile;
   321    321     if( iOfst<0 || iOfst>=pVFile->sz ){
   322    322       memset(pData, 0, iAmt);
   323    323       return SQLITE_IOERR_SHORT_READ;
   324    324     }
   325    325     if( iOfst+iAmt>pVFile->sz ){
   326    326       memset(pData, 0, iAmt);
   327         -    iAmt = pVFile->sz - iOfst;
          327  +    iAmt = (int)(pVFile->sz - iOfst);
   328    328       memcpy(pData, pVFile->a, iAmt);
   329    329       return SQLITE_IOERR_SHORT_READ;
   330    330     }
   331    331     memcpy(pData, pVFile->a, iAmt);
   332    332     return SQLITE_OK;
   333    333   }
   334    334   static int inmemWrite(
................................................................................
   339    339   ){
   340    340     VHandle *pHandle = (VHandle*)pFile;
   341    341     VFile *pVFile = pHandle->pVFile;
   342    342     if( iOfst+iAmt > pVFile->sz ){
   343    343       if( iOfst+iAmt >= MX_FILE_SZ ){
   344    344         return SQLITE_FULL;
   345    345       }
   346         -    pVFile->a = safe_realloc(pVFile->a, iOfst+iAmt);
   347         -    memset(pVFile->a + pVFile->sz, 0, iOfst - pVFile->sz);
   348         -    pVFile->sz = iOfst + iAmt;
          346  +    pVFile->a = safe_realloc(pVFile->a, (int)(iOfst+iAmt));
          347  +    memset(pVFile->a + pVFile->sz, 0, (int)(iOfst - pVFile->sz));
          348  +    pVFile->sz = (int)(iOfst + iAmt);
   349    349     }
   350    350     memcpy(pVFile->a + iOfst, pData, iAmt);
   351    351     return SQLITE_OK;
   352    352   }
   353    353   static int inmemTruncate(sqlite3_file *pFile, sqlite3_int64 iSize){
   354    354     VHandle *pHandle = (VHandle*)pFile;
   355    355     VFile *pVFile = pHandle->pVFile;
   356         -  if( pVFile->sz>iSize && iSize>=0 ) pVFile->sz = iSize;
          356  +  if( pVFile->sz>iSize && iSize>=0 ) pVFile->sz = (int)iSize;
   357    357     return SQLITE_OK;
   358    358   }
   359    359   static int inmemSync(sqlite3_file *pFile, int flags){
   360    360     return SQLITE_OK;
   361    361   }
   362    362   static int inmemFileSize(sqlite3_file *pFile, sqlite3_int64 *pSize){
   363    363     *pSize = ((VHandle*)pFile)->pVFile->sz;