Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2006-10

last change to xmlreporter.pas (part of fpcUnit) not working

4 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Graeme Geldenhuys

Hi,

I got an update of FPC 2.1.1 today, and my fpcUnit test results are not correct anymore. The XML test listener (xmlreporter.pas) is not writing the Failures correctly. It keeps creating new (duplicate) list nodes for each Failure. The Error nodes are working fine.

See a snippet of my output (tested both under the GUI Test Runner and the Text Test Runner).

Notice that there are duplicate ListOfFailures nodes, when there should only be one. The errors are correct, because their is only one ListOfErrors node created.

-------------------------------------------
....snip....
<ListOfFailures>
<Failure>
<Message>TTestTIUtils.tiFloatToCurrency: Failed on 4 expected: &lt;$ 0.01&gt; but was: &lt;$ 0.00&gt;</Message>
<ExceptionClass>EAssertionFailedError</ExceptionClass> <ExceptionMessage>Failed on 4 expected: &lt;$ 0.01&gt; but was: &lt;$ 0.00&gt;</ExceptionMessage>
</Failure>
</ListOfFailures>
<ListOfFailures>
<Failure>
<Message>TTestTIUtils.tiFloatToCurrencyHide0: Failed on 4 expected: &lt;$ 0.01&gt; but was: &lt;$ 0.00&gt;</Message> <ExceptionClass>EAssertionFailedError</ExceptionClass> <ExceptionMessage>Failed on 4 expected: &lt;$ 0.01&gt; but was: &lt;$ 0.00&gt;</ExceptionMessage>
</Failure>
</ListOfFailures>
<ListOfErrors>
<Error>
<Message>TTestTIUtils.tiGetComputerName: Access violation</Message> <ExceptionClass>EAccessViolation</ExceptionClass>
<ExceptionMessage>Access violation</ExceptionMessage> <SourceUnitName>./include/lclintf.inc</SourceUnitName> <LineNumber>213</LineNumber>
<FailedMethodName>GETCONTROLCONSTRAINTS</FailedMethodName> </Error>
<Error>
<Message>TTestTIUtils.tiGetTempDir: Access violation</Message> <ExceptionClass>EAccessViolation</ExceptionClass>
<ExceptionMessage>Access violation</ExceptionMessage> <SourceUnitName>./include/lclintf.inc</SourceUnitName> <LineNumber>213</LineNumber>
<FailedMethodName>GETCONTROLCONSTRAINTS</FailedMethodName> </Error>
<Error>
<Message>TTestTIUtils.tiGetUserName: Access violation</Message> <ExceptionClass>EAccessViolation</ExceptionClass>
<ExceptionMessage>Access violation</ExceptionMessage> <SourceUnitName>./include/lclintf.inc</SourceUnitName> <LineNumber>213</LineNumber>
<FailedMethodName>GETCONTROLCONSTRAINTS</FailedMethodName> </Error>
....snip....
-------------------------------------------

Regards,
- Graeme -

There's no place like 127.0.0.1

Reply by email

Dean Zobec
to Graeme Geldenhuys

Graeme Geldenhuys ha scritto:

Show quoted text 13 lines
Hi, I got an update of FPC 2.1.1 today, and my fpcUnit test results are not correct anymore. The XML test listener (xmlreporter.pas) is not writing the Failures correctly. It keeps creating new (duplicate) list nodes for each Failure. The Error nodes are working fine. See a snippet of my output (tested both under the GUI Test Runner and the Text Test Runner). Notice that there are duplicate ListOfFailures nodes, when there should only be one. The errors are correct, because their is only one ListOfErrors node created.

Sorry for that, but I'm unable to reproduce the problem, seems that my code is working ok. The change in xmlreporter was so simple that I didn't even bother to write tests for it, I will write them now! :) Can you send me the source of the runner you are using as well as a simple suite of tests that creates the problem, so that I can run them and see what's happening? I need to reproduce the bug to be able to fix it.

Dean

Show quoted text 53 lines
------------------------------------------- ....snip.... <ListOfFailures> <Failure> <Message>TTestTIUtils.tiFloatToCurrency: Failed on 4 expected: &lt;$ 0.01&gt; but was: &lt;$ 0.00&gt;</Message> <ExceptionClass>EAssertionFailedError</ExceptionClass> <ExceptionMessage>Failed on 4 expected: &lt;$ 0.01&gt; but was: &lt;$ 0.00&gt;</ExceptionMessage> </Failure> </ListOfFailures> <ListOfFailures> <Failure> <Message>TTestTIUtils.tiFloatToCurrencyHide0: Failed on 4 expected: &lt;$ 0.01&gt; but was: &lt;$ 0.00&gt;</Message> <ExceptionClass>EAssertionFailedError</ExceptionClass> <ExceptionMessage>Failed on 4 expected: &lt;$ 0.01&gt; but was: &lt;$ 0.00&gt;</ExceptionMessage> </Failure> </ListOfFailures> <ListOfErrors> <Error> <Message>TTestTIUtils.tiGetComputerName: Access violation</Message> <ExceptionClass>EAccessViolation</ExceptionClass> <ExceptionMessage>Access violation</ExceptionMessage> <SourceUnitName>./include/lclintf.inc</SourceUnitName> <LineNumber>213</LineNumber> <FailedMethodName>GETCONTROLCONSTRAINTS</FailedMethodName> </Error> <Error> <Message>TTestTIUtils.tiGetTempDir: Access violation</Message> <ExceptionClass>EAccessViolation</ExceptionClass> <ExceptionMessage>Access violation</ExceptionMessage> <SourceUnitName>./include/lclintf.inc</SourceUnitName> <LineNumber>213</LineNumber> <FailedMethodName>GETCONTROLCONSTRAINTS</FailedMethodName> </Error> <Error> <Message>TTestTIUtils.tiGetUserName: Access violation</Message> <ExceptionClass>EAccessViolation</ExceptionClass> <ExceptionMessage>Access violation</ExceptionMessage> <SourceUnitName>./include/lclintf.inc</SourceUnitName> <LineNumber>213</LineNumber> <FailedMethodName>GETCONTROLCONSTRAINTS</FailedMethodName> </Error> ....snip.... ------------------------------------------- Regards, - Graeme -

Reply by email

Dean Zobec
to Dean Zobec

Dean Zobec ha scritto:

Show quoted text 21 lines
Graeme Geldenhuys ha scritto: > Hi, > > I got an update of FPC 2.1.1 today, and my fpcUnit test results are > not correct anymore. The XML test listener (xmlreporter.pas) is not > writing the Failures correctly. It keeps creating new (duplicate) > list nodes for each Failure. The Error nodes are working fine. > > See a snippet of my output (tested both under the GUI Test Runner and > the Text Test Runner). > > Notice that there are duplicate ListOfFailures nodes, when there > should only be one. The errors are correct, because their is only one > ListOfErrors node created. Sorry for that, but I'm unable to reproduce the problem, seems that my code is working ok. The change in xmlreporter was so simple that I didn't even bother to write tests for it, I will write them now! :) Can you send me the source of the runner you are using as well as a simple suite of tests that creates the problem, so that I can run them and see what's happening? I need to reproduce the bug to be able to fix it.

Ok, I've got it, finally I've been able to reproduce it. Now let's see how to fix it.
Thank you again,
Dean

Reply by email

Graeme Geldenhuys
to Dean Zobec

I did a diff to see what exactly changed in the xmlreporter. Just looking at the code makes no sense why it shouldn't work. Well, maybe it just isn't that obvious. :-)

It looks like the FDoc.FindNode isn't working (it doesn't find the node and recreates it). Also the FindNode in TDOMDocument is different to the FindNode in TDomNode. Not sure I understand why, but then I didn't look into it much.

This brings me to another point. Wouldn't it be a small speed improvement if we rather call FResults.FindNode instead of FDoc.FindNode. After all, all nodes we are interested in are in the FResults node.

Regards,
- Graeme -

Dean Zobec wrote
Ok, I've got it, finally I've been able to reproduce it. Now let's see how to fix it. Thank you again, Dean
There's no place like 127.0.0.1

Reply by email