/ Check-in [d0d0bab4]
Login

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

Overview
Comment:Minor tweaks to the bc_test1 test program.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | begin-concurrent
Files: files | file ages | folders
SHA1: d0d0bab4e92402b6af98366be6e8955588613a51
User & Date: dan 2016-05-30 05:45:32
Wiki:begin-concurrent
Context
2016-07-06
08:32
Fix a typo in test program bc_test1.c. check-in: 2c61b7ab user: dan tags: begin-concurrent
2016-05-30
05:45
Minor tweaks to the bc_test1 test program. check-in: d0d0bab4 user: dan tags: begin-concurrent
2016-05-26
20:52
Add further instrumentation to the bc_test1.c test app. check-in: 5528de4a user: dan tags: begin-concurrent
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to test/bc_test1.c.

   484    484     Error err = {0};                /* Error code and message */
   485    485     Sqlite db = {0};                /* SQLite database connection */
   486    486     Threadset threads = {0};        /* Test threads */
   487    487     Config conf = {5, 3, 5};
   488    488     int i;
   489    489   
   490    490     CmdlineArg apArg[] = {
   491         -    { "--seconds", CMDLINE_INT,  offsetof(Config, nSecond) },
   492         -    { "--inserts", CMDLINE_INT,  offsetof(Config, nIPT) },
   493         -    { "--threads", CMDLINE_INT,  offsetof(Config, nThread) },
   494         -    { "--mutex",   CMDLINE_BOOL, offsetof(Config, bMutex) },
   495         -    { "--rm",      CMDLINE_BOOL, offsetof(Config, bRm) },
   496         -    { "--autockpt",CMDLINE_INT,  offsetof(Config, nAutoCkpt) },
   497         -    { "--mmap",    CMDLINE_INT,  offsetof(Config, nMmap) },
   498         -    { "--clear-cache",    CMDLINE_BOOL,  offsetof(Config, bClearCache) },
   499         -    { "--file",    CMDLINE_STRING,  offsetof(Config, zFile) },
   500         -    { "--osinst",  CMDLINE_BOOL,  offsetof(Config, bOsinst) },
          491  +    { "-seconds", CMDLINE_INT,  offsetof(Config, nSecond) },
          492  +    { "-inserts", CMDLINE_INT,  offsetof(Config, nIPT) },
          493  +    { "-threads", CMDLINE_INT,  offsetof(Config, nThread) },
          494  +    { "-mutex",   CMDLINE_BOOL, offsetof(Config, bMutex) },
          495  +    { "-rm",      CMDLINE_BOOL, offsetof(Config, bRm) },
          496  +    { "-autockpt",CMDLINE_INT,  offsetof(Config, nAutoCkpt) },
          497  +    { "-mmap",    CMDLINE_INT,  offsetof(Config, nMmap) },
          498  +    { "-clear-cache",    CMDLINE_BOOL,  offsetof(Config, bClearCache) },
          499  +    { "-file",    CMDLINE_STRING,  offsetof(Config, zFile) },
          500  +    { "-osinst",  CMDLINE_BOOL,  offsetof(Config, bOsinst) },
   501    501       { 0, 0, 0 }
   502    502     };
   503    503   
          504  +  conf.nAutoCkpt = 1000;
   504    505     cmdline_process(apArg, argc, argv, (void*)&conf);
   505    506     if( err.rc==SQLITE_OK ){
   506    507       char *z = cmdline_construct(apArg, (void*)&conf);
   507    508       printf("With: %s\n", z);
   508    509       sqlite3_free(z);
   509    510     }
   510    511     if( conf.zFile==0 ){

Changes to test/tt3_core.c.

   161    161     int iArg;
   162    162     unsigned char *p = (unsigned char*)pObj;
   163    163   
   164    164     for(i=1; i<argc; i++){
   165    165       const char *z = argv[i];
   166    166       int n = strlen(z);
   167    167       int iOpt = -1;
          168  +
          169  +    if( z[0]=='-' && z[1]=='-' ){
          170  +      z++;
          171  +      n--;
          172  +    }
   168    173   
   169    174       for(iArg=0; apArg[iArg].zSwitch; iArg++){
   170    175         if( 0==sqlite3_strnicmp(apArg[iArg].zSwitch, z, n) ){
   171    176           if( iOpt>=0 ){
   172    177             cmdline_error("ambiguous switch: %s", z);
   173    178           }
   174    179           iOpt = iArg;