int dbOpen;
}
+ private String name;
+
+ Tester1(String name){
+ this.name = name;
+ }
+
static final Metrics metrics = new Metrics();
private static final OutputPointer.sqlite3_stmt outStmt
= new OutputPointer.sqlite3_stmt();
}
static int affirmCount = 0;
- public static void affirm(Boolean v){
+ public static void affirm(Boolean v, String comment){
++affirmCount;
assert( v /* prefer assert over exception if it's enabled because
- the JNI layer sometimes has to suppress exceptions. */);
- if( !v ) throw new RuntimeException("Assertion failed.");
+ the JNI layer sometimes has to suppress exceptions,
+ so they might be squelched on their way back to the
+ top. */);
+ if( !v ) throw new RuntimeException(comment);
+ }
+
+ public static void affirm(Boolean v){
+ affirm(v, "Affirmation failed.");
}
private static void test1(){
affirm(SQLITE_MAX_TRIGGER_DEPTH>0);
}
- public static sqlite3 createNewDb(){
+ static sqlite3 createNewDb(){
final OutputPointer.sqlite3 out = new OutputPointer.sqlite3();
int rc = sqlite3_open(":memory:", out);
++metrics.dbOpen;
return db;
}
- public static void execSql(sqlite3 db, String[] sql){
+ static void execSql(sqlite3 db, String[] sql){
execSql(db, String.join("", sql));
}
- public static int execSql(sqlite3 db, boolean throwOnError, String sql){
+ static int execSql(sqlite3 db, boolean throwOnError, String sql){
OutputPointer.Int32 oTail = new OutputPointer.Int32();
final byte[] sqlUtf8 = sql.getBytes(StandardCharsets.UTF_8);
int pos = 0, n = 1;
return rc;
}
- public static void execSql(sqlite3 db, String sql){
+ static void execSql(sqlite3 db, String sql){
execSql(db, true, sql);
}
- public static sqlite3_stmt prepare(sqlite3 db, String sql){
+ static sqlite3_stmt prepare(sqlite3 db, String sql){
outStmt.clear();
int rc = sqlite3_prepare(db, sql, outStmt);
affirm( 0 == rc );
rc = sqlite3_db_status(db, SQLITE_DBSTATUS_SCHEMA_USED, cur32, high32, false);
affirm( 0 == rc );
affirm( cur32.value > 0 );
- outln(cur32.value," ",high32.value);
affirm( high32.value == 0 /* always 0 for SCHEMA_USED */ );
sqlite3_close_v2(db);
outln("Woke up.");
}
- public static void main(String[] args) throws Exception {
- final long timeStart = System.nanoTime();
- test1();
+ private void runTests() throws Exception {
if(false) testCompileOption();
- final java.util.List<String> liArgs =
- java.util.Arrays.asList(args);
+ test1();
testOpenDb1();
testOpenDb2();
testPrepare123();
testAuthorizer();
testFts5();
testAutoExtension();
+ }
+
+ public static void main(String[] args) throws Exception {
+
+ final long timeStart = System.nanoTime();
+ new Tester1("main thread").runTests();
+ final long timeEnd = System.nanoTime();
+
+ final java.util.List<String> liArgs =
+ java.util.Arrays.asList(args);
//testSleep();
if(liArgs.indexOf("-v")>0){
sqlite3_do_something_for_developer();
//listBoundMethods();
}
- final long timeEnd = System.nanoTime();
affirm( SQLite3Jni.uncacheJniEnv() );
affirm( !SQLite3Jni.uncacheJniEnv() );
outln("Tests done. Metrics:");
outln("\tSQLite3Jni sqlite3_*() methods: "+
nNatives+" native methods and "+
(nMethods - nNatives)+" Java impls");
- outln("\tTotal time = "
+ outln("\tTotal test time = "
+((timeEnd - timeStart)/1000000.0)+"ms");
}
}
-C Bring\shandling\sof\sthe\sJava\sauto-ext\shandler\smore\sin\sline\swith\sthe\score\sin\sterms\sof\slocking\sand\smutability\sduring\straversal.\sThis\sremoves\sthe\sexplicit\ssynchronous\srequirement\sfrom\sthe\sJava\sopen()\sand\sauto-ext\sbindings.
-D 2023-08-14T17:12:55.531
+C Minor\sreshaping\sof\sTester1\smoving\stowards\smaking\sa\smulti-threaded\srun\smode.
+D 2023-08-15T09:26:47.524
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
F ext/jni/src/org/sqlite/jni/ResultCode.java ba701f20213a5f259e94cfbfdd36eb7ac7ce7797f2c6c7fca2004ff12ce20f86
F ext/jni/src/org/sqlite/jni/RollbackHook.java b04c8abcc6ade44a8a57129e33765793f69df0ba909e49ba18d73f4268d92564
F ext/jni/src/org/sqlite/jni/SQLFunction.java 09ce81c1c637e31c3a830d4c859cce95d65f5e02ff45f8bd1985b3479381bc46
-F ext/jni/src/org/sqlite/jni/SQLite3Jni.java 5897c1d11f6c780825c7ac739270365e6312990195fc135fc6b02d5536dbae18
-F ext/jni/src/org/sqlite/jni/Tester1.java 368e836d943d9e882d2a217d0f582ed4141d164f174bebc50715acd57549a09b
+F ext/jni/src/org/sqlite/jni/SQLite3Jni.java 99334f54f5f41feb4c14dc988b93219e37799e032f2bc07bda6323b1dfb99e75
+F ext/jni/src/org/sqlite/jni/Tester1.java 63f02d45ad073ac9d98eb7d681a024b38f6abf978dd1454be9346cbf347b1b57
F ext/jni/src/org/sqlite/jni/TesterFts5.java 59e22dd24af033ea8827d36225a2f3297908fb6af8818ead8850c6c6847557b1
F ext/jni/src/org/sqlite/jni/Tracer.java a5cece9f947b0af27669b8baec300b6dd7ff859c3e6a6e4a1bd8b50f9714775d
F ext/jni/src/org/sqlite/jni/UpdateHook.java e58645a1727f8a9bbe72dc072ec5b40d9f9362cb0aa24acfe93f49ff56a9016d
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
-P c84ded0e59aea4861d72b53b4b40cf580747c0f6ca58c334a996f1a825276cb5
-R 49ea94318acd6a04e4782997e6036b52
+P 42994b952e092ae4fa319395208622e887387ca3ff8ac57961c824a6c272bf0e
+R efccc6a7a6eed17207843d66c0fb4c2d
U stephan
-Z f760a4c17dc36361fbad3526fa5aa4c4
+Z 6864924ac8d4acb7bd32dec052e883fa
# Remove this line to create a well-formed Fossil manifest.