Explorar o código

* Fixed TestBlobSize test

git-svn-id: trunk@12510 -
joost %!s(int64=16) %!d(string=hai) anos
pai
achega
3657380e77
Modificáronse 1 ficheiros con 19 adicións e 1 borrados
  1. 19 1
      packages/fcl-db/tests/testfieldtypes.pas

+ 19 - 1
packages/fcl-db/tests/testfieldtypes.pas

@@ -58,6 +58,7 @@ type
 
     procedure TestParametersAndDates;
     procedure TestExceptOnsecClose;
+    procedure TestErrorOnEmptyStatement;
 
     procedure TestBlob;
     procedure TestChangeBlob;
@@ -85,7 +86,7 @@ type
 
 implementation
 
-uses sqldbtoolsunit,toolsunit, variants, sqldb, bufdataset, strutils;
+uses sqldbtoolsunit,toolsunit, variants, sqldb, bufdataset, strutils, dbconst;
 
 Type HackedDataset = class(TDataset);
 
@@ -1514,6 +1515,23 @@ begin
     end;
 end;
 
+procedure TTestFieldTypes.TestErrorOnEmptyStatement;
+var PassException : boolean;
+begin
+  PassException:=False;
+  with TSQLDBConnector(DBConnector).Query do
+    begin
+    sql.Text := '';
+    try
+      Open;
+    except
+      on E:EDatabaseError do
+        if pos(SErrNoStatement,E.Message) > -1 then PassException := True;
+    end;
+    AssertTrue(PassException);
+    end;
+end;
+
 initialization
   if uppercase(dbconnectorname)='SQL' then RegisterTest(TTestFieldTypes);
 end.