Skip to content

Commit

Permalink
updated tests and jnilibs
Browse files Browse the repository at this point in the history
  • Loading branch information
iulian0512 committed Feb 10, 2024
1 parent 2ebff55 commit 71d2dc5
Show file tree
Hide file tree
Showing 11 changed files with 31 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ public class DatabaseCursorTest /*implements PerformanceTestCase*/ {
private SQLiteDatabase mDatabase;
private File mDatabaseFile;

static {
System.loadLibrary("android_spatialite");
}

@Before
public void setUp() throws Exception {
File dbDir = ApplicationProvider.getApplicationContext().getDir("tests", Context.MODE_PRIVATE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ public class DatabaseErrorHandlerTest {
private static final String DB_NAME = "database_test.db";
private File dbDir;

static {
System.loadLibrary("android_spatialite");
}

@Before
protected void setUp() throws Exception {
dbDir = ApplicationProvider.getApplicationContext().getDir(this.getClass().getName(), Context.MODE_PRIVATE);
Expand Down
10 changes: 8 additions & 2 deletions app/src/androidTest/java/org/spatialite/DatabaseLocaleTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@
@RunWith(AndroidJUnit4.class)
public class DatabaseLocaleTest {

static {
System.loadLibrary("android_spatialite");
}


private SQLiteDatabase mDatabase;

private static final String[] STRINGS = {
Expand Down Expand Up @@ -151,7 +156,7 @@ public void testRemoveAccents() {
Cursor cursor = mDatabase.rawQuery("SELECT id,remove_accents(data) FROM test", null);

// Move to the first (and only) row in the result set
if (cursor != null && cursor.moveToNext()) {
if (cursor != null && cursor.moveToFirst()) {
int id=cursor.getInt(0);
// Get the string from the query result
String data = cursor.getString(1);
Expand All @@ -168,7 +173,8 @@ public void testRemoveAccents() {
}

// Close the cursor
cursor.close();
if(!cursor.isClosed())
cursor.close();
} else {
throw new AssertionError("Cursor is null or empty.");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ public class DatabaseStatementTest /*implements PerformanceTestCase*/ {
private SQLiteDatabase mDatabase;
private File mDatabaseFile;

static {
System.loadLibrary("android_spatialite");
}

@Before
public void setUp() throws Exception {
File dbDir = ApplicationProvider.getApplicationContext().getDir("tests", Context.MODE_PRIVATE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@

public class NewDatabasePerformanceTestSuite extends TestSuite {

static {
System.loadLibrary("android_spatialite");
}
public static TestSuite suite() {
TestSuite suite =
new TestSuite(NewDatabasePerformanceTestSuite.class.getName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ public class NewDatabasePerformanceTests {
// Edit this to change the test run times. The original is 100.
final static int kMultiplier = 1;

static {
System.loadLibrary("android_spatialite");
}

public static class PerformanceBase extends TestCase /*implements PerformanceTestCase*/ {
protected static final int CURRENT_DATABASE_VERSION = 42;
protected SQLiteDatabase mDatabase;
Expand Down
4 changes: 4 additions & 0 deletions app/src/androidTest/java/org/spatialite/NullTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
@RunWith(AndroidJUnit4.class)
public class NullTest {


static {
System.loadLibrary("android_spatialite");
}
private SQLiteDatabase mDatabase;
private File mDatabaseFile;

Expand Down
Binary file modified app/src/main/jniLibs/arm64-v8a/libsqlite3.a
Binary file not shown.
Binary file modified app/src/main/jniLibs/armeabi-v7a/libsqlite3.a
Binary file not shown.
Binary file modified app/src/main/jniLibs/x86_64/libsqlite3.a
Binary file not shown.
Binary file modified static_libs/sqlite-amalgamation-3430200/libsqlite3.a
Binary file not shown.

0 comments on commit 71d2dc5

Please sign in to comment.