Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Basic error message tests with bug reproduction #16

Merged
merged 1 commit into from
Feb 15, 2017

Conversation

brody4hire
Copy link

@brody4hire brody4hire commented Oct 13, 2016

These tests reproduce a couple an issues I discovered from testing my Cordova plugin:

  • In case of nonsense singe-word SQL statements such as "101" or "false" SQLCipher for Android throws StringIndexOutOfBoundsException with a nonsense error message. no longer an issue in 3.5.5 release
  • While newer versions of the AOSP SQLite database classes include the SQLite error code in the error messages SQLCipher for Android only includes the error code in very specific cases such as a constraint violation.

For the Cordova plugin I will probably just add a quick fix to deal with the nonsense SQL case. (no longer needed)

@developernotes
Copy link
Member

Hi @brodybits,

Thanks for looking into this further. I wonder if it would be beneficial to use the setMessage(…) function available within the SQLCipherTest class as a means to further communicate helpful information regarding a failure case? This will cause the test row within the suite to display the message below the test name/status. Thoughts?

@brody4hire brody4hire force-pushed the basic-error-messages branch from 025639d to 526ef05 Compare October 13, 2016 21:51
@brody4hire
Copy link
Author

I just updated this PR to use setMessage to show the actual exception messages. Unfortunately some of these messages do not fit on a normal mobile device in portrait mode. When I switch between portrait and landscape mode the output is cleared and then I would have to rerun the test suite to get the output again.

I hope this is helpful. I don't know if I will work on a fix anytime soon.

@brody4hire
Copy link
Author

@developernotes I just rebased and made some minor updates. These tests reproduce sqlcipher/android-database-sqlcipher#295 and sqlcipher/android-database-sqlcipher#296 that I just raised. The reported messages are displayed by the test runner as well. Can you guys merge this one?

@developernotes
Copy link
Member

Hi @brodybits

We've just released a new version of SQLCipher for Android 3.4.1, and an update to SQLCipher for Android. We will take a look at this and get back to you. Thanks!

(with some incorrect error messages)
@brody4hire
Copy link
Author

I just updated this according to the actual behavior of 3.5.5:

As an extra note the PRAGMA cipher_version and "Verify Cipher Provider Version" tests still need to be updated.

@developernotes
Copy link
Member

Hi @brodybits

I have just uploaded the adjusted tests for cipher_version, cipher_provider, and the corresponding binaries. I will close this ticket, we can continue the discussion regarding #296 within that issue. Thanks!

@developernotes developernotes merged commit 5cbbbea into sqlcipher:master Feb 15, 2017
@developernotes
Copy link
Member

Hi @brodybits

Thanks for this, I've just merged it in!

@brody4hire
Copy link
Author

brody4hire commented Feb 15, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants