diff options
author | drh <drh@noemail.net> | 2008-10-10 17:41:28 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2008-10-10 17:41:28 +0000 |
commit | 1b67f3caf2c8e50d038b03a943516e2df0fd4021 (patch) | |
tree | 44b9790a9d6e1168799982a7aba41d2fa9380a70 /src/test_malloc.c | |
parent | adfae6c68b3752c52d188eeed55acb7e77e19c53 (diff) | |
download | sqlite-1b67f3caf2c8e50d038b03a943516e2df0fd4021.tar.gz sqlite-1b67f3caf2c8e50d038b03a943516e2df0fd4021.zip |
Simplify the symbol hash table to use only a single key class. Other
changes to improve code coverage. (CVS 5794)
FossilOrigin-Name: ff50a8a7e5a15fac192939ff3206fa18d1c5a6dd
Diffstat (limited to 'src/test_malloc.c')
-rw-r--r-- | src/test_malloc.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/test_malloc.c b/src/test_malloc.c index 24d23891e..7cf46e6b7 100644 --- a/src/test_malloc.c +++ b/src/test_malloc.c @@ -13,7 +13,7 @@ ** This file contains code used to implement test interfaces to the ** memory allocation subsystem. ** -** $Id: test_malloc.c,v 1.47 2008/08/05 17:53:24 drh Exp $ +** $Id: test_malloc.c,v 1.48 2008/10/10 17:41:29 drh Exp $ */ #include "sqliteInt.h" #include "tcl.h" @@ -204,7 +204,16 @@ static int faultsimInstall(int install){ faultsimBeginBenign, faultsimEndBenign ); }else{ + sqlite3_mem_methods m; assert(memfault.m.xMalloc); + + /* One should be able to reset the default memory allocator by storing + ** a zeroed allocator then calling GETMALLOC. */ + memset(&m, 0, sizeof(m)); + sqlite3_config(SQLITE_CONFIG_MALLOC, &m); + sqlite3_config(SQLITE_CONFIG_GETMALLOC, &m); + assert( memcmp(&m, &memfault.m, sizeof(m))==0 ); + rc = sqlite3_config(SQLITE_CONFIG_MALLOC, &memfault.m); sqlite3_test_control(SQLITE_TESTCTRL_BENIGN_MALLOC_HOOKS, 0, 0); } |