IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Composants FMX Delphi Discussion :

Demande de tests


Sujet :

Composants FMX Delphi

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Modérateur
    Avatar de tourlourou
    Homme Profil pro
    Biologiste ; Progr(amateur)
    Inscrit en
    Mars 2005
    Messages
    3 934
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 62
    Localisation : France, Yvelines (Île de France)

    Informations professionnelles :
    Activité : Biologiste ; Progr(amateur)

    Informations forums :
    Inscription : Mars 2005
    Messages : 3 934
    Billets dans le blog
    6
    Par défaut Demande de tests
    Bonjour,

    J'explore l'API SQLite, disponible sous différentes plateformes, dont plein que je ne puis tester...

    D'où mon appel au peuple !

    J'ai préparé à cet effet une application fmx simplissime :
    - une fiche avec un bouton et un mémo, dans laquelle il faut préciser le chemin de la dll adaptée à l'OS, récupérée sur le site : https://sqlite.org/download.html ;
    - une unité adhoc.

    Après exécution, il suffit d'un copier/coller du mémo dans ce fil de discussion en indiquant l'OS de test, et vous aurez droit à toute ma gratitude !

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    unit Unit1;
     
    interface
     
    uses
      System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
      FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, FMX.ScrollBox,
      FMX.Memo, FMX.Controls.Presentation, FMX.StdCtrls;
     
    const
       DllPath = 'sqlite3.dll'; //***** à changer SVP selon plateforme *****
     
    type
      TForm1 = class(TForm)
        Button1: TButton;
        Memo1: TMemo;
        procedure Button1Click(Sender: TObject);
      private
        { Déclarations privées }
      public
        { Déclarations publiques }
      end;
     
    var
      Form1: TForm1;
     
    implementation
     
    {$R *.fmx}
     
    uses UnitVfsTest;
     
    procedure TForm1.Button1Click(Sender: TObject);
    var
      Answer: Boolean;
      Calls: AnsiString;
    begin
      Answer := GetSysCalls(Calls);
      Memo1.Lines.Text := Calls;
    end;
     
    end.
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    unit UnitVfsTest;
     
    interface
     
    function GetSysCalls(var aString: AnsiString): Boolean;
     
    implementation
     
    uses System.SysUtils, Unit1;
     
    const
      // Error and Return Codes
      SQLITE_OK         = 0;   // Successful result
     
    type
      PSQLiteVFS  = ^TSQLiteVFS;  // système de fichier virtuel
      PSystemCall = Pointer; // sur les méthodes systèmes internes au VFS
      PSQLiteFile = Pointer;
     
      TGetSystemCall = function(aVFS: PSQLiteVFS; aName: PAnsiChar): PSystemCall; cdecl;
     
      // caractéristiques d'un VFS (Système de Fichier Virtuel)
      TSQLiteVFS = record
        // champs de la version 1 (à partir 3.5.0)
        Version: integer;    // VfsVersion = 3 pour la version 3.7.13 de SQLite
        szOsFile: integer;   // taille de la structure SQLite3_File retournée (champs personnels additionnels possibles)
        mxPathname: integer; // Maximum file pathname length
        Next: PSQLiteVFS;    // interne à SQLite : pas touche !
        Name: PAnsiChar;     // Name of this virtual file system : doit être unique
        AppData: Pointer;    // Pointer to application-specific data
        // si Name = nil => utiliser nom temporaire propre au VFS
        // OutFlags doit refléter SQLITE_OPEN_READONLY si besoin
        Open:   function(aVFS: PSQLiteVFS; aName: PAnsiChar; aFile: PSQLiteFile; aFlags: integer; var aOutFlags: integer): integer; cdecl;
        Delete: function(aVFS: PSQLiteVFS; aName: PAnsiChar; aSyncDir: LongBool): integer; cdecl;
        Access: function(aVFS: PSQLiteVFS; aName: PAnsiChar; aFlags: integer; var aOutFlags: integer): integer; cdecl;
        FullPathName: function(aVFS: PSQLiteVFS; aRelativePath: PAnsiChar; aFullPathSize: integer; aFullPath: PAnsiChar): integer; cdecl;
        // 4 fonctions liées aux librairies dynamiques
        DlOpen:   function(aVFS: PSQLiteVFS; aFileName: PAnsiChar): Pointer; cdecl;
        DlError: procedure(aVFS: PSQLiteVFS; aBufferSize: integer; aBuffer: PAnsiChar); cdecl;
        DlSym:    function(aVFS: PSQLiteVFS; aAddress: Pointer; aProcName: PAnsiChar): Pointer; cdecl; // pour Symbol = GetProcAddress
        DlClose: procedure(aVFS: PSQLiteVFS; aHandle: Pointer); cdecl;
        // pour initialisation générateur interne
        Randomness:   function(aVFS: PSQLiteVFS; aBufferSize: integer; aBuffer: PAnsiChar): integer; cdecl;
        Sleep:        function(aVFS: PSQLiteVFS; aMicroSeconds: integer): integer; cdecl;
        CurrentTime:  function(aVFS: PSQLiteVFS; var aNow: Double): integer; cdecl;
        GetLastError: function(aVFS: PSQLiteVFS; aBufferSize: integer; aBuffer: PAnsiChar): integer; cdecl;
        // champs de la version 2 (à partir 3.7.0 ?)
        CurrentTime64: function(aVFS: PSQLiteVFS; var aNow: int64): integer; cdecl; // SQLite utilisera CurrentTime si fonction non disponible
        // champs de la version 3 ; donnent accès pour débogage aux adresses des méthodes systèmes internes au VFS (à partir 3.7.6)
          // principe étendu à tous les appels à partir de la 3.7.10
        SetSystemCall:  function(aVFS: PSQLiteVFS; aName: PAnsiChar; aSystemCall: PSystemCall): integer; cdecl;
        GetSystemCall:  TGetSystemCall;
        NextSystemCall: function(aVFS: PSQLiteVFS; aName: PAnsiChar): PAnsiChar; cdecl;
        // Additional fields may be added in future releases (i.e. > 3.7.17 and Version > 3)
      end;
     
      function sqlite3_initialize(): integer; cdecl; external DllPath;
      function sqlite3_shutdown()  : integer; cdecl; external DllPath;
      function sqlite3_vfs_find(aVfsName: PAnsiChar): PSQLiteVFS; cdecl; external DllPath;
     
    var
      GetSystemCall: TGetSystemCall;
      DefaultVFS: PSQLiteVFS;
     
    function HasGotCall(aCall: AnsiString): AnsiString;
    begin
      Result := 'appel de la fonction ' + aCall + ' : ';
      if Assigned(GetSystemCall(DefaultVFS, PAnsiChar(aCall))) then
        Result := Result + 'OK'#13#10
      else
        Result := Result + 'ko'#13#10;
    end;
     
    function GetSysCalls(var aString: AnsiString): Boolean;
    begin
      Result := False;
      aString := '';
     
      if sqlite3_initialize <> SQLITE_OK then begin
        aString := 'librairie non initialisee';
        Exit;
      end;
     
      DefaultVFS := sqlite3_vfs_find(nil);
      if not Assigned(DefaultVFS) then
       begin
        aString := 'VFS par defaut non renvoyee';
        Exit;
       end
      else
        aString := 'VFS par defaut = ' + StrPas(DefaultVFS.Name) + #13#10;
     
      if not Assigned(DefaultVFS.GetSystemCall) then
       begin
        aString := 'GetSystemCall non renvoye';
        Exit;
       end
      else
        GetSystemCall := DefaultVFS.GetSystemCall;
     
      aString := aString + HasGotCall('ReadFile'); // sous Windows
      aString := aString + HasGotCall('WriteFile');
      aString := aString + HasGotCall('read');     // sous Unix
      aString := aString + HasGotCall('write');
      aString := aString + HasGotCall('pread');
      aString := aString + HasGotCall('pwrite');
      aString := aString + HasGotCall('pread64');
      aString := aString + HasGotCall('pwrite64');
     
      Result := True;
     
      sqlite3_shutdown;
    end;
     
    end.
    Citation Envoyé par sous Windows 32 Bits
    VFS par defaut = win32
    appel de la fonction ReadFile : OK
    appel de la fonction WriteFile : OK
    appel de la fonction read : ko
    appel de la fonction write : ko
    appel de la fonction pread : ko
    appel de la fonction pwrite : ko
    appel de la fonction pread64 : ko
    appel de la fonction pwrite64 : ko
    Citation Envoyé par sous Windows 64 Bits
    VFS par defaut = win32 // tiens ! pas de différence de nom...
    appel de la fonction ReadFile : OK
    appel de la fonction WriteFile : OK
    appel de la fonction read : ko
    appel de la fonction write : ko
    appel de la fonction pread : ko
    appel de la fonction pwrite : ko
    appel de la fonction pread64 : ko
    appel de la fonction pwrite64 : ko
    Delphi 5 Pro - Delphi 11.3 Alexandria Community Edition - CodeTyphon 6.90 sous Windows 10 ; CT 6.40 sous Ubuntu 18.04 (VM)
    . Ignorer la FAQ Delphi et les Cours et Tutoriels Delphi nuit gravement à notre code !

  2. #2
    Expert confirmé
    Avatar de Ph. B.
    Homme Profil pro
    Freelance
    Inscrit en
    Avril 2002
    Messages
    1 786
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 59
    Localisation : France, Haute Garonne (Midi Pyrénées)

    Informations professionnelles :
    Activité : Freelance
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2002
    Messages : 1 786
    Par défaut
    Bonjour,
    Citation Envoyé par tourlourou Voir le message
    Après exécution, il suffit d'un copier/coller du mémo dans ce fil de discussion en indiquant l'OS de test, et vous aurez droit à toute ma gratitude !
    Windows 8.1 Home 64 bits, Delphi 10.2.3 CE, SQLite 3.25.3 :
    32 bits :
    VFS par defaut = win32
    appel de la fonction ReadFile : OK
    appel de la fonction WriteFile : OK
    appel de la fonction read : ko
    appel de la fonction write : ko
    appel de la fonction pread : ko
    appel de la fonction pwrite : ko
    appel de la fonction pread64 : ko
    appel de la fonction pwrite64 : ko
    64 bits :
    VFS par defaut = win32
    appel de la fonction ReadFile : OK
    appel de la fonction WriteFile : OK
    appel de la fonction read : ko
    appel de la fonction write : ko
    appel de la fonction pread : ko
    appel de la fonction pwrite : ko
    appel de la fonction pread64 : ko
    appel de la fonction pwrite64 : ko
    Windows 8.1 Home 64 bits, Delphi XE2 Pro, SQLite 3.25.3 : Idem (après quelques ajustements du code)

    Windows 7 Pro 64 bits (VirtualBox), Delphi 10.2.3 CE, SQLite 3.25.3 : Idem,
    Windows 7 Pro 64 bits (VirtualBox), Delphi XE2 Pro, SQLite 3.25.3 : Idem,
    Windows XP Home 32 bits (VirtualBox), Delphi 10.2.3 CE, SQLite 3.25.3 : Idem pour le 32 bits,
    Windows XP Home 32 bits (VirtualBox), Delphi XE2 Pro, SQLite 3.25.3 : Idem pour le 32 bits.

  3. #3
    Modérateur
    Avatar de tourlourou
    Homme Profil pro
    Biologiste ; Progr(amateur)
    Inscrit en
    Mars 2005
    Messages
    3 934
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 62
    Localisation : France, Yvelines (Île de France)

    Informations professionnelles :
    Activité : Biologiste ; Progr(amateur)

    Informations forums :
    Inscription : Mars 2005
    Messages : 3 934
    Billets dans le blog
    6
    Par défaut
    Merci !
    Delphi 5 Pro - Delphi 11.3 Alexandria Community Edition - CodeTyphon 6.90 sous Windows 10 ; CT 6.40 sous Ubuntu 18.04 (VM)
    . Ignorer la FAQ Delphi et les Cours et Tutoriels Delphi nuit gravement à notre code !

  4. #4
    Modérateur
    Avatar de tourlourou
    Homme Profil pro
    Biologiste ; Progr(amateur)
    Inscrit en
    Mars 2005
    Messages
    3 934
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 62
    Localisation : France, Yvelines (Île de France)

    Informations professionnelles :
    Activité : Biologiste ; Progr(amateur)

    Informations forums :
    Inscription : Mars 2005
    Messages : 3 934
    Billets dans le blog
    6
    Par défaut
    Citation Envoyé par Ubuntu 18.04 64 Bits
    VFS par defaut = unix
    appel de la fonction ReadFile : ko
    appel de la fonction WriteFile : ko
    appel de la fonction read : OK
    appel de la fonction write : OK
    appel de la fonction pread : ko
    appel de la fonction pwrite : ko
    appel de la fonction pread64 : OK
    appel de la fonction pwrite64 : OK
    Non sans mal (merci Lazarus).

    J'aimerais savoir si on a les mêmes résultats sous android et produits Apple...
    Delphi 5 Pro - Delphi 11.3 Alexandria Community Edition - CodeTyphon 6.90 sous Windows 10 ; CT 6.40 sous Ubuntu 18.04 (VM)
    . Ignorer la FAQ Delphi et les Cours et Tutoriels Delphi nuit gravement à notre code !

Discussions similaires

  1. Demande de test bénévole sur algorithme de cryptage
    Par Marlan dans le forum Sécurité
    Réponses: 2
    Dernier message: 02/11/2011, 12h01
  2. Demande de test du shell et du système de fichiers de mon OS
    Par bouazza92 dans le forum Programmation d'OS
    Réponses: 15
    Dernier message: 16/06/2008, 13h04
  3. [Système] Demande de test de script
    Par cirtey dans le forum Langage
    Réponses: 8
    Dernier message: 14/06/2007, 17h36
  4. [Demande de tests] SELRA Moteur d'affichage 3D
    Par Bob.Killer dans le forum OpenGL
    Réponses: 5
    Dernier message: 31/08/2005, 19h18

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo