Gert Driesen
2008-08-13 14:04:23 UTC
Hey Charlie,
I was having a quick look at the impact of upgrading the version of NUnit in
Mono from 2.2 to 2.4.8, and noticed some test regressions.
I had a closer look at one of these regressions, and the reason it failed is
because EqualConstraint.StreamsEqual expects both streams to be readable and
seekable. If not, this results in an exception.
I don't think an assert should result in an exception (other than
AssertionException.cs).
I also noticed NUnit is changing the position in the stream (to the start of
the stream), and doesn't change it back afterwards. Should an Assert by
itself be allowed to change the state of a stream?
I'm also not sure if NUnit should actually read these streams. What will you
do if the stream is readable and not seekable? You'd change the position in
the stream (by positioning at the beginning and by reading it), and you
can't change it back to the origin position.
Apart from this, I wondered why NUnit is not always checking for reference
equality first? Why bothering checking the content of two streams, it they
are actually the same?
Gert
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
I was having a quick look at the impact of upgrading the version of NUnit in
Mono from 2.2 to 2.4.8, and noticed some test regressions.
I had a closer look at one of these regressions, and the reason it failed is
because EqualConstraint.StreamsEqual expects both streams to be readable and
seekable. If not, this results in an exception.
I don't think an assert should result in an exception (other than
AssertionException.cs).
I also noticed NUnit is changing the position in the stream (to the start of
the stream), and doesn't change it back afterwards. Should an Assert by
itself be allowed to change the state of a stream?
I'm also not sure if NUnit should actually read these streams. What will you
do if the stream is readable and not seekable? You'd change the position in
the stream (by positioning at the beginning and by reading it), and you
can't change it back to the origin position.
Apart from this, I wondered why NUnit is not always checking for reference
equality first? Why bothering checking the content of two streams, it they
are actually the same?
Gert
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/