Skip to content

Commit

Permalink
Merge pull request #471 from kennethshackleton/sqlcipher-4.5.5
Browse files Browse the repository at this point in the history
SQLCipher 4.5.5.
  • Loading branch information
kennethshackleton authored Sep 9, 2023
2 parents 9e51b7d + fbac4d6 commit 20a1fd2
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ openssl.version.suffix=u
openssl.sha256=e2f8d84b523eecd06c7be7626830370300fbcc15386bf5142d72758f6963ebc6
openssl.pgp.sha256=7f564cada05f055c1534eae3fc7c19864eb2f6831cfcd91546e62476ba99e96e

sqlcipher.versionName=4.5.4
sqlcipher.versionName=4.5.5

org.gradle.caching=true
org.gradle.configuration-cache=true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ import com.bloomberg.selekt.SQL_MISUSE
import com.bloomberg.selekt.SQL_NOMEM
import com.bloomberg.selekt.SQL_NOT_A_DATABASE
import com.bloomberg.selekt.SQL_NOT_FOUND
import com.bloomberg.selekt.SQL_OK
import com.bloomberg.selekt.SQL_RANGE
import com.bloomberg.selekt.SQL_READONLY
import com.bloomberg.selekt.SQL_TOO_BIG
Expand Down Expand Up @@ -91,7 +90,6 @@ internal object SQLite : com.bloomberg.selekt.SQLite(sqlite) {
message: String,
context: String?
): Nothing {
require(code != SQL_OK) { "Result code is not an error: $code" }
val exceptionMessage = extendedErrorMessage(code, extendedCode, message, context)
throw when (code) {
SQL_BUSY -> SQLiteDatabaseLockedException(exceptionMessage)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,10 @@ internal class SQLiteTest {
}

@Test
fun openThenRekeySuccessfully() {
assertEquals(SQL_OK, SQLite.rekey(db, otherKey))
fun openThenRekeyWithoutKeyFails() {
assertFailsWith<SQLiteException> {
SQLite.rekey(db, otherKey)
}
}

@Test
Expand Down Expand Up @@ -735,7 +737,7 @@ internal class SQLiteTest {

@Test
fun exceptionForErrorOk() {
assertFailsWith<IllegalArgumentException> {
assertFailsWith<SQLiteException> {
SQLite.throwSQLException(SQL_OK, SQL_OK, "")
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ internal class SelektTest {

@Test
fun libVersion() {
assertEquals("3.41.2", Selekt.sqliteLibVersion())
assertEquals("3.42.0", Selekt.sqliteLibVersion())
}

@Test
fun libVersionNumber() {
assertEquals(3_041_002, Selekt.sqliteLibVersionNumber())
assertEquals(3_042_000, Selekt.sqliteLibVersionNumber())
}

@OptIn(Experimental::class)
Expand Down
8 changes: 4 additions & 4 deletions selekt-java/src/main/kotlin/com/bloomberg/selekt/SQLite.kt
Original file line number Diff line number Diff line change
Expand Up @@ -260,26 +260,26 @@ open class SQLite(
throwSQLException(errorCode(db), extendedErrorCode(db), errorMessage(db), context)

private fun checkSQLCode(code: SQLCode): SQLCode = when (code) {
SQL_OK -> code
SQL_OK -> SQL_OK
else -> throwSQLException(code, -1, "Error information not accessible.")
}

private fun checkConnectionSQLCode(db: Long, code: SQLCode): SQLCode {
if (SQL_OK == code) {
return code
return SQL_OK
}
throwSQLException(db)
}

private fun checkStatementSQLCode(statement: Long, code: SQLCode): SQLCode = if (SQL_OK == code) {
code
SQL_OK
} else {
throwSQLException(databaseHandle(statement))
}

private fun checkBindSQLCode(statement: Long, code: SQLCode): SQLCode {
if (SQL_OK == code) {
return code
return SQL_OK
}
throwSQLException(databaseHandle(statement))
}
Expand Down
2 changes: 1 addition & 1 deletion selekt-sqlite3/src/main/external/sqlcipher
Submodule sqlcipher updated 214 files

0 comments on commit 20a1fd2

Please sign in to comment.