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

Add tests to quota.test.

FossilOrigin-Name: ec9af6ebd49505c4e5f90fb6450c71946cdc7291
This commit is contained in:
dan
2010-09-01 18:00:09 +00:00
parent 9fc7702c4f
commit 06bfd36a2d
4 changed files with 140 additions and 13 deletions

View File

@@ -832,6 +832,7 @@ static int test_quota_set(
TclQuotaCallback *p; /* Callback object */
int nScript; /* Length of callback script */
void (*xDestroy)(void*); /* Optional destructor for pArg */
void (*xCallback)(const char *, sqlite3_int64 *, sqlite3_int64, void *);
/* Process arguments */
if( objc!=4 ){
@@ -855,13 +856,15 @@ static int test_quota_set(
Tcl_IncrRefCount(pScript);
p->pScript = pScript;
xDestroy = tclCallbackDestructor;
xCallback = tclQuotaCallback;
}else{
p = 0;
xDestroy = 0;
xCallback = 0;
}
/* Invoke sqlite3_quota_set() */
rc = sqlite3_quota_set(zPattern, iLimit, tclQuotaCallback, (void*)p,xDestroy);
rc = sqlite3_quota_set(zPattern, iLimit, xCallback, (void*)p, xDestroy);
Tcl_SetResult(interp, (char *)sqlite3TestErrorName(rc), TCL_STATIC);
return TCL_OK;