Skip to content

Commit b7ae817

Browse files
Update reference to 4.4.2 release
1 parent e114050 commit b7ae817

File tree

7 files changed

+46
-6
lines changed

7 files changed

+46
-6
lines changed

app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ dependencies {
2323
// implementation files('libs/sqlcipher.jar')
2424

2525
// For testing local AAR packages:
26-
//implementation (name: 'android-database-sqlcipher-4.4.1-release', ext: 'aar')
26+
//implementation (name: 'android-database-sqlcipher-4.4.2-release', ext: 'aar')
2727

2828
// For testing on remote AAR references:
29-
implementation 'net.zetetic:android-database-sqlcipher:4.4.1@aar'
29+
implementation 'net.zetetic:android-database-sqlcipher:4.4.2@aar'
3030

3131
implementation "androidx.sqlite:sqlite:2.0.1"
3232

app/src/main/java/net/zetetic/tests/JavaClientLibraryVersionTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
public class
66
JavaClientLibraryVersionTest extends SQLCipherTest {
77

8-
private final String EXPECTED_SQLCIPHER_ANDROID_VERSION = "4.4.1";
8+
private final String EXPECTED_SQLCIPHER_ANDROID_VERSION = "4.4.2";
99

1010
@Override
1111
public boolean execute(SQLiteDatabase database) {

app/src/main/java/net/zetetic/tests/PragmaCipherVersionTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
public class PragmaCipherVersionTest extends SQLCipherTest {
88

9-
private final String CURRENT_CIPHER_VERSION = "4.4.1";
9+
private final String CURRENT_CIPHER_VERSION = "4.4.2";
1010

1111
@Override
1212
public boolean execute(SQLiteDatabase database) {
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
package net.zetetic.tests;
2+
3+
import net.sqlcipher.Cursor;
4+
import net.sqlcipher.database.SQLiteDatabase;
5+
6+
import java.util.Locale;
7+
8+
// Provided via GitHub Issue: https://github.com/sqlcipher/android-database-sqlcipher/issues/526
9+
public class SummingStepTest extends SQLCipherTest {
10+
@Override
11+
public boolean execute(SQLiteDatabase database) {
12+
database.execSQL("create table sample_session(_id , start_time TEXT , client_id TEXT, type_id TEXT, value TEXT);");
13+
database.execSQL("create table sample_point(_id ,start_time TEXT , client_id TEXT, type_id TEXT, value TEXT);");
14+
database.execSQL("insert into sample_session(_id , start_time ,client_id, type_id, value) values(1, 1000,5 ,2, 0);");
15+
database.execSQL("insert into sample_point(_id , start_time ,client_id, type_id, value) values(1, 1000,5 ,2, 46);");
16+
database.execSQL("insert into sample_point(_id , start_time ,client_id, type_id, value) values(2, 1000,6 ,2, 46);");
17+
String query = "select sample_session._id,sample_session.start_time,sample_session.type_id, sample_session.client_id," +
18+
"sum ( case sample_point.type_id when 2 then sample_point.value else 0 end) as step, sum ( case sample_point.type_id when 4 then sample_point.value else 0 end) as calorie, sum ( case sample_point.type_id when 3 then sample_point.value else 0 end) as distance, " +
19+
"sum ( case sample_point.type_id when 5 then sample_point.value else 0 end) as altitude_offset from sample_session INNER JOIN sample_point ON sample_session.start_time = sample_point.start_time and sample_session.client_id = sample_point.client_id " +
20+
"where sample_session.client_id =? and sample_point.client_id =? and sample_point.type_id in ( ?,?,?,? ) " +
21+
"group by sample_session.start_time ORDER BY sample_session.start_time DESC limit 0,1000";
22+
Cursor cursor = database.rawQuery(query, new String[]{"5","5","2","4","3","5"});
23+
if(cursor != null){
24+
cursor.moveToFirst();
25+
int index = cursor.getColumnIndex("step");
26+
long value = cursor.getInt(index);
27+
setMessage(String.format(Locale.getDefault(), "Expected:%d Returned:%d", 46, value));
28+
return value == 46;
29+
}
30+
return false;
31+
}
32+
33+
@Override
34+
public String getName() {
35+
return "SummingStepTest Test";
36+
}
37+
}

app/src/main/java/net/zetetic/tests/TestSuiteRunner.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ private void runSuite() {
6969

7070
private List<SQLCipherTest> getTestsToRun() {
7171
List<SQLCipherTest> tests = new ArrayList<>();
72+
73+
tests.add(new SummingStepTest());
74+
7275
tests.add(new JsonCastTest());
7376
tests.add(new SimpleQueryTest());
7477
tests.add(new DefaultCursorWindowAllocationTest());

app/src/main/java/net/zetetic/tests/support/JavaClientLibraryVersionTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
public class JavaClientLibraryVersionTest extends SupportTest {
77

8-
private final String EXPECTED_SQLCIPHER_ANDROID_VERSION = "4.4.1";
8+
private final String EXPECTED_SQLCIPHER_ANDROID_VERSION = "4.4.2";
99

1010
@Override
1111
public boolean execute(SQLiteDatabase database) {

app/src/main/java/net/zetetic/tests/support/PragmaCipherVersionTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
public class PragmaCipherVersionTest extends SupportTest {
99

10-
private final String CURRENT_CIPHER_VERSION = "4.4.1";
10+
private final String CURRENT_CIPHER_VERSION = "4.4.2";
1111

1212
@Override
1313
public boolean execute(SQLiteDatabase database) {

0 commit comments

Comments
 (0)