* 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 -
This commit is contained in:
sergei 2009-10-15 21:27:31 +00:00
parent b48a0060b8
commit f387d7cb2d

View File

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