ModuleStorageTests all error out

Henrik Gedenryd h.gedenryd at open.ac.uk
Sat Feb 2 19:14:24 UTC 2002


Ned Konz wrote:

>> I explicitly tried this after updating and it all went fine for me. Does
>> anyone else see this? A Mac/Win issue perhaps?
> 
> I downloaded the 4689 image from st.cs.uiuc.edu and tried it, rather than
> updating.
> 

My thought is that if only MST fails, then this could be something with file
system code compatibility problems with Unix (both of you?) and/or Win
(Ned?). This is in fact the most probable reason. What is your platform?

I have attached some tests for FileDirectory + some fixes for those tests.
Can you run the tests before and after loading the fixes to see if this
works on your machine?

If they do help, does this fix the original problem too by any chance?

If they do not help, can you alter the fixes to make the tests pass?

Henrik


-------------- next part --------------
'From Squeak3.3alpha of 30 January 2002 [latest update: #4730] on 2 February 2002 at 7:06:54 pm'!
TestCase subclass: #FileDirectoryTests
	instanceVariableNames: ''
	classVariableNames: ''
	module: #(Squeak Technology Files Tests)!

!FileDirectoryTests methodsFor: 'existence tests' stamp: 'hg 2/2/2002 16:45'!
testDirectoryExists

	self assert: self myAssuredDirectory exists.
	self should: [self myDirectory containingDirectory 
					directoryExists: self myLocalDirectoryName].

	self testDeleteDirectory.
	self shouldnt: [self myDirectory containingDirectory 
						directoryExists: self myLocalDirectoryName]! !

!FileDirectoryTests methodsFor: 'existence tests' stamp: 'hg 2/2/2002 16:44'!
testDirectoryNamed

	self should: [(self myDirectory containingDirectory 
					directoryNamed: self myLocalDirectoryName) pathName 
						= self myDirectory pathName]! !

!FileDirectoryTests methodsFor: 'existence tests' stamp: 'hg 2/2/2002 16:45'!
testExists

	self should: [FileDirectory default exists].
	self should: [self myAssuredDirectory exists].

	self testDeleteDirectory.
	self shouldnt: [self myDirectory exists]! !

!FileDirectoryTests methodsFor: 'create/delete tests' stamp: 'hg 2/2/2002 16:45'!
testDeleteDirectory

	self assert: self myAssuredDirectory exists.
	self myDirectory containingDirectory deleteDirectory: self myLocalDirectoryName.
	self shouldnt: [self myDirectory exists]! !

!FileDirectoryTests methodsFor: 'resources' stamp: 'hg 2/2/2002 16:44'!
myAssuredDirectory

	^self myDirectory assureExistence! !

!FileDirectoryTests methodsFor: 'resources' stamp: 'hg 2/2/2002 16:42'!
myDirectory

	^FileDirectory default directoryNamed: self myLocalDirectoryName! !

!FileDirectoryTests methodsFor: 'resources' stamp: 'hg 2/2/2002 16:42'!
myLocalDirectoryName

	^'zTestDir'! !

-------------- next part --------------
'From Squeak3.3alpha of 30 January 2002 [latest update: #4730] on 2 February 2002 at 7:05:34 pm'!

!FileDirectory methodsFor: 'testing' stamp: 'hg 2/2/2002 16:09'!
directoryExists: filenameOrPath
	"Answer true if a directory of the given name exists. The given name may be either a full path name or a local directory within this directory."
	"FileDirectory default directoryExists: FileDirectory default pathName"

	| fName dir |
	FileDirectory splitName: filenameOrPath to:
		[:filePath :name |
			fName _ name.
			filePath isEmpty
				ifTrue: [dir _ self]
				ifFalse: [dir _ FileDirectory on: filePath]].

	^dir exists and: [
		self isCaseSensitive 
			ifTrue:[dir directoryNames includes: fName]
			ifFalse:[dir directoryNames anySatisfy: [:name| name sameAs: fName]]].
! !

!FileDirectory methodsFor: 'testing' stamp: 'hg 2/2/2002 17:00'!
exists

	| result |
	result _ self primLookupEntryIn: pathName index: 0.
	^result notNil and: [result ~= #badDirectoryPath]! !

!FileDirectory methodsFor: 'file directory' stamp: 'hg 2/2/2002 16:37'!
assureExistence
	"Make sure the current directory exists. If necessary, create all parts in between"

	self containingDirectory assureExistenceOfPath: self localName! !



More information about the Squeak-dev mailing list