SQLite Android Bindings
Check-in [d3b3c801ac]
Not logged in

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 | SQL 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
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
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to sqlite3test/src/main/java/org/sqlite/customsqlitetest/MainActivity.java.

    48     48           String res;
    49     49   
    50     50           db = SQLiteDatabase.openOrCreateDatabase(":memory:", null);
    51     51           st = db.compileStatement("SELECT sqlite_version()");
    52     52           res = st.simpleQueryForString();
    53     53   
    54     54           myTV.append("SQLite version " + res + "\n\n");
           55  +        db.close();
    55     56       }
    56     57   
    57     58       public void test_warning(String name, String warning){
    58     59           myTV.append("WARNING:" + name + ": " + warning + "\n");
    59     60       }
    60     61   
    61     62       public void test_result(String name, String res, String expected, long t0){
................................................................................
   116    117           });
   117    118   
   118    119           t.start();
   119    120           try {
   120    121               t.join();
   121    122           } catch (InterruptedException e) {
   122    123           }
          124  +        db.close();
   123    125       }
   124    126   
   125    127       /*
   126    128       ** Test that a database connection may be accessed from a second thread.
   127    129       */
   128    130       public void thread_test_2(){
   129    131           final long t0 = System.nanoTime();
................................................................................
   156    158           db.endTransaction();
   157    159           try { t.join(); } catch(InterruptedException e) {}
   158    160           if( SQLiteDatabase.hasCodec() ){
   159    161               test_result("thread_test_2", res, "blocked", t0);
   160    162           } else {
   161    163               test_result("thread_test_2", res, "concurrent", t0);
   162    164           }
          165  +        db.close();
   163    166       }
   164    167   
   165    168       /*
   166    169       ** Use a Cursor to loop through the results of a SELECT query.
   167    170       */
   168    171       public void csr_test_2() throws Exception {
   169    172           final long t0 = System.nanoTime();
................................................................................
   388    391           final long t3 = System.nanoTime();
   389    392   
   390    393           db = helper.getWritableDatabase();
   391    394           test_result("see_test_2.4", res, ".x.y.z", t3);
   392    395           final long t4 = System.nanoTime();
   393    396   
   394    397           test_result("see_test_2.5", db_is_encrypted(), "encrypted", t4);
          398  +        db.close();
   395    399       }
   396    400   
   397    401       private static boolean mLibIsLoaded = false;
   398    402       private static void loadLibrary() {
   399    403           if (!mLibIsLoaded) {
   400    404               System.loadLibrary("sqliteX");
   401    405               mLibIsLoaded = true;