Selaa lähdekoodia

Added support for fbembedded to DBtestframework mantis 23008 patch from Reinier

git-svn-id: trunk@22608 -
ludob 12 vuotta sitten
vanhempi
commit
fed8e11f9b

+ 17 - 0
packages/fcl-db/tests/database.ini.txt

@@ -79,6 +79,23 @@ user=sysdba
 password=masterkey
 hostname=localhost
 
+; Firebird embedded
+; Same as Firebird, except we leave the host name blank
+; and specify a db without path.
+; Make sure your Firebird embedded library files (.dll/.so/.dylib)
+; are installed; e.g. on Windows, you can put them in this
+; directory.
+; Test code will create db if it doesn't exist; you can
+; delete an existing db file before the test to start
+; fresh.
+[firebirdembedded]
+connector=sql
+connectorparams=interbase
+name=fbembedtest.fdb
+user=sysdba
+password=masterkey
+hostname=
+
 ; ODBC database:
 [odbc]
 connector=sql

+ 8 - 0
packages/fcl-db/tests/sqldbtoolsunit.pas

@@ -229,6 +229,14 @@ begin
     UserName := dbuser;
     Password := dbpassword;
     HostName := dbhostname;
+    if (dbhostname='') and (SQLDbType=interbase) then
+    begin
+      // Firebird embedded: create database file if it doesn't yet exist
+      // Note: pagesize parameter has influence on behavior. We're using
+      // Firebird default here.
+      if not(fileexists(dbname)) then
+        FConnection.CreateDB; //Create testdb
+    end;
     if length(dbQuoteChars)>1 then
       begin
         FieldNameQuoteChars:=dbquotechars;