/ Check-in [78b6eee2]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Changes for consistent use of SQLITE_OS_UNIX and removal of legacy OS_UNIX from testfixture source;
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 78b6eee200cab363be520d771375e44898f80e01
User & Date: shaneh 2011-04-04 21:48:01
Context
2011-04-05
02:21
Added ifcapable utf16 to a few test cases; check-in: 57e0919b user: shaneh tags: trunk
2011-04-04
21:48
Changes for consistent use of SQLITE_OS_UNIX and removal of legacy OS_UNIX from testfixture source; check-in: 78b6eee2 user: shaneh tags: trunk
15:38
Add the "--start=[permutation:][testfile]" option to tester.tcl. For starting quick.test or all.test at the nominated permutation and/or test file. check-in: a97e8505 user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/test4.c.

     9      9   **    May you share freely, never taking more than you give.
    10     10   **
    11     11   *************************************************************************
    12     12   ** Code for testing the the SQLite library in a multithreaded environment.
    13     13   */
    14     14   #include "sqliteInt.h"
    15     15   #include "tcl.h"
    16         -#if defined(SQLITE_OS_UNIX) && OS_UNIX==1 && SQLITE_THREADSAFE
           16  +#if SQLITE_OS_UNIX && SQLITE_THREADSAFE
    17     17   #include <stdlib.h>
    18     18   #include <string.h>
    19     19   #include <pthread.h>
    20     20   #include <sched.h>
    21     21   #include <ctype.h>
    22     22   
    23     23   /*

Changes to src/test7.c.

    16     16   #include "tcl.h"
    17     17   
    18     18   /*
    19     19   ** This test only works on UNIX with a SQLITE_THREADSAFE build that includes
    20     20   ** the SQLITE_SERVER option.
    21     21   */
    22     22   #if defined(SQLITE_SERVER) && !defined(SQLITE_OMIT_SHARED_CACHE) && \
    23         -    defined(SQLITE_OS_UNIX) && OS_UNIX && SQLITE_THREADSAFE
           23  +    SQLITE_OS_UNIX && SQLITE_THREADSAFE
    24     24   
    25     25   #include <stdlib.h>
    26     26   #include <string.h>
    27     27   #include <pthread.h>
    28     28   #include <sched.h>
    29     29   #include <ctype.h>
    30     30   

Changes to src/test_demovfs.c.

   111    111   **                        0             12
   112    112   **             ++++++++++++SYNC+++++++++++
   113    113   **
   114    114   **   Much more efficient if the underlying OS is not caching write 
   115    115   **   operations.
   116    116   */
   117    117   
   118         -#if !defined(SQLITE_TEST) || defined(SQLITE_OS_UNIX)
          118  +#if !defined(SQLITE_TEST) || SQLITE_OS_UNIX
   119    119   
   120    120   #include <sqlite3.h>
   121    121   
   122    122   #include <assert.h>
   123    123   #include <string.h>
   124    124   #include <sys/types.h>
   125    125   #include <sys/stat.h>
................................................................................
   633    633       demoRandomness,               /* xRandomness */
   634    634       demoSleep,                    /* xSleep */
   635    635       demoCurrentTime,              /* xCurrentTime */
   636    636     };
   637    637     return &demovfs;
   638    638   }
   639    639   
   640         -#endif /* !defined(SQLITE_TEST) || defined(SQLITE_OS_UNIX) */
          640  +#endif /* !defined(SQLITE_TEST) || SQLITE_OS_UNIX */
   641    641   
   642    642   
   643    643   #ifdef SQLITE_TEST
   644    644   
   645    645   #include <tcl.h>
   646    646   
   647         -#ifdef SQLITE_OS_UNIX
          647  +#if SQLITE_OS_UNIX
   648    648   static int register_demovfs(
   649    649     ClientData clientData, /* Pointer to sqlite3_enable_XXX function */
   650    650     Tcl_Interp *interp,    /* The TCL interpreter that invoked this command */
   651    651     int objc,              /* Number of arguments */
   652    652     Tcl_Obj *CONST objv[]  /* Command arguments */
   653    653   ){
   654    654     sqlite3_vfs_register(sqlite3_demovfs(), 1);

Changes to src/test_osinst.c.

   209    209     vfslogDeviceCharacteristics,    /* xDeviceCharacteristics */
   210    210     vfslogShmMap,                   /* xShmMap */
   211    211     vfslogShmLock,                  /* xShmLock */
   212    212     vfslogShmBarrier,               /* xShmBarrier */
   213    213     vfslogShmUnmap                  /* xShmUnmap */
   214    214   };
   215    215   
   216         -#if defined(SQLITE_OS_UNIX) && !defined(NO_GETTOD)
          216  +#if SQLITE_OS_UNIX && !defined(NO_GETTOD)
   217    217   #include <sys/time.h>
   218    218   static sqlite3_uint64 vfslog_time(){
   219    219     struct timeval sTime;
   220    220     gettimeofday(&sTime, 0);
   221    221     return sTime.tv_usec + (sqlite3_uint64)sTime.tv_sec * 1000000;
   222    222   }
   223         -#elif defined(SQLITE_OS_WIN)
          223  +#elif SQLITE_OS_WIN
   224    224   #include <windows.h>
   225    225   #include <time.h>
   226    226   static sqlite3_uint64 vfslog_time(){
   227    227     FILETIME ft;
   228    228     sqlite3_uint64 u64time = 0;
   229    229    
   230    230     GetSystemTimeAsFileTime(&ft);

Changes to src/test_server.c.

   202    202   #include "sqliteInt.h"
   203    203   
   204    204   /*
   205    205   ** Only compile the code in this file on UNIX with a SQLITE_THREADSAFE build
   206    206   ** and only if the SQLITE_SERVER macro is defined.
   207    207   */
   208    208   #if defined(SQLITE_SERVER) && !defined(SQLITE_OMIT_SHARED_CACHE)
   209         -#if defined(SQLITE_OS_UNIX) && OS_UNIX && SQLITE_THREADSAFE
          209  +#if SQLITE_OS_UNIX && SQLITE_THREADSAFE
   210    210   
   211    211   /*
   212    212   ** We require only pthreads and the public interface of SQLite.
   213    213   */
   214    214   #include <pthread.h>
   215    215   #include "sqlite3.h"
   216    216   
................................................................................
   483    483   void sqlite3_server_stop(void){
   484    484     g.serverHalt = 1;
   485    485     pthread_cond_broadcast(&g.serverWakeup);
   486    486     pthread_mutex_lock(&g.serverMutex);
   487    487     pthread_mutex_unlock(&g.serverMutex);
   488    488   }
   489    489   
   490         -#endif /* defined(SQLITE_OS_UNIX) && OS_UNIX && SQLITE_THREADSAFE */
          490  +#endif /* SQLITE_OS_UNIX && SQLITE_THREADSAFE */
   491    491   #endif /* defined(SQLITE_SERVER) */

Changes to src/test_syscall.c.

    72     72   #include "sqlite3.h"
    73     73   #include "tcl.h"
    74     74   #include <stdlib.h>
    75     75   #include <string.h>
    76     76   #include <assert.h>
    77     77   
    78     78   #include "sqliteInt.h"
    79         -#ifdef SQLITE_OS_UNIX
           79  +#if SQLITE_OS_UNIX
    80     80   
    81     81   /* From test1.c */
    82     82   extern const char *sqlite3TestErrorName(int);
    83     83   
    84     84   #include <sys/types.h>
    85     85   #include <errno.h>
    86     86   

Changes to src/test_thread.c.

    49     49     Tcl_Event base;          /* Base class of type Tcl_Event */
    50     50     char *zScript;           /* The script to execute. */
    51     51     Tcl_Interp *interp;      /* The interpreter to execute it in. */
    52     52   };
    53     53   
    54     54   static Tcl_ObjCmdProc sqlthread_proc;
    55     55   static Tcl_ObjCmdProc clock_seconds_proc;
    56         -#if defined(SQLITE_OS_UNIX) && defined(SQLITE_ENABLE_UNLOCK_NOTIFY)
           56  +#if SQLITE_OS_UNIX && defined(SQLITE_ENABLE_UNLOCK_NOTIFY)
    57     57   static Tcl_ObjCmdProc blocking_step_proc;
    58     58   static Tcl_ObjCmdProc blocking_prepare_v2_proc;
    59     59   #endif
    60     60   int Sqlitetest1_Init(Tcl_Interp *);
    61     61   int Sqlite3_Init(Tcl_Interp *);
    62     62   
    63     63   /* Functions from test1.c */
................................................................................
   112    112     int rc;
   113    113     SqlThread *p = (SqlThread *)pSqlThread;
   114    114     extern int Sqlitetest_mutex_Init(Tcl_Interp*);
   115    115   
   116    116     interp = Tcl_CreateInterp();
   117    117     Tcl_CreateObjCommand(interp, "clock_seconds", clock_seconds_proc, 0, 0);
   118    118     Tcl_CreateObjCommand(interp, "sqlthread", sqlthread_proc, pSqlThread, 0);
   119         -#if defined(SQLITE_OS_UNIX) && defined(SQLITE_ENABLE_UNLOCK_NOTIFY)
          119  +#if SQLITE_OS_UNIX && defined(SQLITE_ENABLE_UNLOCK_NOTIFY)
   120    120     Tcl_CreateObjCommand(interp, "sqlite3_blocking_step", blocking_step_proc,0,0);
   121    121     Tcl_CreateObjCommand(interp, 
   122    122         "sqlite3_blocking_prepare_v2", blocking_prepare_v2_proc, (void *)1, 0);
   123    123     Tcl_CreateObjCommand(interp, 
   124    124         "sqlite3_nonblocking_prepare_v2", blocking_prepare_v2_proc, 0, 0);
   125    125   #endif
   126    126     Sqlitetest1_Init(interp);
................................................................................
   388    388   ** The source code for the C functions sqlite3_blocking_step(),
   389    389   ** blocking_step_notify() and the structure UnlockNotification is
   390    390   ** automatically extracted from this file and used as part of the
   391    391   ** documentation for the sqlite3_unlock_notify() API function. This
   392    392   ** should be considered if these functions are to be extended (i.e. to 
   393    393   ** support windows) in the future.
   394    394   */ 
   395         -#if defined(SQLITE_OS_UNIX) && defined(SQLITE_ENABLE_UNLOCK_NOTIFY)
          395  +#if SQLITE_OS_UNIX && defined(SQLITE_ENABLE_UNLOCK_NOTIFY)
   396    396   
   397    397   /* BEGIN_SQLITE_BLOCKING_STEP */
   398    398   /* This example uses the pthreads API */
   399    399   #include <pthread.h>
   400    400   
   401    401   /*
   402    402   ** A pointer to an instance of this structure is passed as the user-context
................................................................................
   610    610   
   611    611   /*
   612    612   ** Register commands with the TCL interpreter.
   613    613   */
   614    614   int SqlitetestThread_Init(Tcl_Interp *interp){
   615    615     Tcl_CreateObjCommand(interp, "sqlthread", sqlthread_proc, 0, 0);
   616    616     Tcl_CreateObjCommand(interp, "clock_seconds", clock_seconds_proc, 0, 0);
   617         -#if defined(SQLITE_OS_UNIX) && defined(SQLITE_ENABLE_UNLOCK_NOTIFY)
          617  +#if SQLITE_OS_UNIX && defined(SQLITE_ENABLE_UNLOCK_NOTIFY)
   618    618     Tcl_CreateObjCommand(interp, "sqlite3_blocking_step", blocking_step_proc,0,0);
   619    619     Tcl_CreateObjCommand(interp, 
   620    620         "sqlite3_blocking_prepare_v2", blocking_prepare_v2_proc, (void *)1, 0);
   621    621     Tcl_CreateObjCommand(interp, 
   622    622         "sqlite3_nonblocking_prepare_v2", blocking_prepare_v2_proc, 0, 0);
   623    623   #endif
   624    624     return TCL_OK;
   625    625   }
   626    626   #else
   627    627   int SqlitetestThread_Init(Tcl_Interp *interp){
   628    628     return TCL_OK;
   629    629   }
   630    630   #endif

Changes to test/releasetest.tcl.

    60     60     "Default" {
    61     61       -O2
    62     62     }
    63     63     "Unlock-Notify" {
    64     64       -O2
    65     65       -DSQLITE_ENABLE_UNLOCK_NOTIFY
    66     66       -DSQLITE_THREADSAFE
    67         -    -DOS_UNIX
    68     67       -DSQLITE_TCL_DEFAULT_FULLMUTEX=1
    69     68     }
    70     69     "Secure-Delete" {
    71     70       -O2
    72     71       -DSQLITE_SECURE_DELETE=1
    73     72       -DSQLITE_SOUNDEX=1
    74     73     }