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

Improved test coverage of func.c and hash.c. (CVS 1772)

FossilOrigin-Name: 0c999f28137bd82ba24dd263bab30d22329eed73
This commit is contained in:
drh
2004-06-30 03:08:24 +00:00
parent 5b809e3198
commit cc19587998
5 changed files with 30 additions and 18 deletions

View File

@@ -12,7 +12,7 @@
** This is the implementation of generic hash-tables
** used in SQLite.
**
** $Id: hash.c,v 1.12 2004/05/08 08:23:25 danielk1977 Exp $
** $Id: hash.c,v 1.13 2004/06/30 03:08:25 drh Exp $
*/
#include "sqliteInt.h"
#include <assert.h>
@@ -65,6 +65,7 @@ void sqlite3HashClear(Hash *pH){
pH->count = 0;
}
#if 0 /* NOT USED */
/*
** Hash and comparison functions when the mode is SQLITE_HASH_INT
*/
@@ -74,6 +75,7 @@ static int intHash(const void *pKey, int nKey){
static int intCompare(const void *pKey1, int n1, const void *pKey2, int n2){
return n2 - n1;
}
#endif
#if 0 /* NOT USED */
/*
@@ -131,7 +133,7 @@ static int binCompare(const void *pKey1, int n1, const void *pKey2, int n2){
*/
static int (*hashFunction(int keyClass))(const void*,int){
switch( keyClass ){
case SQLITE_HASH_INT: return &intHash;
/* case SQLITE_HASH_INT: return &intHash; // NOT USED */
/* case SQLITE_HASH_POINTER: return &ptrHash; // NOT USED */
case SQLITE_HASH_STRING: return &strHash;
case SQLITE_HASH_BINARY: return &binHash;;
@@ -148,7 +150,7 @@ static int (*hashFunction(int keyClass))(const void*,int){
*/
static int (*compareFunction(int keyClass))(const void*,int,const void*,int){
switch( keyClass ){
case SQLITE_HASH_INT: return &intCompare;
/* case SQLITE_HASH_INT: return &intCompare; // NOT USED */
/* case SQLITE_HASH_POINTER: return &ptrCompare; // NOT USED */
case SQLITE_HASH_STRING: return &strCompare;
case SQLITE_HASH_BINARY: return &binCompare;
@@ -354,6 +356,3 @@ void *sqlite3HashInsert(Hash *pH, const void *pKey, int nKey, void *data){
new_elem->data = data;
return 0;
}