[pypy-svn] r47843 - in pypy/dist/pypy/lang/smalltalk: . test
akuhn at codespeak.net
akuhn at codespeak.net
Wed Oct 24 18:05:12 CEST 2007
Author: akuhn
Date: Wed Oct 24 18:05:11 2007
New Revision: 47843
Modified:
pypy/dist/pypy/lang/smalltalk/squeakimage.py
pypy/dist/pypy/lang/smalltalk/test/test_miniimage.py
Log:
(akuhn, tverwaes)
Am Anfang war das Wort "Float" (succesfully retrieved the first string from loadedimage)
Modified: pypy/dist/pypy/lang/smalltalk/squeakimage.py
==============================================================================
--- pypy/dist/pypy/lang/smalltalk/squeakimage.py (original)
+++ pypy/dist/pypy/lang/smalltalk/squeakimage.py Wed Oct 24 18:05:11 2007
@@ -179,7 +179,7 @@
return self.special_objects[index]
COMPACT_CLASSES_ARRAY = 28
-FLOAT_CLASS = 10
+FLOAT_CLASS = 9
# ____________________________________________________________
@@ -305,10 +305,10 @@
def fillin_bytesobject(self, w_bytesobject):
bytes = []
for each in self.chunk.data:
- bytes.append((each >> 24) & 0xff)
- bytes.append((each >> 16) & 0xff)
- bytes.append((each >> 8) & 0xff)
- bytes.append((each >> 0) & 0xff)
+ bytes.append(chr((each >> 24) & 0xff))
+ bytes.append(chr((each >> 16) & 0xff))
+ bytes.append(chr((each >> 8) & 0xff))
+ bytes.append(chr((each >> 0) & 0xff))
w_bytesobject.w_class = self.g_class.w_object
w_bytesobject.bytes = bytes[:-(self.format & 3)] # omit odd bytes
Modified: pypy/dist/pypy/lang/smalltalk/test/test_miniimage.py
==============================================================================
--- pypy/dist/pypy/lang/smalltalk/test/test_miniimage.py (original)
+++ pypy/dist/pypy/lang/smalltalk/test/test_miniimage.py Wed Oct 24 18:05:11 2007
@@ -3,6 +3,7 @@
# one big method to rule them all
import py
from pypy.lang.smalltalk import squeakimage as sq
+from pypy.lang.smalltalk import model as sqm
mini_image = py.magic.autopath().dirpath().dirpath().join('mini.image')
@@ -62,5 +63,11 @@
w_float_class = image.special(sq.FLOAT_CLASS)
- #assert w_float_class.size() == 10
+ assert w_float_class.size() == 9
+
+ w_float_class_name = w_float_class.fetch(6)
+
+ assert isinstance(w_float_class_name, sqm.W_BytesObject)
+
+ assert w_float_class_name.bytes == list("Float")
More information about the Pypy-commit
mailing list