Skip to content

Commit 661f5d2

Browse files
committed
Returns -1, not throws, actually.
1 parent 00c3c91 commit 661f5d2

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

ICSharpCode.SharpZipLib.Tests/GZip/GZipTests.cs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,13 +100,18 @@ public void ZeroLengthInputStream()
100100
{
101101
var gzi = new GZipInputStream(new MemoryStream());
102102
bool exception = false;
103-
try {
104-
gzi.ReadByte();
105-
} catch {
103+
int retval = int.MinValue;
104+
try
105+
{
106+
retval = gzi.ReadByte();
107+
}
108+
catch
109+
{
106110
exception = true;
107111
}
108112

109-
Assert.IsTrue(exception, "reading from an empty stream should cause an exception");
113+
Assert.IsFalse(exception, "reading from an empty stream should not cause an exception");
114+
Assert.That(retval, Is.EqualTo(-1), "should yield -1 byte value");
110115
}
111116

112117
[Test]

0 commit comments

Comments
 (0)