Commits

Remi Meier committed 0624b1c

failing test for writing to 2nd page of an object

Comments (0)

Files changed (1)

c7/test/test_basic.py

         assert is_in_nursery(new)
         stm_push_root(new)
         stm_minor_collect()
-        stm_minor_collect()
         new = stm_pop_root()
 
         assert not is_in_nursery(new)
+
+    def test_large_obj_write(self):
+        # test obj which doesn't fit into the size_classes
+        # expects: LARGE_OBJECT_WORDS  36
+        size_class = 1000 # too big
+        obj_size = size_class * 8
+        assert obj_size > 4096 # we want more than 1 page
+        assert obj_size < 4096 * 1024 # in the nursery
+
+        stm_start_transaction()
+        new = stm_allocate(obj_size)
+        assert is_in_nursery(new)
+        stm_push_root(new)
+        stm_stop_transaction()
+        new = stm_pop_root()
+
+        stm_start_transaction()
+        stm_write(new)
+        # write to 2nd page of object!!
+        wnew = stm_get_real_address(new)
+        wnew[4097] = 'x'
+
+        self.switch(1)
+        stm_start_transaction()
+        stm_read(new)
+        rnew = stm_get_real_address(new)
+        assert rnew[4097] == '\0'
         
+
             
 
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.