Issue 4416 in pharo: StreamTests

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Issue 4416 in pharo: StreamTests

pharo
Status: Accepted
Owner: [hidden email]
Labels: Milestone-1.4 Type-Squeak

New issue 4416 by [hidden email]: StreamTests
http://code.google.com/p/pharo/issues/detail?id=4416

We should check that.

Name: CollectionsTests-topa.185
Author: topa
Time: 23 May 2011, 1:50:29.396 pm
UUID: 8e536e32-1fb9-4bdd-8d4b-3088b46e41a9
Ancestors: CollectionsTests-nice.184

Mall testcase for RWBinaryOrTextStream on exisiting
collections.

=============== Diff against CollectionsTests-nice.184 ===============

Item was added:
+ ----- Method: RWBinaryOrTextStreamTest>>testExisiting (in  
category 'tests') -----
+ testExisiting
+
+       | string stream |
+
+       string := 'hello'.
+
+       stream := RWBinaryOrTextStream on: string.
+       self assert: stream contents = string.
+
+       stream := RWBinaryOrTextStream on: string.
+       stream setToEnd.
+       self assert: stream position = string size.
+ !



_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 4416 in pharo: StreamTests

pharo

Comment #1 on issue 4416 by [hidden email]: StreamTests
http://code.google.com/p/pharo/issues/detail?id=4416

attached as a cs.

Test fails

Attachments:
        RWBinaryOrTextStreamTest.1.cs  649 bytes


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 4416 in pharo: StreamTests

pharo
Updates:
        Labels: -Milestone-1.4

Comment #2 on issue 4416 by [hidden email]: StreamTests
http://code.google.com/p/pharo/issues/detail?id=4416

(No comment was entered for this change.)


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 4416 in pharo: StreamTests

pharo
In reply to this post by pharo

Comment #5 on issue 4416 by [hidden email]: StreamTests
http://code.google.com/p/pharo/issues/detail?id=4416

The problem was that readLimit was always 0, so contents will always go  
from 1 to 0.

-------------------------
WriteStream>>on:
on: aCollection

        super on: aCollection.
        readLimit := 0.
        writeLimit := aCollection size
-------------------------

But super on ALSO defines readLimit as aCollection size.
PostionableStream>>on:
-------------------------
on: aCollection

        collection := aCollection.
        readLimit := aCollection size.
        position := 0.
        self reset
-------------------------

If we remove "readLimit := 0." The bug is fixed.
SLICE added, and the test runned.


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 4416 in pharo: StreamTests

pharo

Comment #6 on issue 4416 by [hidden email]: StreamTests
http://code.google.com/p/pharo/issues/detail?id=4416

I correct myself SLICE wasn't added D:


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker