| 1137 | } |
| 1138 | |
| 1139 | int main(int argc, char **argv){ |
| 1140 | int doAutovac = 0; /* True for --autovacuum */ |
| 1141 | int cacheSize = 0; /* Desired cache size. 0 means default */ |
| 1142 | int doExclusive = 0; /* True for --exclusive */ |
| 1143 | int nHeap = 0, mnHeap = 0; /* Heap size from --heap */ |
| 1144 | int doIncrvac = 0; /* True for --incrvacuum */ |
| 1145 | const char *zJMode = 0; /* Journal mode */ |
| 1146 | const char *zKey = 0; /* Encryption key */ |
| 1147 | int nLook = 0, szLook = 0; /* --lookaside configuration */ |
| 1148 | int noSync = 0; /* True for --nosync */ |
| 1149 | int pageSize = 0; /* Desired page size. 0 means default */ |
| 1150 | int nPCache = 0, szPCache = 0;/* --pcache configuration */ |
| 1151 | int nScratch = 0, szScratch=0;/* --scratch configuration */ |
| 1152 | int showStats = 0; /* True for --stats */ |
| 1153 | const char *zTSet = "main"; /* Which --testset torun */ |
| 1154 | int doTrace = 0; /* True for --trace */ |
| 1155 | const char *zEncoding = 0; /* --utf16be or --utf16le */ |
| 1156 | const char *zDbName = 0; /* Name of the test database */ |
| 1157 | |
| 1158 | void *pHeap = 0; /* Allocated heap space */ |
| 1159 | void *pLook = 0; /* Allocated lookaside space */ |
| 1160 | void *pPCache = 0; /* Allocated storage for pcache */ |
| 1161 | void *pScratch = 0; /* Allocated storage for scratch */ |
| 1162 | int iCur, iHi; /* Stats values, current and "highwater" */ |
| 1163 | int i; /* Loop counter */ |
| 1164 | int rc; /* API return code */ |
| 1165 | |
| 1166 | /* Process command-line arguments */ |
| 1167 | g.zWR = ""; |
| 1168 | g.zNN = ""; |
| 1169 | g.zPK = "UNIQUE"; |
| 1170 | g.szTest = 100; |
| 1171 | |
| 1172 | /* Emscripten commandline argument processing - first arg is ours */ |
| 1173 | int arg = argc > 1 ? argv[1][0] - '0' : 3; |
| 1174 | switch(arg) { |
| 1175 | case 0: return 0; break; |
| 1176 | case 1: arg = 5; break; |
| 1177 | case 2: arg = 15; break; |
| 1178 | case 3: arg = 40; break; |
| 1179 | case 4: arg = 80; break; |
| 1180 | case 5: arg = 160; break; |
| 1181 | default: |
| 1182 | printf("error: %d\\n", arg); |
| 1183 | return -1; |
| 1184 | } |
| 1185 | g.szTest = arg; |
| 1186 | |
| 1187 | /* Back to sqlite - after the first is theirs*/ |
| 1188 | for(i=2; i<argc; i++){ |
| 1189 | const char *z = argv[i]; |
| 1190 | if( z[0]=='-' ){ |
| 1191 | do{ z++; }while( z[0]=='-' ); |
| 1192 | if( strcmp(z,"autovacuum")==0 ){ |
| 1193 | doAutovac = 1; |
| 1194 | }else if( strcmp(z,"cachesize")==0 ){ |
| 1195 | if( i>=argc-1 ) fatal_error("missing argument on %s\n", argv[i]); |
| 1196 | i++; |
nothing calls this directly
no test coverage detected