Terricide / csharp-sqlite

Automatically exported from code.google.com/p/csharp-sqlite
0 stars 0 forks source link

Windows phone test app fails #161

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Same problem with the 3.7.7.1.71 download, or latest code with Hg
2. Open 
Community.CsharpSqlite.SQLiteClient.WP\Community.CsharpSqlite.SQLiteClient.WP.sl
n with VS2010
3. Set SQLiteClientTests.WinPhone as the Startup project.
4. Remove the source code file in src. This file was not used by the project 
and causes compiler errors.
5. Build and run (same result on both emulator and device)

What is the expected output? What do you see instead?
Expect to see SUCCESSFUL all the way through.
Instead:
Beginning Test on Community.CsharpSqlite.SQLITEC
FAIL - CreateTable
SUCCESS - DataType Test
SUCCESS - InsertTable
...

However, with the CreateTable failure, I am not sure whether the following 
SUCCESS are valid at all.

It has SUCCESS until
FAIL - FastInsertMany
FAIL - DropTable

What version of the product are you using? On what operating system?
Try with the latest code grabbed with Hg, and 3.7.7.1.71.zip
Ran on 7.1 Mango

Please provide any additional information below.

Original issue reported on code.google.com by johnhu...@libriance.com on 1 Jun 2012 at 12:08

GoogleCodeExporter commented 8 years ago

Original comment by noah.hart@gmail.com on 2 Jun 2012 at 12:11

GoogleCodeExporter commented 8 years ago
Issue 160 looks to fix the CreateTable test failure, but still throwing "Value 
does not fall within the expected range" (table looks created although). 
Rollback call at the FastInsertMany test, throws an empty message exception and 
Droptable test the following one: "Attempt to access the method failed: 
System.IO.Path.GetTempPath()". Not dropping table at all.

Original comment by israel_l...@yahoo.es on 21 Jun 2012 at 8:16

GoogleCodeExporter commented 8 years ago
I got same error.

Original comment by nduyl...@gmail.com on 28 Jul 2012 at 2:22

Attachments:

GoogleCodeExporter commented 8 years ago
please reply,i have the same error and wasted more time to solve it

Original comment by eng.sos...@gmail.com on 26 Nov 2012 at 9:41

GoogleCodeExporter commented 8 years ago
Find "crypto.cs" file and change "codec_cipher" function to this:

   static int codec_cipher( cipher_ctx ctx, Pgno pgno, int mode, int size, byte[] bIn, byte[] bOut )
    {
      int iv;
      int tmp_csz, csz;

      CODEC_TRACE( "codec_cipher:entered pgno=%d, mode=%d, size=%d\n", pgno, mode, size );

      /* just copy raw data from in to out when key size is 0
      * i.e. during a rekey of a plaintext database */
      if ( ctx.key_sz == 0 )
      {
        Array.Copy( bIn, bOut, bIn.Length );//memcpy(out, in, size);
        return SQLITE_OK;
      }

      MemoryStream dataStream = new MemoryStream();
      CryptoStream encryptionStream;
      if ( mode == CIPHER_ENCRYPT )
      {
        encryptionStream = new CryptoStream( dataStream, ctx.encryptor, CryptoStreamMode.Write );
      }
      else
      {
        encryptionStream = new CryptoStream( dataStream, ctx.decryptor, CryptoStreamMode.Write );
      }
      encryptionStream.Write( bIn, 0, size );
      try
      {
          encryptionStream.FlushFinalBlock();
      }
      catch (Exception)
      {
          //ignore padding exception
      }
      dataStream.Position = 0;

      dataStream.Read( bOut, 0, (int)dataStream.Length == bOut.Length ? (int)dataStream.Length : bOut.Length );
      try
      { 
          encryptionStream.Close(); 
      }
      catch (Exception)
      {
          //ignore padding exception
      }
      dataStream.Close();

      return SQLITE_OK;
    }

Original comment by ookhryme...@gmail.com on 24 Dec 2012 at 6:48

GoogleCodeExporter commented 8 years ago
This is helps to fix problem for Windows Phone.. at least temporary.. 

Original comment by ookhryme...@gmail.com on 24 Dec 2012 at 6:49

GoogleCodeExporter commented 8 years ago
I'll test this fix on other platforms, or we can #IF the code for windows phone 
if needed

Original comment by noah.hart@gmail.com on 24 Dec 2012 at 1:24

GoogleCodeExporter commented 8 years ago
Also see bug https://code.google.com/p/csharp-sqlite/issues/detail?id=136. So 
we might not just if-def this, but actaully fix the problem?

Original comment by j.schr...@gmail.com on 25 Apr 2013 at 10:08