1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-12 13:01:09 +03:00

Extra tests for commit [0f250957].

FossilOrigin-Name: 5aa522dcb9bfa18d49683f7cc889516984e2bcd2
This commit is contained in:
dan
2015-03-13 08:31:54 +00:00
parent e9b9f7599a
commit 3df3059252
8 changed files with 135 additions and 27 deletions

View File

@@ -600,12 +600,26 @@ static void test_decode(
Tcl_DecrRefCount(pRet);
}
/*
** The implementation of scalar SQL function "test_zeroblob()". This is
** similar to the built-in zeroblob() function, except that it does not
** check that the integer parameter is within range before passing it
** to sqlite3_result_zeroblob().
*/
static void test_zeroblob(
sqlite3_context *context,
int argc,
sqlite3_value **argv
){
int nZero = sqlite3_value_int(argv[0]);
sqlite3_result_zeroblob(context, nZero);
}
static int registerTestFunctions(sqlite3 *db){
static const struct {
char *zName;
signed char nArg;
unsigned char eTextRep; /* 1: UTF-16. 0: UTF-8 */
unsigned int eTextRep; /* 1: UTF-16. 0: UTF-8 */
void (*xFunc)(sqlite3_context*,int,sqlite3_value **);
} aFuncs[] = {
{ "randstr", 2, SQLITE_UTF8, randStr },
@@ -626,6 +640,7 @@ static int registerTestFunctions(sqlite3 *db){
{ "real2hex", 1, SQLITE_UTF8, real2hex},
{ "test_decode", 1, SQLITE_UTF8, test_decode},
{ "test_extract", 2, SQLITE_UTF8, test_extract},
{ "test_zeroblob", 1, SQLITE_UTF8|SQLITE_DETERMINISTIC, test_zeroblob},
};
int i;