1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-08 14:02:16 +03:00

Improve test coverage of util.c (CVS 1773)

FossilOrigin-Name: 68ac32213766c5e83de54373b90030a458538017
This commit is contained in:
drh
2004-06-30 04:02:11 +00:00
parent cc19587998
commit 9d213ef022
7 changed files with 75 additions and 61 deletions

View File

@@ -13,7 +13,7 @@
** is not included in the SQLite library. It is used for automated
** testing of the SQLite library.
**
** $Id: test3.c,v 1.47 2004/06/30 02:35:51 danielk1977 Exp $
** $Id: test3.c,v 1.48 2004/06/30 04:02:12 drh Exp $
*/
#include "sqliteInt.h"
#include "pager.h"
@@ -1279,6 +1279,23 @@ static int btree_varint_test(
Tcl_AppendResult(interp, zErr, 0);
return TCL_ERROR;
}
if( (in & 0xffffffff)==in ){
u32 out32;
n2 = sqlite3GetVarint32(zBuf, &out32);
out = out32;
if( n1!=n2 ){
sprintf(zErr, "PutVarint returned %d and GetVarint32 returned %d",
n1, n2);
Tcl_AppendResult(interp, zErr, 0);
return TCL_ERROR;
}
if( in!=out ){
sprintf(zErr, "Wrote 0x%016llx and got back 0x%016llx from GetVarint32",
in, out);
Tcl_AppendResult(interp, zErr, 0);
return TCL_ERROR;
}
}
/* In order to get realistic timings, run getVarint 19 more times.
** This is because getVarint is called about 20 times more often