SQLite Android Bindings

Check-in [d3b3c801ac]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Close databases for all tests to avoid annoying debugger messages
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | api-level-9
Files: files | file ages | folders
SHA1: d3b3c801ac86fd6798341969bfed70d3cf398511
User & Date: pjw 2017-04-22 14:24:43.946
Context
2017-04-26
07:11
Changes to build to use Android Studio ndk build support. (check-in: 0f8ab794cf user: pjw tags: api-level-9)
2017-04-22
14:24
Close databases for all tests to avoid annoying debugger messages (check-in: d3b3c801ac user: pjw tags: api-level-9)
01:36
Update to android studio and build tools; modifications to support down to API level 9; new tests; sqlite 3.18.00 (check-in: 4a9598aa14 user: pjw tags: api-level-9)
Changes
Side-by-Side Diff Show Whitespace Changes Patch
Changes to sqlite3test/src/main/java/org/sqlite/customsqlitetest/MainActivity.java.
48
49
50
51
52
53
54

55
56
57
58
59
60
61
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62







+







        String res;

        db = SQLiteDatabase.openOrCreateDatabase(":memory:", null);
        st = db.compileStatement("SELECT sqlite_version()");
        res = st.simpleQueryForString();

        myTV.append("SQLite version " + res + "\n\n");
        db.close();
    }

    public void test_warning(String name, String warning){
        myTV.append("WARNING:" + name + ": " + warning + "\n");
    }

    public void test_result(String name, String res, String expected, long t0){
116
117
118
119
120
121
122

123
124
125
126
127
128
129
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131







+







        });

        t.start();
        try {
            t.join();
        } catch (InterruptedException e) {
        }
        db.close();
    }

    /*
    ** Test that a database connection may be accessed from a second thread.
    */
    public void thread_test_2(){
        final long t0 = System.nanoTime();
156
157
158
159
160
161
162

163
164
165
166
167
168
169
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172







+







        db.endTransaction();
        try { t.join(); } catch(InterruptedException e) {}
        if( SQLiteDatabase.hasCodec() ){
            test_result("thread_test_2", res, "blocked", t0);
        } else {
            test_result("thread_test_2", res, "concurrent", t0);
        }
        db.close();
    }

    /*
    ** Use a Cursor to loop through the results of a SELECT query.
    */
    public void csr_test_2() throws Exception {
        final long t0 = System.nanoTime();
388
389
390
391
392
393
394

395
396
397
398
399
400
401
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405







+







        final long t3 = System.nanoTime();

        db = helper.getWritableDatabase();
        test_result("see_test_2.4", res, ".x.y.z", t3);
        final long t4 = System.nanoTime();

        test_result("see_test_2.5", db_is_encrypted(), "encrypted", t4);
        db.close();
    }

    private static boolean mLibIsLoaded = false;
    private static void loadLibrary() {
        if (!mLibIsLoaded) {
            System.loadLibrary("sqliteX");
            mLibIsLoaded = true;