[squeak-dev] The Trunk: Tests-dtl.136.mcz

commits at source.squeak.org commits at source.squeak.org
Wed Nov 30 12:13:08 UTC 2011


David T. Lewis uploaded a new version of Tests to project The Trunk:
http://source.squeak.org/trunk/Tests-dtl.136.mcz

==================== Summary ====================

Name: Tests-dtl.136
Author: dtl
Time: 27 November 2011, 6:51:19.271 pm
UUID: 4b78cc43-10bc-4d80-a724-44c94ba846ac
Ancestors: Tests-ul.135

Fix ReferenceStream handling of weak references. Test and patches by Juan Vuletich.
<http://lists.squeakfoundation.org/pipermail/squeak-dev/2011-November/162285.html>

Packages affected:
  Kernel-Objects
  System-Object Storage
  Tests-Object Storage

If we serialize a model with weak references to views, only the model should be serialized and not the views.

The bug became apparent only when dumping a model to a SmartRefStream, that calls #references, and the serialized stream was later materialized in an image where the view classes had been deleted. In such rare cases, materialization would fail when trying to reference these absent classes. If serializing to a ReferenceStream, the bug didn't become apparent (views were never serialized). If serializing to a SmartRefStream, but view classes still existed, the bug didn't really become apparent (because views were not actually deserialized), the only effect was a larger file.

=============== Diff against Tests-ul.135 ===============

Item was changed:
  SystemOrganization addCategory: #'Tests-Exceptions'!
  SystemOrganization addCategory: #'Tests-Files'!
  SystemOrganization addCategory: #'Tests-Compiler'!
  SystemOrganization addCategory: #'Tests-Digital Signatures'!
  SystemOrganization addCategory: #'Tests-Object Events'!
  SystemOrganization addCategory: #'Tests-System-Support'!
  SystemOrganization addCategory: #'Tests-Bugs'!
  SystemOrganization addCategory: #'Tests-ObjectsAsMethods'!
  SystemOrganization addCategory: #'Tests-PrimCallController'!
  SystemOrganization addCategory: #'Tests-Release'!
  SystemOrganization addCategory: #'Tests-Utilities'!
  SystemOrganization addCategory: #'Tests-VM'!
  SystemOrganization addCategory: #'Tests-Hex'!
  SystemOrganization addCategory: #'Tests-Monticello'!
  SystemOrganization addCategory: #'Tests-Localization'!
  SystemOrganization addCategory: #'Tests-FilePackage'!
  SystemOrganization addCategory: #'Tests-Finalization'!
  SystemOrganization addCategory: #'Tests-Dependencies'!
  SystemOrganization addCategory: #'Tests-Monticello-Mocks'!
+ SystemOrganization addCategory: #'Tests-Object Storage'!
+ SystemOrganization addCategory: #'Tests-System-Object Storage'!

Item was added:
+ TestCase subclass: #ReferenceStreamTest
+ 	instanceVariableNames: ''
+ 	classVariableNames: ''
+ 	poolDictionaries: ''
+ 	category: 'Tests-System-Object Storage'!

Item was added:
+ ----- Method: ReferenceStreamTest>>testWeakDumps (in category 'testing') -----
+ testWeakDumps
+ 	"Test that if we serialize a model with weak references to views, only the model is serialized and not the views.
+ 	
+ 	Note: The bug became apparent only when dumping a model to a SmartRefStream, that calls #references, and the serialized stream
+ 	was later materialized in an image where the view classes had been deleted. In such rare cases, materialization would fail when trying to reference these
+ 	absent classes. If serializing to a ReferenceStream, the bug didn't become apparent (views were never serialized). If serializing to a SmartRefStream, but
+ 	view classes still existed, the bug didn't really become apparent (because views were not actually deserialized), the only effect was a larger file.
+ 	
+ 	ReferenceStreamTest new testWeakDumps
+ 	"
+ 	| oldInstance refStream |
+ 	oldInstance :=StringHolder new contents: 'This is a text'.
+ 	oldInstance addDependent: Morph new.
+ 	refStream := ReferenceStream on: (DummyStream on: nil).
+ 	refStream nextPut: oldInstance.
+ 	self deny: (refStream references keys anySatisfy: [ :dumpedObject | dumpedObject isKindOf: Morph ])!




More information about the Squeak-dev mailing list