[squeak-dev] The Trunk: NetworkTests-dtl.31.mcz

commits at source.squeak.org commits at source.squeak.org
Tue Jul 17 12:28:41 UTC 2012

David T. Lewis uploaded a new version of NetworkTests to project The Trunk:

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

Name: NetworkTests-dtl.31
Author: dtl
Time: 17 July 2012, 8:28:15.3 am
UUID: 3aa39e19-695e-4d09-a022-6d659641a6c0
Ancestors: NetworkTests-dtl.30

Add SocketTest>>testStringFromAddress to ensure that NetNameResolver class>>stringFromAddress: works for SocketAddress as well as for old style ByteArray addresses.

=============== Diff against NetworkTests-dtl.30 ===============

Item was added:
+ ----- Method: SocketTest>>testStringFromAddress (in category 'tests') -----
+ testStringFromAddress
+ 	"Addresses are represented by a ByteArray if NetNameResolver useOldNetwork
+ 	is true, or by by SocketAddress otherwise. Ensure the #stringFromAddress: works
+ 	in either case. Older versions of SocketPlugin in the VM do not provide support
+ 	for SocketAddress, and ByteArray addresses are used in that case."
+ 	| localAddress localAddressBytes localName1 localName2 |
+ 	localAddress := NetNameResolver localHostAddress. "ByteArray or SocketAddress"
+ 	localAddressBytes := localAddress asByteArray.
+ 	localName1 := NetNameResolver stringFromAddress: localAddress.
+ 	localName2 := NetNameResolver stringFromAddress: localAddressBytes.
+ 	self assert: localName1 = localName2
+ !

More information about the Squeak-dev mailing list