1
0
mirror of https://github.com/sqlite/sqlite.git synced 2026-01-06 08:01:16 +03:00

Minor test coverage enhancements. (CVS 4877)

FossilOrigin-Name: edd207b9a9df5d73ec34474a4e90fcb592f06cf1
This commit is contained in:
drh
2008-03-18 13:01:38 +00:00
parent 874c5d6a43
commit 77db4c05ec
5 changed files with 18 additions and 16 deletions

View File

@@ -14,7 +14,7 @@
** other files are for internal use by SQLite and should not be
** accessed by users of the library.
**
** $Id: main.c,v 1.421 2008/03/07 21:37:19 drh Exp $
** $Id: main.c,v 1.422 2008/03/18 13:01:38 drh Exp $
*/
#include "sqliteInt.h"
#include <ctype.h>
@@ -1002,13 +1002,12 @@ static int openDatabase(
createCollation(db, "BINARY", SQLITE_UTF16BE, 0, binCollFunc, 0);
createCollation(db, "BINARY", SQLITE_UTF16LE, 0, binCollFunc, 0);
createCollation(db, "RTRIM", SQLITE_UTF8, (void*)1, binCollFunc, 0);
if( db->mallocFailed ||
(db->pDfltColl = sqlite3FindCollSeq(db, SQLITE_UTF8, "BINARY", 6, 0))==0
){
assert( db->mallocFailed );
if( db->mallocFailed ){
db->magic = SQLITE_MAGIC_SICK;
goto opendb_out;
}
db->pDfltColl = sqlite3FindCollSeq(db, SQLITE_UTF8, "BINARY", 6, 0);
assert( db->pDfltColl!=0 );
/* Also add a UTF-8 case-insensitive collation sequence. */
createCollation(db, "NOCASE", SQLITE_UTF8, 0, nocaseCollatingFunc, 0);

View File

@@ -13,7 +13,7 @@
** This file contains code used to implement test interfaces to the
** memory allocation subsystem.
**
** $Id: test_malloc.c,v 1.16 2008/03/18 00:07:11 drh Exp $
** $Id: test_malloc.c,v 1.17 2008/03/18 13:01:38 drh Exp $
*/
#include "sqliteInt.h"
#include "tcl.h"
@@ -437,6 +437,7 @@ static int test_memdebug_fail(
}
}
sqlite3_test_control(-12345); /* Just to stress the test_control interface */
nBenign = sqlite3_test_control(SQLITE_TESTCTRL_FAULT_BENIGN_FAILURES,
SQLITE_FAULTINJECTOR_MALLOC);
nFail = sqlite3_test_control(SQLITE_TESTCTRL_FAULT_FAILURES,

View File

@@ -383,6 +383,8 @@ static void md5finalize(sqlite3_context *context){
sqlite3_result_text(context, zBuf, -1, SQLITE_TRANSIENT);
}
int Md5_Register(sqlite3 *db){
return sqlite3_create_function(db, "md5sum", -1, SQLITE_UTF8, 0, 0,
int rc = sqlite3_create_function(db, "md5sum", -1, SQLITE_UTF8, 0, 0,
md5step, md5finalize);
sqlite3_overload_function(db, "md5sum", -1); /* To exercise this API */
return rc;
}