Browse Source

fcl-db: tests: move 1 test

git-svn-id: trunk@25064 -
lacak 12 years ago
parent
commit
a12a94eaff
2 changed files with 34 additions and 28 deletions
  1. 0 28
      packages/fcl-db/tests/testfieldtypes.pas
  2. 34 0
      packages/fcl-db/tests/testsqldb.pas

+ 0 - 28
packages/fcl-db/tests/testfieldtypes.pas

@@ -57,7 +57,6 @@ type
     procedure TestNonNullableParams;
     procedure TestDblQuoteEscComments;
     procedure TestpfInUpdateFlag; // bug 7565
-    procedure TestScript;
     procedure TestInsertReturningQuery;
     procedure TestOpenStoredProc;
     procedure TestOpenSpecialStatements;
@@ -204,33 +203,6 @@ begin
     end;
 end;
 
-procedure TTestFieldTypes.TestScript;
-
-var Ascript : TSQLScript;
-
-begin
-  Ascript := tsqlscript.create(nil);
-  try
-    with Ascript do
-      begin
-      DataBase := TSQLDBConnector(DBConnector).Connection;
-      transaction := TSQLDBConnector(DBConnector).Transaction;
-      script.clear;
-      script.append('create table a (id int);');
-      script.append('create table b (id int);');
-      ExecuteScript;
-      // Firebird/Interbase need a commit after a DDL statement. Not necessary for the other connections
-      TSQLDBConnector(DBConnector).CommitDDL;
-      end;
-  finally
-    AScript.Free;
-    TSQLDBConnector(DBConnector).Connection.ExecuteDirect('drop table a');
-    TSQLDBConnector(DBConnector).Connection.ExecuteDirect('drop table b');
-    // Firebird/Interbase need a commit after a DDL statement. Not necessary for the other connections
-    TSQLDBConnector(DBConnector).CommitDDL;
-  end;
-end;
-
 procedure TTestFieldTypes.TestLargeRecordSize;
 
 begin

+ 34 - 0
packages/fcl-db/tests/testsqldb.pas

@@ -38,11 +38,18 @@ type
     procedure ReplaceMe;
   end;
 
+  { TTestTSQLScript }
+
+  TTestTSQLScript = class(TSQLDBTestCase)
+  published
+    procedure TestExecuteScript;
+  end;
 
 implementation
 
 uses sqldbtoolsunit, toolsunit, sqldb;
 
+
 { TTestTSQLQuery }
 
 procedure TTestTSQLQuery.TestUpdateServerIndexDefs;
@@ -115,6 +122,32 @@ begin
   // replace this procedure with any test for TSQLConnection
 end;
 
+{ TTestTSQLScript }
+
+procedure TTestTSQLScript.TestExecuteScript;
+var Ascript : TSQLScript;
+begin
+  Ascript := TSQLScript.Create(nil);
+  try
+    with Ascript do
+      begin
+      DataBase := TSQLDBConnector(DBConnector).Connection;
+      Transaction := TSQLDBConnector(DBConnector).Transaction;
+      Script.Clear;
+      Script.Append('create table a (id int);');
+      Script.Append('create table b (id int);');
+      ExecuteScript;
+      // Firebird/Interbase need a commit after a DDL statement. Not necessary for the other connections
+      TSQLDBConnector(DBConnector).CommitDDL;
+      end;
+  finally
+    AScript.Free;
+    TSQLDBConnector(DBConnector).Connection.ExecuteDirect('drop table a');
+    TSQLDBConnector(DBConnector).Connection.ExecuteDirect('drop table b');
+    // Firebird/Interbase need a commit after a DDL statement. Not necessary for the other connections
+    TSQLDBConnector(DBConnector).CommitDDL;
+  end;
+end;
 
 { TSQLDBTestCase }
 
@@ -141,5 +174,6 @@ initialization
   begin
     RegisterTest(TTestTSQLQuery);
     RegisterTest(TTestTSQLConnection);
+    RegisterTest(TTestTSQLScript);
   end;
 end.