1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-29 08:01:23 +03:00

JNI test code cleanups.

FossilOrigin-Name: e202b6e69da8cced114d027cf2e91a04dfdd50b601b3274214783f7d750c558c
This commit is contained in:
stephan
2023-08-19 11:52:36 +00:00
parent 8d9179bd07
commit 187da43379
5 changed files with 44 additions and 45 deletions

View File

@ -70,13 +70,7 @@ public class Tester1 implements Runnable {
}
private void test1(){
if( 0==tId ){
outln("libversion_number:",
sqlite3_libversion_number(),"\n",
sqlite3_libversion(),"\n",SQLITE_SOURCE_ID);
}
affirm(sqlite3_libversion_number() == SQLITE_VERSION_NUMBER);
//outln("threadsafe = "+sqlite3_threadsafe());
affirm(SQLITE_MAX_LENGTH > 0);
affirm(SQLITE_MAX_TRIGGER_DEPTH>0);
}
@ -1072,7 +1066,7 @@ public class Tester1 implements Runnable {
sqlite3_close(db);
}
private void testAutoExtension(){
private synchronized void testAutoExtension(){
final ValueHolder<Integer> val = new ValueHolder<>(0);
final ValueHolder<String> toss = new ValueHolder<>(null);
final AutoExtension ax = new AutoExtension(){
@ -1173,31 +1167,29 @@ public class Tester1 implements Runnable {
testOpenDb1();
testOpenDb2();
testPrepare123();
if( true ){
testBindFetchInt();
testBindFetchInt64();
testBindFetchDouble();
testBindFetchText();
testBindFetchBlob();
testSql();
testCollation();
testToUtf8();
testStatus();
testUdf1();
testUdfJavaObject();
testUdfAggregate();
testUdfWindow();
testTrace();
testProgress();
testCommitHook();
testRollbackHook();
testUpdateHook();
testAuthorizer();
if(!fromThread){
// skip for now: messes with affirm() counts. testFts5();
testBusy();
testAutoExtension();
}
testBindFetchInt();
testBindFetchInt64();
testBindFetchDouble();
testBindFetchText();
testBindFetchBlob();
testSql();
testCollation();
testToUtf8();
testStatus();
testUdf1();
testUdfJavaObject();
testUdfAggregate();
testUdfWindow();
testTrace();
testProgress();
testCommitHook();
testRollbackHook();
testUpdateHook();
testAuthorizer();
testAutoExtension();
if(!fromThread){
// testFts5(); // skip for now: messes with affirm() counts.
testBusy();
}
}
@ -1235,6 +1227,9 @@ public class Tester1 implements Runnable {
final long timeStart = System.currentTimeMillis();
int nLoop = 0;
outln("libversion_number:",
sqlite3_libversion_number(),"\n",
sqlite3_libversion(),"\n",SQLITE_SOURCE_ID);
for( int n = 0; n < nRepeat; ++n ){
if( nThread==null || nThread<=1 ){
new Tester1(0).runTests(false);
@ -1247,7 +1242,7 @@ public class Tester1 implements Runnable {
ex.submit( new Tester1(i) );
}
ex.shutdown();
ex.awaitTermination(2, java.util.concurrent.TimeUnit.SECONDS);
ex.awaitTermination(nThread*200, java.util.concurrent.TimeUnit.MILLISECONDS);
ex.shutdownNow();
}
}