Browse Source

* Clean up TestScript-test properly

git-svn-id: trunk@10814 -
joost 17 years ago
parent
commit
f6538406c3
1 changed files with 14 additions and 9 deletions
  1. 14 9
      packages/fcl-db/tests/testfieldtypes.pas

+ 14 - 9
packages/fcl-db/tests/testfieldtypes.pas

@@ -155,15 +155,20 @@ var Ascript : TSQLScript;
 
 
 begin
 begin
   Ascript := tsqlscript.create(nil);
   Ascript := tsqlscript.create(nil);
-  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;
-    end;
+  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;
+      end;
+  finally
+    TSQLDBConnector(DBConnector).Connection.ExecuteDirect('drop table a');
+    TSQLDBConnector(DBConnector).Connection.ExecuteDirect('drop table b');
+  end;
 end;
 end;
 
 
 procedure TTestFieldTypes.TestInt;
 procedure TTestFieldTypes.TestInt;