Browse Source

* Only EXMLReadError is expected to be thrown from a negative test, any other exception is unexpected and should render the test as failed.

git-svn-id: trunk@13860 -
sergei 16 years ago
parent
commit
f387d7cb2d
1 changed files with 6 additions and 4 deletions
  1. 6 4
      packages/fcl-xml/tests/xmlts.pp

+ 6 - 4
packages/fcl-xml/tests/xmlts.pp

@@ -168,7 +168,7 @@ begin
   try
     for I := 0 to tables.Count-1 do
     begin
-      el := TDOMElement(tables.Item[I]);
+      el := TDOMElement(tables[I]);
       id := el['id'];
       if id = 'valid' then
         table_valid := el
@@ -208,7 +208,7 @@ begin
   Index := 0;
 
   repeat
-    Child := Children.Item[Index];
+    Child := Children[Index];
     if Child = nil then Break;
     Inc(index);
 
@@ -314,7 +314,7 @@ begin
   writeln('Testing, validation = ', FValidating);
   try
     for I := 0 to Cases.Count-1 do
-      RunTest(Cases.Item[I] as TDOMElement);
+      RunTest(Cases[I] as TDOMElement);
     I := Cases.Count;
   finally
     Cases.Free;
@@ -349,6 +349,7 @@ var
   Positive: Boolean;
   outURI: UTF8string;
   FailMsg: string;
+  ExceptionClass: TClass;
   docNode, refNode: TDOMNode;
   docMap, refMap: TDOMNamedNodeMap;
   docN, refN: TDOMNotation;
@@ -407,6 +408,7 @@ begin
       on E: Exception do
         if E.ClassType <> EAbort then
         begin
+          ExceptionClass := E.ClassType;
           FailMsg := E.Message;
           FValError := '';
         end;
@@ -435,7 +437,7 @@ begin
         if FailMsg <> '' then  // Fatal error
         begin
           { outside not-wf category it is a test failure }
-          if table <> table_not_wf then
+          if (table <> table_not_wf) or (ExceptionClass <> EXMLReadError) then
           begin
             Inc(FFailCount);
             Diagnose(Element, table, dcFail, FailMsg);