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

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

Overview
Comment:Add an extra test for SQLiteOpenHelper.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:cf6a31d2c93f887298de3cc9259bc8cc64236000
User & Date: dan 2015-04-09 18:15:20
Context
2016-05-20
18:43
Update to Android Studio and gradle build system. check-in: 345de238a6 user: dan tags: trunk
2016-05-19
15:24
Upgrade this module so that it takes the form of an Android Studio project. check-in: b5fcf9e7da user: dan tags: android-studio
2015-04-09
18:15
Add an extra test for SQLiteOpenHelper. check-in: cf6a31d2c9 user: dan tags: trunk
2015-04-04
08:19
Update this code to support 64-bit pointers. See also: https://android.googlesource.com/platform/frameworks/base.git/+/738702d28ab7e0e89e3c6e18fd46cc1361917eb9 check-in: 3e4327dc6e user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/org/sqlite/app/customsqlite/CustomSqlite.java.

   337    337       }
   338    338       public void onCreate(SQLiteDatabase db){
   339    339         db.execSQL("CREATE TABLE t1(x)");
   340    340       }
   341    341       public void onUpgrade(SQLiteDatabase db, int iOld, int iNew){
   342    342       }
   343    343     } 
          344  +
          345  +  /*
          346  +  ** Check that SQLiteOpenHelper works.
          347  +  */
          348  +  public void helper_test_1() throws Exception {
          349  +    /* SQLiteDatabase.deleteDatabase(DB_PATH); */
          350  +
          351  +    MyHelper helper = new MyHelper(this);
          352  +    SQLiteDatabase db = helper.getWritableDatabase();
          353  +    db.execSQL("INSERT INTO t1 VALUES ('x'), ('y'), ('z')");
          354  +
          355  +    String res = string_from_t1_x(db);
          356  +    test_result("helper.1", res, ".x.y.z");
          357  +
          358  +    helper.close();
          359  +  }
   344    360   
   345    361     /*
   346    362     ** If this is a SEE build, check that SQLiteOpenHelper still works.
   347    363     */
   348    364     public void see_test_2() throws Exception {
   349    365       if( !SQLiteDatabase.hasCodec() ) return;
   350    366       SQLiteDatabase.deleteDatabase(DB_PATH);
................................................................................
   367    383   
   368    384       test_result("see_test_2.5", db_is_encrypted(), "encrypted");
   369    385     }
   370    386   
   371    387     public void run_the_tests(View view){
   372    388       System.loadLibrary("sqliteX");
   373    389       DB_PATH = getApplicationContext().getDatabasePath("test.db");
   374         -    DB_PATH.mkdirs();
          390  +    DB_PATH.getParentFile().mkdirs();
   375    391   
   376    392       myTV.setText("");
   377    393       myNErr = 0;
   378    394       myNTest = 0;
   379    395   
   380    396       try {
   381    397         report_version();
          398  +      helper_test_1();
   382    399         supp_char_test_1();
   383    400         csr_test_1();
   384    401         csr_test_2();
   385    402         thread_test_1();
   386    403         thread_test_2(); 
   387    404         see_test_1();
   388    405         see_test_2();