SQLite Android Bindings
Check-in [61fae530b5]
Not logged in

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

Overview
Comment:Add test case to detect problems with zipvfs deployments.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:61fae530b57a0bd37fb3f015967118b807576762
User & Date: dan 2017-09-11 15:39:13
Context
2017-10-24
19:33
Update this project to version 3.21.0 check-in: 9fa38e007e user: dan tags: trunk
2017-09-11
15:39
Add test case to detect problems with zipvfs deployments. check-in: 61fae530b5 user: dan tags: trunk
2017-08-24
17:00
Update this project to version 3.20.1. check-in: a283755297 user: dan tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

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

1
2
3
4

5
6
7
8
9
10
11
...
423
424
425
426
427
428
429

430
431
432
433
434
435
436
...
440
441
442
443
444
445
446





























447
448
449
450
451
452
453
package org.sqlite.customsqlitetest;

import android.content.Context;
import android.database.Cursor;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.TextView;

import org.json.JSONObject;
................................................................................

        myTV.setText("");
        myNErr = 0;
        myNTest = 0;

        try {
            report_version();

            helper_test_1();
            supp_char_test_1();
            csr_test_1();
            csr_test_2();
            thread_test_1();
            thread_test_2();
            see_test_1();
................................................................................

            myTV.append("\n" + myNErr + " errors from " + myNTest + " tests\n");
        } catch(Exception e) {
            myTV.append("Exception: " + e.toString() + "\n");
            myTV.append(android.util.Log.getStackTraceString(e) + "\n");
        }
    }






























    public void json_test_1() throws Exception {
        SQLiteDatabase.deleteDatabase(DB_PATH);
        SQLiteDatabase db = SQLiteDatabase.openOrCreateDatabase(DB_PATH, null);
        final long t0 = System.nanoTime();
        db.beginTransaction();
        String res = "";




>







 







>







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
...
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
...
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
package org.sqlite.customsqlitetest;

import android.content.Context;
import android.database.Cursor;
import android.net.Uri;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.TextView;

import org.json.JSONObject;
................................................................................

        myTV.setText("");
        myNErr = 0;
        myNTest = 0;

        try {
            report_version();
            run_ds_test();
            helper_test_1();
            supp_char_test_1();
            csr_test_1();
            csr_test_2();
            thread_test_1();
            thread_test_2();
            see_test_1();
................................................................................

            myTV.append("\n" + myNErr + " errors from " + myNTest + " tests\n");
        } catch(Exception e) {
            myTV.append("Exception: " + e.toString() + "\n");
            myTV.append(android.util.Log.getStackTraceString(e) + "\n");
        }
    }

    private void printPragma(SQLiteDatabase db) {
      Cursor cursor = db.rawQuery("SELECT * FROM pragma_compile_options;", null);
      cursor.moveToFirst();
      do {
        Log.e("ds", cursor.getString(0));
      } while(cursor.moveToNext());
    }

    private void run_ds_test() throws Exception {
      File file = new File(getExternalCacheDir().getPath() + "/dstest.db");
      file.delete();
      file.createNewFile();

      Uri.Builder builder = new Uri.Builder();
      builder.scheme("file");
      builder.path(file.toString());
      builder.appendQueryParameter("zv","zlib");
      builder.appendQueryParameter("password","datascan");
      Uri uri = builder.build();
      Log.e("ds", "uri is " + uri.toString());

      Log.e("ds", "file uri is " + new File(uri.toString()).getPath());
      SQLiteDatabase sqLiteDatabase = SQLiteDatabase.openOrCreateDatabase(new File(uri.toString()), null);
      printPragma(sqLiteDatabase);
        myTV.append("ds_test ok\n");

    }


    public void json_test_1() throws Exception {
        SQLiteDatabase.deleteDatabase(DB_PATH);
        SQLiteDatabase db = SQLiteDatabase.openOrCreateDatabase(DB_PATH, null);
        final long t0 = System.nanoTime();
        db.beginTransaction();
        String res = "";