SQLite

Check-in [d0d0bab4e9]
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
Timelines: family | ancestors | descendants | both | begin-concurrent
Files: files | file ages | folders
SHA1: d0d0bab4e92402b6af98366be6e8955588613a51
User & Date: dan 2016-05-30 05:45:32.809
Context
2016-07-06
08:32
Fix a typo in test program bc_test1.c. (check-in: 2c61b7ab18 user: dan tags: begin-concurrent)
2016-05-30
05:45
Minor tweaks to the bc_test1 test program. (check-in: d0d0bab4e9 user: dan tags: begin-concurrent)
2016-05-26
20:52
Add further instrumentation to the bc_test1.c test app. (check-in: 5528de4a53 user: dan tags: begin-concurrent)
Changes
Side-by-Side Diff Ignore Whitespace Patch
Changes to test/bc_test1.c.
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500










501
502
503

504
505
506
507
508
509
510
484
485
486
487
488
489
490










491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511







-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+



+







  Error err = {0};                /* Error code and message */
  Sqlite db = {0};                /* SQLite database connection */
  Threadset threads = {0};        /* Test threads */
  Config conf = {5, 3, 5};
  int i;

  CmdlineArg apArg[] = {
    { "--seconds", CMDLINE_INT,  offsetof(Config, nSecond) },
    { "--inserts", CMDLINE_INT,  offsetof(Config, nIPT) },
    { "--threads", CMDLINE_INT,  offsetof(Config, nThread) },
    { "--mutex",   CMDLINE_BOOL, offsetof(Config, bMutex) },
    { "--rm",      CMDLINE_BOOL, offsetof(Config, bRm) },
    { "--autockpt",CMDLINE_INT,  offsetof(Config, nAutoCkpt) },
    { "--mmap",    CMDLINE_INT,  offsetof(Config, nMmap) },
    { "--clear-cache",    CMDLINE_BOOL,  offsetof(Config, bClearCache) },
    { "--file",    CMDLINE_STRING,  offsetof(Config, zFile) },
    { "--osinst",  CMDLINE_BOOL,  offsetof(Config, bOsinst) },
    { "-seconds", CMDLINE_INT,  offsetof(Config, nSecond) },
    { "-inserts", CMDLINE_INT,  offsetof(Config, nIPT) },
    { "-threads", CMDLINE_INT,  offsetof(Config, nThread) },
    { "-mutex",   CMDLINE_BOOL, offsetof(Config, bMutex) },
    { "-rm",      CMDLINE_BOOL, offsetof(Config, bRm) },
    { "-autockpt",CMDLINE_INT,  offsetof(Config, nAutoCkpt) },
    { "-mmap",    CMDLINE_INT,  offsetof(Config, nMmap) },
    { "-clear-cache",    CMDLINE_BOOL,  offsetof(Config, bClearCache) },
    { "-file",    CMDLINE_STRING,  offsetof(Config, zFile) },
    { "-osinst",  CMDLINE_BOOL,  offsetof(Config, bOsinst) },
    { 0, 0, 0 }
  };

  conf.nAutoCkpt = 1000;
  cmdline_process(apArg, argc, argv, (void*)&conf);
  if( err.rc==SQLITE_OK ){
    char *z = cmdline_construct(apArg, (void*)&conf);
    printf("With: %s\n", z);
    sqlite3_free(z);
  }
  if( conf.zFile==0 ){
Changes to test/tt3_core.c.
161
162
163
164
165
166
167





168
169
170
171
172
173
174
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179







+
+
+
+
+







  int iArg;
  unsigned char *p = (unsigned char*)pObj;

  for(i=1; i<argc; i++){
    const char *z = argv[i];
    int n = strlen(z);
    int iOpt = -1;

    if( z[0]=='-' && z[1]=='-' ){
      z++;
      n--;
    }

    for(iArg=0; apArg[iArg].zSwitch; iArg++){
      if( 0==sqlite3_strnicmp(apArg[iArg].zSwitch, z, n) ){
        if( iOpt>=0 ){
          cmdline_error("ambiguous switch: %s", z);
        }
        iOpt = iArg;