-C Improve\scoverage\sof\spager.c.\s(CVS\s6158)
-D 2009-01-10T16:15:09
+C When\scompiled\swith\sSQLITE_DEBUG\s(in\sother\swords,\swhen\sassert()\sis\senabled)\nthe\sALWAYS\sand\sNEVER\smacros\swill\sthrow\san\sassertion\sif\stheir\sarguments\sare\nnot\strue\sor\sfalse,\srespectively.\s(CVS\s6159)
+D 2009-01-10T16:15:21
F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
F Makefile.in 05461a9b5803d5ad10c79f989801e9fd2cc3e592
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
F src/auth.c c8b2ab5c8bad4bd90ed7c294694f48269162c627
F src/bitvec.c a97d315fc7c0ec54fabd8859a45bd4e8e0d16b0b
F src/btmutex.c 63c5cc4ad5715690767ffcb741e185d7bc35ec1a
-F src/btree.c 6ece0e362ad902b86d153f4cb52194d30aa4d817
+F src/btree.c 603ce1969c601d9bf3ea92d49a53a445912fa3bc
F src/btree.h 4f141cf748d2ee7c6d7fc175f64f87a45cd44113
F src/btreeInt.h 8fea5cd7021cb8848fc2183a3e909469659daa0a
F src/build.c 6eb9d20e99db8da8c7c6e7316096a6ff3d9acab9
F src/journal.c cffd2cd214e58c0e99c3ff632b3bee6c7cbb260e
F src/legacy.c 4f7410b29598d991628ca40b150aa089649f17d8
F src/loadext.c 2f53996c693a347edc2d773e9217dde49d96ae64
-F src/main.c 1d2b56821327321af1d6275603c22f86d55b3438
+F src/main.c e7cc4e3223f7dd40ceccb71d32cbb493f3e5632b
F src/malloc.c e2b4e6d7033372bd43adb0192bf5f64c0aa03c91
F src/mem0.c f2f84062d1f35814d6535c9f9e33de3bfb3b132c
F src/mem1.c 3bfb39e4f60b0179713a7c087b2d4f0dc205735f
F src/shell.c 65d19f8996a160f288087e31810f24025439c62a
F src/sqlite.h.in 6cd2489e40fe97ba58c60044a4ced377e08b6d09
F src/sqlite3ext.h 1db7d63ab5de4b3e6b83dd03d1a4e64fef6d2a17
-F src/sqliteInt.h 4b2a8eb466c30daa90d25f9d3bb2e85b60ad47af
+F src/sqliteInt.h 10e934f5532a45dcfe9846e1bf4b424b82c5e64d
F src/sqliteLimit.h ffe93f5a0c4e7bd13e70cd7bf84cfb5c3465f45d
F src/status.c 237b193efae0cf6ac3f0817a208de6c6c6ef6d76
F src/table.c 23db1e5f27c03160987c122a078b4bb51ef0b2f8
F src/trigger.c ca6d78f7c1314053800386ca64361e487774fda3
F src/update.c 8c4925f9ca664effc8a1faaad67449d2074567b1
F src/utf.c 1da9c832dba0fa8f865b5b902d93f420a1ee4245
-F src/util.c ea62608f66f33a7e8322de83024ae37c415c0c7f
+F src/util.c 7b1e3987e1ae6b3aa773b0eb1b7391b1f72569d2
F src/vacuum.c 383d6297bddc011ab04a9eed110db6eaf523e8e9
F src/vdbe.c 4e9b83e758a43882a29fe5cde479acb1db04f7dd
F src/vdbe.h 03516f28bf5aca00a53c4dccd6c313f96adb94f6
F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
-P 3da5578726cb22118dfca38a2098a1e378644387
-R 320ab8e7bd88e5e4d3a0d64f8789cffb
-U danielk1977
-Z 43f0761b39243fe434b2dca241a4ad9a
+P 855c4093cf331496d9ef508011ad814e91e3882f
+R b9c742fffe6a789dace921fa1885cb8a
+U drh
+Z 36a241c258b9ef95ddefc24be4403954
-855c4093cf331496d9ef508011ad814e91e3882f
\ No newline at end of file
+64a8dcd8d6152108809e4d10c459f1de5d36a435
\ No newline at end of file
** May you share freely, never taking more than you give.
**
*************************************************************************
-** $Id: btree.c,v 1.557 2009/01/09 14:11:05 drh Exp $
+** $Id: btree.c,v 1.558 2009/01/10 16:15:21 drh Exp $
**
** This file implements a external (disk-based) database using BTrees.
** See the header comment on "btreeInt.h" for additional information.
*/
int sqlite3BtreeIsInStmt(Btree *p){
assert( sqlite3BtreeHoldsMutex(p) );
- assert( p->pBt );
return ALWAYS(p->pBt) && p->pBt->inStmt;
}
** other files are for internal use by SQLite and should not be
** accessed by users of the library.
**
-** $Id: main.c,v 1.520 2008/12/17 17:30:26 danielk1977 Exp $
+** $Id: main.c,v 1.521 2009/01/10 16:15:22 drh Exp $
*/
#include "sqliteInt.h"
#include <ctype.h>
return rc;
}
-/*
-** Routine needed to support the testcase() macro.
-*/
-#ifdef SQLITE_COVERAGE_TEST
-void sqlite3Coverage(int x){
- static int dummy = 0;
- dummy += x;
-}
-#endif
-
/*
** Return true if the buffer z[0..n-1] contains all spaces.
*************************************************************************
** Internal interface definitions for SQLite.
**
-** @(#) $Id: sqliteInt.h,v 1.822 2009/01/10 13:24:51 drh Exp $
+** @(#) $Id: sqliteInt.h,v 1.823 2009/01/10 16:15:22 drh Exp $
*/
#ifndef _SQLITEINT_H_
#define _SQLITEINT_H_
#include <inttypes.h>
#endif
-/*
-** A macro used to aid in coverage testing. When doing coverage
-** testing, the condition inside the argument must be evaluated
-** both true and false in order to get full branch coverage.
-** This macro can be inserted to ensure adequate test coverage
-** in places where simple condition/decision coverage is inadequate.
-*/
-#ifdef SQLITE_COVERAGE_TEST
- void sqlite3Coverage(int);
-# define testcase(X) if( X ){ sqlite3Coverage(__LINE__); }
-# define TESTONLY(X) X
-#else
-# define testcase(X)
-# define TESTONLY(X)
-#endif
-
-/*
-** The ALWAYS and NEVER macros surround boolean expressions which
-** are intended to always be true or false, respectively. Such
-** expressions could be omitted from the code completely. But they
-** are included in a few cases in order to enhance the resilience
-** of SQLite to unexpected behavior - to make the code "self-healing"
-** or "ductile" rather than being "brittle" and crashing at the first
-** hint of unplanned behavior.
-**
-** When doing coverage testing ALWAYS and NEVER are hard-coded to
-** be true and false so that the unreachable code then specify will
-** not be counted as untested code.
-*/
-#ifdef SQLITE_COVERAGE_TEST
-# define ALWAYS(X) (1)
-# define NEVER(X) (0)
-#else
-# define ALWAYS(X) (X)
-# define NEVER(X) (X)
-#endif
-
-/*
-** The macro unlikely() is a hint that surrounds a boolean
-** expression that is usually false. Macro likely() surrounds
-** a boolean expression that is usually true. GCC is able to
-** use these hints to generate better code, sometimes.
-*/
-#if defined(__GNUC__) && 0
-# define likely(X) __builtin_expect((X),1)
-# define unlikely(X) __builtin_expect((X),0)
-#else
-# define likely(X) !!(X)
-# define unlikely(X) !!(X)
-#endif
-
/*
* This macro is used to "hide" some ugliness in casting an int
* value to a ptr value under the MSVC 64-bit compiler. Casting
# define NDEBUG 1
#endif
+/*
+** The testcase() macro is used to aid in coverage testing. When
+** doing coverage testing, the condition inside the argument to
+** testcase() must be evaluated both true and false in order to
+** get full branch coverage. The testcase() macro is inserted
+** to help ensure adequate test coverage in places where simple
+** condition/decision coverage is inadequate. For example, testcase()
+** can be used to make sure boundary values are tested. For
+** bitmask tests, testcase() can be used to make sure each bit
+** is significant and used at least once. On switch statements
+** where multiple cases go to the same block of code, testcase()
+** can insure that all cases are evaluated.
+**
+** The TESTONLY macro is used to enclose variable declarations or
+** other bits of code that are needed to support the arguments
+** within testcase() macros.
+*/
+#ifdef SQLITE_COVERAGE_TEST
+ void sqlite3Coverage(int);
+# define testcase(X) if( X ){ sqlite3Coverage(__LINE__); }
+# define TESTONLY(X) X
+#else
+# define testcase(X)
+# define TESTONLY(X)
+#endif
+
+/*
+** The ALWAYS and NEVER macros surround boolean expressions which
+** are intended to always be true or false, respectively. Such
+** expressions could be omitted from the code completely. But they
+** are included in a few cases in order to enhance the resilience
+** of SQLite to unexpected behavior - to make the code "self-healing"
+** or "ductile" rather than being "brittle" and crashing at the first
+** hint of unplanned behavior.
+**
+** In other words, ALWAYS and NEVER are added for defensive code.
+**
+** When doing coverage testing ALWAYS and NEVER are hard-coded to
+** be true and false so that the unreachable code then specify will
+** not be counted as untested code.
+*/
+#if defined(SQLITE_COVERAGE_TEST)
+# define ALWAYS(X) (1)
+# define NEVER(X) (0)
+#elif !defined(NDEBUG)
+ int sqlite3Assert(void);
+# define ALWAYS(X) ((X)?1:sqlite3Assert())
+# define NEVER(X) ((X)?sqlite3Assert():0)
+#else
+# define ALWAYS(X) (X)
+# define NEVER(X) (X)
+#endif
+
+/*
+** The macro unlikely() is a hint that surrounds a boolean
+** expression that is usually false. Macro likely() surrounds
+** a boolean expression that is usually true. GCC is able to
+** use these hints to generate better code, sometimes.
+*/
+#if defined(__GNUC__) && 0
+# define likely(X) __builtin_expect((X),1)
+# define unlikely(X) __builtin_expect((X),0)
+#else
+# define likely(X) !!(X)
+# define unlikely(X) !!(X)
+#endif
+
/*
** Sometimes we need a small amount of code such as a variable initialization
** to setup for a later assert() statement. We do not want this code to
** This file contains functions for allocating memory, comparing
** strings, and stuff like that.
**
-** $Id: util.c,v 1.245 2008/12/10 22:15:00 drh Exp $
+** $Id: util.c,v 1.246 2009/01/10 16:15:22 drh Exp $
*/
#include "sqliteInt.h"
#include <stdarg.h>
#include <ctype.h>
+/*
+** Routine needed to support the testcase() macro.
+*/
+#ifdef SQLITE_COVERAGE_TEST
+void sqlite3Coverage(int x){
+ static int dummy = 0;
+ dummy += x;
+}
+#endif
+
+/*
+** Routine needed to support the ALWAYS() and NEVER() macros.
+**
+** The argument to ALWAYS() should always be true and the argument
+** to NEVER() should always be false. If either is not the case
+** then this routine is called in order to throw an error.
+**
+** This routine only exists if assert() is operational. It always
+** throws an assert on its first invocation. The variable has a long
+** name to help the assert() message be more readable. The variable
+** is used to prevent a too-clever optimizer from optimizing out the
+** entire call.
+*/
+#ifndef NDEBUG
+int sqlite3Assert(void){
+ static volatile int ALWAYS_was_false_or_NEVER_was_true = 0;
+ assert( ALWAYS_was_false_or_NEVER_was_true ); /* Always fails */
+ return ALWAYS_was_false_or_NEVER_was_true++; /* Not Reached */
+}
+#endif
+
/*
** Return true if the floating point value is Not a Number (NaN).
*/