Rev 72: Bring in some of Robert's fixes for 64-bit platforms. in http://bazaar.launchpad.net/~meliae-dev/meliae/trunk

John Arbash Meinel john at arbash-meinel.com
Thu Sep 10 22:42:22 BST 2009


At http://bazaar.launchpad.net/~meliae-dev/meliae/trunk

------------------------------------------------------------
revno: 72 [merge]
revision-id: john at arbash-meinel.com-20090910214206-4r5omuajw0btp79s
parent: john at arbash-meinel.com-20090910212306-eob5sjgkiz21we9n
parent: robertc at robertcollins.net-20090910211403-971sixmm7fuwkr5h
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: trunk
timestamp: Thu 2009-09-10 16:42:06 -0500
message:
  Bring in some of Robert's fixes for 64-bit platforms.
added:
  Makefile                       makefile-20090910210635-0d8q79mv0x0lcqf7-1
modified:
  meliae/tests/test__scanner.py  test__scanner.py-20090401185718-094vrprmymne09r1-3
-------------- next part --------------
=== added file 'Makefile'
--- a/Makefile	1970-01-01 00:00:00 +0000
+++ b/Makefile	2009-09-10 21:14:03 +0000
@@ -0,0 +1,9 @@
+all: build_inplace
+
+check:
+	python run_tests.py
+
+build_inplace:
+	python setup.py build_ext -i
+
+.PHONY: all build_inplace

=== modified file 'meliae/tests/test__scanner.py'
--- a/meliae/tests/test__scanner.py	2009-09-10 19:50:57 +0000
+++ b/meliae/tests/test__scanner.py	2009-09-10 21:42:06 +0000
@@ -26,6 +26,11 @@
     tests,
     )
 
+
+STRING_BASE = 8
+STRING_SCALING = 4
+
+
 class TestSizeOf(tests.TestCase):
 
     def assertSizeOf(self, num_words, obj, extra_size=0, has_gc=True):
@@ -35,14 +40,14 @@
         self.assertEqual(expected_size, _scanner.size_of(obj))
 
     def test_empty_string(self):
-        self.assertSizeOf(6, '', extra_size=0, has_gc=False)
+        self.assertSizeOf(STRING_SCALING, '', extra_size=0+STRING_BASE, has_gc=False)
 
     def test_short_string(self):
-        self.assertSizeOf(6, 'a', extra_size=1, has_gc=False)
+        self.assertSizeOf(STRING_SCALING, 'a', extra_size=1+STRING_BASE, has_gc=False)
 
     def test_long_string(self):
-        self.assertSizeOf(6, ('abcd'*25)*1024,
-                          extra_size=100*1024, has_gc=False)
+        self.assertSizeOf(STRING_SCALING, ('abcd'*25)*1024,
+                          extra_size=100*1024+STRING_BASE, has_gc=False)
 
     def test_tuple(self):
         self.assertSizeOf(3, ())



More information about the bazaar-commits mailing list