Bert Freudenberg uploaded a new version of Tests to project The Trunk:
http://source.squeak.org/trunk/Tests-bf.305.mcz ==================== Summary ==================== Name: Tests-bf.305 Author: bf Time: 8 December 2014, 2:10:38.345 am UUID: 8013d62e-ef54-4473-805f-c8841ceb4f83 Ancestors: Tests-ul.304 Restore timestamps lost in assignment conversion. =============== Diff against Tests-ul.304 =============== Item was changed: ----- Method: BitmapStreamTests>>randomFloat (in category 'private') ----- randomFloat "Answer a random 32-bit float" | w | random seed: (w := random nextValue). ^w! Item was changed: ----- Method: BitmapStreamTests>>randomWord (in category 'private') ----- randomWord "Answer a random 32-bit integer" | w | random seed: (w := random nextValue). ^w truncated! Item was changed: ----- Method: BitmapStreamTests>>setUp (in category 'Running') ----- setUp random := Random new.! Item was changed: ----- Method: BitmapStreamTests>>testMatrixTransform2x3WithImageSegment (in category 'tests-MatrixTransform2x3') ----- testMatrixTransform2x3WithImageSegment array := MatrixTransform2x3 new. 1 to: 6 do: [ :i | array at: i put: self randomFloat ]. self validateImageSegment ! Item was changed: ----- Method: BitmapStreamTests>>testMatrixTransform2x3WithRefStream (in category 'tests-MatrixTransform2x3') ----- testMatrixTransform2x3WithRefStream array := MatrixTransform2x3 new. 1 to: 6 do: [ :i | array at: i put: self randomFloat ]. self validateRefStream ! Item was changed: ----- Method: BitmapStreamTests>>testMatrixTransform2x3WithRefStreamOnDisk (in category 'tests-MatrixTransform2x3') ----- testMatrixTransform2x3WithRefStreamOnDisk array := MatrixTransform2x3 new. 1 to: 6 do: [ :i | array at: i put: self randomFloat ]. self validateRefStreamOnDisk ! Item was changed: ----- Method: BitmapStreamTests>>testMatrixTransform2x3WithSmartRefStream (in category 'tests-MatrixTransform2x3') ----- testMatrixTransform2x3WithSmartRefStream array := MatrixTransform2x3 new. 1 to: 6 do: [ :i | array at: i put: self randomFloat ]. self validateSmartRefStream ! Item was changed: ----- Method: BitmapStreamTests>>testMatrixTransform2x3WithSmartRefStreamOnDisk (in category 'tests-MatrixTransform2x3') ----- testMatrixTransform2x3WithSmartRefStreamOnDisk array := MatrixTransform2x3 new. 1 to: 6 do: [ :i | array at: i put: self randomFloat ]. self validateSmartRefStreamOnDisk ! Item was changed: ----- Method: BitmapStreamTests>>testShortIntegerArrayWithImageSegment (in category 'tests-ShortIntegerArray') ----- testShortIntegerArrayWithImageSegment array := ShortIntegerArray new: 10. 1 to: 10 do: [ :i | array at: i put: self randomShortInt ]. self validateImageSegment ! Item was changed: ----- Method: BitmapStreamTests>>testShortIntegerArrayWithRefStream (in category 'tests-ShortIntegerArray') ----- testShortIntegerArrayWithRefStream array := ShortIntegerArray with: 0 with: 1 with: 2 with: 3. self validateRefStream ! Item was changed: ----- Method: BitmapStreamTests>>testShortIntegerArrayWithRefStreamOnDisk (in category 'tests-ShortIntegerArray') ----- testShortIntegerArrayWithRefStreamOnDisk array := ShortIntegerArray new: 10. 1 to: 10 do: [ :i | array at: i put: self randomShortInt ]. self validateRefStreamOnDisk ! Item was changed: ----- Method: BitmapStreamTests>>testShortIntegerArrayWithSmartRefStream (in category 'tests-ShortIntegerArray') ----- testShortIntegerArrayWithSmartRefStream array := ShortIntegerArray new: 10. 1 to: 10 do: [ :i | array at: i put: self randomShortInt ]. self validateSmartRefStream ! Item was changed: ----- Method: BitmapStreamTests>>testShortIntegerArrayWithSmartRefStreamOnDisk (in category 'tests-ShortIntegerArray') ----- testShortIntegerArrayWithSmartRefStreamOnDisk array := ShortIntegerArray new: 10. 1 to: 10 do: [ :i | array at: i put: self randomShortInt ]. self validateSmartRefStreamOnDisk ! Item was changed: ----- Method: BitmapStreamTests>>testShortPointArrayWithImageSegment (in category 'tests-ShortPointArray') ----- testShortPointArrayWithImageSegment array := ShortPointArray new: 10. 1 to: 10 do: [ :i | array at: i put: self randomShortPoint ]. self validateImageSegment ! Item was changed: ----- Method: BitmapStreamTests>>testShortPointArrayWithRefStream (in category 'tests-ShortPointArray') ----- testShortPointArrayWithRefStream array := ShortPointArray new: 10. 1 to: 10 do: [ :i | array at: i put: self randomShortPoint ]. self validateRefStream ! Item was changed: ----- Method: BitmapStreamTests>>testShortPointArrayWithRefStreamOnDisk (in category 'tests-ShortPointArray') ----- testShortPointArrayWithRefStreamOnDisk array := ShortPointArray new: 10. 1 to: 10 do: [ :i | array at: i put: self randomShortPoint ]. self validateRefStreamOnDisk ! Item was changed: ----- Method: BitmapStreamTests>>testShortPointArrayWithSmartRefStream (in category 'tests-ShortPointArray') ----- testShortPointArrayWithSmartRefStream array := ShortPointArray new: 10. 1 to: 10 do: [ :i | array at: i put: self randomShortPoint ]. self validateSmartRefStream ! Item was changed: ----- Method: BitmapStreamTests>>testShortPointArrayWithSmartRefStreamOnDisk (in category 'tests-ShortPointArray') ----- testShortPointArrayWithSmartRefStreamOnDisk array := ShortPointArray new: 10. 1 to: 10 do: [ :i | array at: i put: self randomShortPoint ]. self validateSmartRefStreamOnDisk ! Item was changed: ----- Method: BitmapStreamTests>>testShortRunArrayWithImageSegment (in category 'tests-ShortRunArray') ----- testShortRunArrayWithImageSegment array := self createSampleShortRunArray. self validateImageSegment ! Item was changed: ----- Method: BitmapStreamTests>>testShortRunArrayWithRefStream (in category 'tests-ShortRunArray') ----- testShortRunArrayWithRefStream array := self createSampleShortRunArray. self validateRefStream ! Item was changed: ----- Method: BitmapStreamTests>>testShortRunArrayWithRefStreamOnDisk (in category 'tests-ShortRunArray') ----- testShortRunArrayWithRefStreamOnDisk array := self createSampleShortRunArray. self validateRefStreamOnDisk ! Item was changed: ----- Method: BitmapStreamTests>>testShortRunArrayWithSmartRefStream (in category 'tests-ShortRunArray') ----- testShortRunArrayWithSmartRefStream array := self createSampleShortRunArray. self validateSmartRefStream ! Item was changed: ----- Method: BitmapStreamTests>>testShortRunArrayWithSmartRefStreamOnDisk (in category 'tests-ShortRunArray') ----- testShortRunArrayWithSmartRefStreamOnDisk array := self createSampleShortRunArray. self validateSmartRefStreamOnDisk ! Item was changed: ----- Method: BitmapStreamTests>>testWordArrayWithImageSegment (in category 'tests-WordArray') ----- testWordArrayWithImageSegment array := WordArray new: 10. 1 to: 10 do: [ :i | array at: i put: self randomWord ]. self validateImageSegment ! Item was changed: ----- Method: BitmapStreamTests>>testWordArrayWithRefStream (in category 'tests-WordArray') ----- testWordArrayWithRefStream array := WordArray new: 10. 1 to: 10 do: [ :i | array at: i put: self randomWord ]. self validateRefStream ! Item was changed: ----- Method: BitmapStreamTests>>testWordArrayWithRefStreamOnDisk (in category 'tests-WordArray') ----- testWordArrayWithRefStreamOnDisk array := WordArray new: 10. 1 to: 10 do: [ :i | array at: i put: self randomWord ]. self validateRefStreamOnDisk ! Item was changed: ----- Method: BitmapStreamTests>>testWordArrayWithSmartRefStream (in category 'tests-WordArray') ----- testWordArrayWithSmartRefStream array := WordArray new: 10. 1 to: 10 do: [ :i | array at: i put: self randomWord ]. self validateSmartRefStream ! Item was changed: ----- Method: BitmapStreamTests>>testWordArrayWithSmartRefStreamOnDisk (in category 'tests-WordArray') ----- testWordArrayWithSmartRefStreamOnDisk array := WordArray new: 10. 1 to: 10 do: [ :i | array at: i put: self randomWord ]. self validateSmartRefStreamOnDisk ! Item was changed: ----- Method: BitmapStreamTests>>validateRefStream (in category 'private') ----- validateRefStream "array is set up with an array." | other rwstream | rwstream := RWBinaryOrTextStream on: (ByteArray new: array basicSize * 6). stream := ReferenceStream on: rwstream. stream nextPut: array; close. rwstream position: 0. stream := ReferenceStream on: rwstream. other := stream next. stream close. self assert: array = other! Item was changed: ----- Method: BitmapStreamTests>>validateSmartRefStream (in category 'private') ----- validateSmartRefStream "array is set up with an array." | other | stream := RWBinaryOrTextStream on: (ByteArray new: array basicSize * 6). stream binary. stream fileOutClass: nil andObject: array. stream position: 0. stream binary. other := stream fileInObjectAndCode. self assert: array = other! Item was changed: ----- Method: ClassRenameFixTest>>removeEverythingInSetFromSystem: (in category 'Private') ----- removeEverythingInSetFromSystem: aChangeSet aChangeSet changedMessageList do: [:methodRef | methodRef actualClass removeSelector: methodRef methodSymbol]. aChangeSet changedClasses do: [:each | each isMeta ifFalse: [each removeFromSystemUnlogged]]! Item was changed: ----- Method: ClassRenameFixTest>>testRenameClassUsingClass (in category 'Tests') ----- testRenameClassUsingClass "self run: #testRenameClassUsingClass" self renameClassUsing: [:class :newName | class rename: newName].! Item was changed: ----- Method: FileDirectoryTest>>testDeleteDirectory (in category 'create/delete tests') ----- testDeleteDirectory "Test deletion of a directory" | aContainingDirectory preTestItems | aContainingDirectory := self myDirectory containingDirectory. preTestItems := aContainingDirectory fileAndDirectoryNames. self assert: self myAssuredDirectory exists. aContainingDirectory deleteDirectory: self myLocalDirectoryName. self shouldnt: [aContainingDirectory directoryNames includes: self myLocalDirectoryName ] description: 'Should successfully delete directory.'. self should: [preTestItems = aContainingDirectory fileAndDirectoryNames] description: 'Should only delete the indicated directory.'. ! Item was changed: ----- Method: FileDirectoryTest>>testNonExistentDirectory (in category 'existence tests') ----- testNonExistentDirectory | directory parentDirectory | directory :=FileDirectory default directoryNamed: 'nonExistentFolder'. self shouldnt: [directory exists] description: 'A FileDirectory instance should know if it points to a non-existent directory.'. parentDirectory :=FileDirectory default. self shouldnt: [parentDirectory directoryExists: 'nonExistentFolder'] description: 'A FileDirectory instance should know when a directory of the given name doesn''t exist'. ! Item was changed: ----- Method: HashAndEqualsTestCase>>setUp (in category 'as yet unclassified') ----- setUp "subclasses will add their prototypes into this collection" prototypes := OrderedCollection new ! Item was changed: ----- Method: HashTester>>resultFor: (in category 'as yet unclassified') ----- resultFor: runs "Test that the hash is the same over runs and answer the result" | hash | hash := self prototype hash. 1 to: runs do: [:i | hash = self prototype hash ifFalse: [^ false]]. ^ true ! Item was changed: ----- Method: MCAncestryTest>>assertNamesOf:are: (in category 'asserting') ----- assertNamesOf: versionInfoCollection are: nameArray | names | names := versionInfoCollection collect: [:ea | ea name]. self assert: names asArray = nameArray! Item was changed: ----- Method: MCClassDefinitionTest>>testCannotLoad (in category 'as yet unclassified') ----- testCannotLoad | d | d := self mockClass: 'MCMockClassC' super: 'NotAnObject'. self should: [d load] raise: Error. self deny: (Smalltalk hasClassNamed: 'MCMockClassC').! Item was changed: ----- Method: MCClassDefinitionTest>>testComparison (in category 'as yet unclassified') ----- testComparison | d1 d2 d3 d4 | d1 := self mockClass: 'A' super: 'X'. d2 := self mockClass: 'A' super: 'Y'. d3 := self mockClass: 'B' super: 'X'. d4 := self mockClass: 'B' super: 'X'. self assert: (d1 isRevisionOf: d2). self deny: (d1 isSameRevisionAs: d2). self assert: (d3 isRevisionOf: d4). self assert: (d3 isSameRevisionAs: d4). self deny: (d1 isRevisionOf: d3). self deny: (d4 isRevisionOf: d2).! Item was changed: ----- Method: MCClassDefinitionTest>>testCreation (in category 'as yet unclassified') ----- testCreation | d | d := self mockClassA asClassDefinition. self assert: d className = #MCMockClassA. self assert: d superclassName = #MCMock. self assert: d type = #normal. self assert: d category = self mockCategoryName. self assert: d instVarNames asArray = #('ivar'). self assert: d classVarNames asArray = #('CVar'). self assert: d classInstVarNames asArray = #(). self assert: d comment isString. self assert: d comment = self classAComment. self assert: d commentStamp = self mockClassA organization commentStamp! Item was changed: ----- Method: MCClassDefinitionTest>>testDefinitionString (in category 'as yet unclassified') ----- testDefinitionString | d | d := self mockClassA asClassDefinition. self assert: d definitionString = self mockClassA definition.! Item was changed: ----- Method: MCClassDefinitionTest>>testEquals (in category 'as yet unclassified') ----- testEquals | a b | a := self mockClass: 'ClassA' super: 'SuperA'. b := self mockClass: 'ClassA' super: 'SuperA'. self assert: a = b! Item was changed: ----- Method: MCClassDefinitionTest>>testEqualsSensitivity (in category 'as yet unclassified') ----- testEqualsSensitivity | message a b defA args defB | message := self creationMessage. a := #(ClassA SuperA CategoryA #(iVarA) #(CVarA) #(PoolA) #(ciVarA) typeA 'A comment' 'A'). b := #(ClassB SuperB CategoryB #(iVarB) #(CVarB) #(PoolB) #(ciVarB) typeB 'B comment' 'B'). defA := message valueWithArguments: a. 1 to: 8 do: [:index | args := a copy. args at: index put: (b at: index). defB := message valueWithArguments: args. self deny: defA = defB.]! Item was changed: ----- Method: MCClassDefinitionTest>>testLoadAndUnload (in category 'as yet unclassified') ----- testLoadAndUnload | d c | d := self mockClass: 'MCMockClassC' super: 'Object'. d load. self assert: (Smalltalk hasClassNamed: 'MCMockClassC'). c := (Smalltalk classNamed: 'MCMockClassC'). self assert: (c isKindOf: Class). self assert: c superclass = Object. self assert: c instVarNames isEmpty. self assert: c classVarNames isEmpty. self assert: c sharedPools isEmpty. self assert: c category = self mockCategoryName. self assert: c organization classComment = (self commentForClass: 'MCMockClassC'). self assert: c organization commentStamp = (self commentStampForClass: 'MCMockClassC'). d unload. self deny: (Smalltalk hasClassNamed: 'MCMockClassC').! Item was changed: ----- Method: MCDependencySorterTest>>assertItems:orderAs:withRequired:toLoad:extraProvisions: (in category 'asserting') ----- assertItems: anArray orderAs: depOrder withRequired: missingDeps toLoad: unloadableItems extraProvisions: provisions | order sorter items missing unloadable | items := anArray collect: [:ea | self itemWithSpec: ea]. sorter := MCDependencySorter items: items. sorter addExternalProvisions: provisions. order := (sorter orderedItems collect: [:ea | ea name]) asArray. self assert: order = depOrder. missing := sorter externalRequirements. self assert: missing asSet = missingDeps asSet. unloadable := (sorter itemsWithMissingRequirements collect: [:ea | ea name]) asArray. self assert: unloadable asSet = unloadableItems asSet! Item was changed: ----- Method: MCDictionaryRepositoryTest>>dictionary (in category 'as yet unclassified') ----- dictionary ^ dict ifNil: [dict := Dictionary new]! Item was changed: ----- Method: MCDictionaryRepositoryTest>>setUp (in category 'as yet unclassified') ----- setUp repository := MCDictionaryRepository new dictionary: self dictionary! Item was changed: ----- Method: MCDirectoryRepositoryTest>>addVersion: (in category 'as yet unclassified') ----- addVersion: aVersion | file | file := FileStream newFileNamed: (directory fullNameFor: aVersion fileName). aVersion fileOutOn: file. file close.! Item was changed: ----- Method: MCDirectoryRepositoryTest>>directory (in category 'as yet unclassified') ----- directory directory ifNil: [directory := FileDirectory default directoryNamed: 'mctest'. directory assureExistence]. ^ directory! Item was changed: ----- Method: MCFileInTest>>assertInitializersCalled (in category 'testing') ----- assertInitializersCalled | cvar | cvar := self mockClassA cVar. self assert: cvar = #initialized! Item was changed: ----- Method: MCFileInTest>>assertNoChange (in category 'asserting') ----- assertNoChange | actual | actual := MCSnapshotResource takeSnapshot. diff := actual patchRelativeToBase: expected. self assert: diff isEmpty! Item was changed: ----- Method: MCFileInTest>>setUp (in category 'running') ----- setUp expected := self mockSnapshot. stream := RWBinaryOrTextStream on: String new.! Item was changed: ----- Method: MCMczInstallerTest>>assertNoChange (in category 'as yet unclassified') ----- assertNoChange | actual | actual := MCSnapshotResource takeSnapshot. diff := actual patchRelativeToBase: expected snapshot. self assert: diff isEmpty! Item was changed: ----- Method: MCMczInstallerTest>>assertVersionInfoPresent (in category 'as yet unclassified') ----- assertVersionInfoPresent | dict info | dict := MczInstaller versionInfo at: self mockPackage name. info := expected info. self assertDict: dict matchesInfo: info.! Item was changed: ----- Method: MCMczInstallerTest>>setUp (in category 'as yet unclassified') ----- setUp expected := self mockVersion. self change: #one toReturn: 2.! Item was changed: ----- Method: MCMczInstallerTest>>testInstallFromStream (in category 'as yet unclassified') ----- testInstallFromStream | stream | stream := RWBinaryOrTextStream on: String new. MCMczWriter fileOut: expected on: stream. MczInstaller installStream: stream reset. self assertNoChange. self assertVersionInfoPresent. ! Item was changed: ----- Method: MCMergingTest>>assertMerge:with:base:gives:conflicts: (in category 'asserting') ----- assertMerge: local with: remote base: ancestor gives: result conflicts: conflictResult | merger | conflicts := #(). merger := MCThreeWayMerger base: (self snapshotWithElements: local) target: (self snapshotWithElements: remote) ancestor: (self snapshotWithElements: ancestor). merger conflicts do: [:ea | self handleConflict: ea]. self assert: merger mergedSnapshot definitions hasElements: result. self assert: conflicts asSet = conflictResult asSet.! Item was changed: ----- Method: MCMethodDefinitionTest>>override (in category 'mocks') ----- override ^ 1! Item was changed: ----- Method: MCMethodDefinitionTest>>testCannotLoad (in category 'testing') ----- testCannotLoad | definition | definition := self mockMethod: #kjahs87 class: 'NoSuchClass' source: 'kjahs87 ^self' meta: false. self should: [definition load] raise: Error. self assert: (navigation allImplementorsOf: #kjahs87) isEmpty! Item was changed: ----- Method: MCMethodDefinitionTest>>testComparison (in category 'testing') ----- testComparison |d1 d2 d3 d4 d5 | d1 := self mockMethod: #one class: 'A' source: '1' meta: false. d2 := self mockMethod: #one class: 'A' source: '2' meta: false. d3 := self mockMethod: #one class: 'A' source: '1' meta: true. d4 := self mockMethod: #two class: 'A' source: '1' meta: false. d5 := self mockMethod: #two class: 'A' source: '1' meta: false. self assert: (d1 isRevisionOf: d2). self deny: (d1 isSameRevisionAs: d2). self deny: (d1 isRevisionOf: d3). self deny: (d1 isRevisionOf: d4). self assert: (d4 isSameRevisionAs: d5).! Item was changed: ----- Method: MCMethodDefinitionTest>>testLoadAndUnload (in category 'testing') ----- testLoadAndUnload |definition| definition := self mockMethod: #one class: 'MCMockClassA' source: 'one ^2' meta: false. self assert: self mockInstanceA one = 1. definition load. self assert: self mockInstanceA one = 2. definition unload. self deny: (self mockInstanceA respondsTo: #one)! Item was changed: ----- Method: MCMethodDefinitionTest>>testPartiallyRevertOverrideMethod (in category 'testing') ----- testPartiallyRevertOverrideMethod | definition | self class compile: 'override ^ 2' classified: '*foobarbaz'. self class compile: 'override ^ 3' classified: self mockOverrideMethodCategory. self class compile: 'override ^ 4' classified: self mockOverrideMethodCategory. definition := (MethodReference class: self class selector: #override) asMethodDefinition. self assert: definition isOverrideMethod. self assert: self override = 4. definition unload. self assert: self override = 2. self assert: (MethodReference class: self class selector: #override) category = '*foobarbaz'. ! Item was changed: ----- Method: MCMockClassA class>>initialize (in category 'as yet unclassified') ----- initialize CVar := #initialized! Item was changed: ----- Method: MCMockClassA class>>touchCVar (in category 'as yet unclassified') ----- touchCVar CVar := #touched! Item was changed: ----- Method: MCMockDefinition>>token: (in category 'as yet unclassified') ----- token: aString token := aString! Item was changed: ----- Method: MCMockDependency>>initializeWithTree: (in category 'accessing') ----- initializeWithTree: expr expr isSymbol ifTrue: [name := expr. children := Array new. hasResolution := true.] ifFalse: [name := expr first. expr second isSymbol ifTrue: [hasResolution := false. children := Array new] ifFalse: [hasResolution := true. children := expr second]]! Item was changed: ----- Method: MCMockDependentItem>>name: (in category 'as yet unclassified') ----- name: aString name := aString! Item was changed: ----- Method: MCMockDependentItem>>provides: (in category 'as yet unclassified') ----- provides: anArray provides := anArray! Item was changed: ----- Method: MCMockDependentItem>>requires: (in category 'as yet unclassified') ----- requires: anArray requires := anArray! Item was changed: ----- Method: MCOrganizationTest>>testReordering (in category 'as yet unclassified') ----- testReordering |dec cats newCats | dec := MCOrganizationDefinition categories: #(A B C). cats := #(X Y B Z C A Q). newCats := dec reorderCategories: cats original: #(B C A). self assert: newCats asArray = #(X Y A B C Z Q).! Item was changed: ----- Method: MCOrganizationTest>>testReorderingWithNoCategoriesInVersion (in category 'as yet unclassified') ----- testReorderingWithNoCategoriesInVersion |dec cats newCats | dec := MCOrganizationDefinition categories: #(). cats := #(X Y B Z C A Q). newCats := dec reorderCategories: cats original: #(). self assert: newCats asArray = cats.! Item was changed: ----- Method: MCOrganizationTest>>testReorderingWithRemovals (in category 'as yet unclassified') ----- testReorderingWithRemovals |dec cats newCats | dec := MCOrganizationDefinition categories: #(A B C). cats := #(X Y B Z C A Q). newCats := dec reorderCategories: cats original: #(Y B C A Q). self assert: newCats asArray = #(X A B C Z).! Item was changed: ----- Method: MCPatchTest>>setUp (in category 'as yet unclassified') ----- setUp |rev1 rev2| rev1 := MCSnapshotResource takeSnapshot. self change: #one toReturn: 2. rev2 := MCSnapshotResource takeSnapshot. patch := rev2 patchRelativeToBase: rev1. self change: #one toReturn: 1.! Item was changed: ----- Method: MCRepositoryTest>>addVersionWithSnapshot:name: (in category 'actions') ----- addVersionWithSnapshot: aSnapshot name: aString | version | version := self versionWithSnapshot: aSnapshot name: aString. self addVersion: version. ^ version info! Item was changed: ----- Method: MCRepositoryTest>>saveSnapshot:named: (in category 'actions') ----- saveSnapshot: aSnapshot named: aString | version | version := self versionWithSnapshot: aSnapshot name: aString. repository storeVersion: version. ^ version info ! Item was changed: ----- Method: MCRepositoryTest>>testAddAndLoad (in category 'tests') ----- testAddAndLoad | node | node := self addVersionWithSnapshot: self snapshot1 name: 'rev1'. self assert: (self snapshotAt: node) = self snapshot1. ! Item was changed: ----- Method: MCRepositoryTest>>testLoadMissingNode (in category 'tests') ----- testLoadMissingNode | node | node := MCVersionInfo new. self assertMissing: node! Item was changed: ----- Method: MCRepositoryTest>>testStoreAndLoad (in category 'tests') ----- testStoreAndLoad | node node2 | node := self saveSnapshot1. node2 := self saveSnapshot2. self assert: (self snapshotAt: node) = self snapshot1. self assert: (self snapshotAt: node2) = self snapshot2.! Item was changed: ----- Method: MCRepositoryTest>>versionWithSnapshot:name: (in category 'building') ----- versionWithSnapshot: aSnapshot name: aString | info | info := self mockVersionInfo: aString. ^ MCVersion package: (MCPackage new name: aString) info: info snapshot: aSnapshot! Item was changed: ----- Method: MCSerializationTest>>assertClass:providesServices: (in category 'asserting') ----- assertClass: readerClass providesServices: labels | services suffix | suffix := readerClass extension. self assert: (FileList isReaderNamedRegistered: readerClass name). services := readerClass fileReaderServicesForFile: 'foo' suffix: suffix. self assert: ((services collect: [:service | service buttonLabel]) includesAllOf: labels)! Item was changed: ----- Method: MCSerializationTest>>assertDependenciesMatchWith: (in category 'asserting') ----- assertDependenciesMatchWith: writerClass | stream readerClass expected actual | readerClass := writerClass readerClass. expected := self mockVersionWithDependencies. stream := RWBinaryOrTextStream on: String new. writerClass fileOut: expected on: stream. actual := (readerClass on: stream reset) dependencies. self assert: actual = expected dependencies.! Item was changed: ----- Method: MCSerializationTest>>assertSnapshotsMatchWith: (in category 'asserting') ----- assertSnapshotsMatchWith: writerClass | readerClass expected stream actual | readerClass := writerClass readerClass. expected := self mockSnapshot. stream := RWBinaryOrTextStream on: String new. (writerClass on: stream) writeSnapshot: expected. actual := readerClass snapshotFromStream: stream reset. self assertSnapshot: actual matches: expected.! Item was changed: ----- Method: MCSerializationTest>>assertVersionInfosMatchWith: (in category 'asserting') ----- assertVersionInfosMatchWith: writerClass | stream readerClass expected actual | readerClass := writerClass readerClass. expected := self mockVersion. stream := RWBinaryOrTextStream on: String new. writerClass fileOut: expected on: stream. actual := readerClass versionInfoFromStream: stream reset. self assert: actual = expected info.! Item was changed: ----- Method: MCSerializationTest>>assertVersionsMatchWith: (in category 'asserting') ----- assertVersionsMatchWith: writerClass | stream readerClass expected actual | readerClass := writerClass readerClass. expected := self mockVersion. stream := RWBinaryOrTextStream on: String new. writerClass fileOut: expected on: stream. actual := readerClass versionFromStream: stream reset. self assertVersion: actual matches: expected.! Item was changed: ----- Method: MCSerializationTest>>mockDiffyVersion (in category 'mocks') ----- mockDiffyVersion | repos workingCopy base next | repos := MCDictionaryRepository new. workingCopy := MCWorkingCopy forPackage: self mockPackage. workingCopy repositoryGroup addRepository: repos. MCRepositoryGroup default removeRepository: repos. base := self mockVersion. repos storeVersion: base. self change: #a toReturn: 'a2'. next := self mockVersionWithAncestor: base. ^ next asDiffAgainst: base ! Item was changed: ----- Method: MCSnapshotBrowserTest>>clickOnListItem: (in category 'simulating') ----- clickOnListItem: aString | listMorph | listMorph := self findListContaining: aString. listMorph changeModelSelection: (listMorph getList indexOf: aString).! Item was changed: ----- Method: MCSnapshotBrowserTest>>morphsOfClass: (in category 'morphic') ----- morphsOfClass: aMorphClass | morphs | morphs := OrderedCollection new. morph allMorphsDo: [:m | (m isKindOf: aMorphClass) ifTrue: [morphs add: m]]. ^ morphs! Item was changed: ----- Method: MCSnapshotBrowserTest>>protocolsForClass: (in category 'private') ----- protocolsForClass: aClass | protocols | protocols := aClass organization categories. protocols size > 1 ifTrue: [protocols := protocols copyWith: '-- all --']. ^ protocols.! Item was changed: ----- Method: MCSnapshotResource>>setUp (in category 'as yet unclassified') ----- setUp snapshot := self class takeSnapshot.! Item was changed: ----- Method: MCSnapshotTest>>setUp (in category 'running') ----- setUp snapshot := self mockSnapshot.! Item was changed: ----- Method: MCSnapshotTest>>testCreation (in category 'tests') ----- testCreation |d| d := self mockSnapshot definitions. self assert: (d anySatisfy: [:ea | ea isClassDefinition and: [ea className = #MCMockClassA]]). self assert: (d anySatisfy: [:ea | ea isMethodDefinition and: [ea selector = #mockClassExtension]]). self assert: (d allSatisfy: [:ea | ea isClassDefinition not or: [ea category endsWith: 'Mocks']]). ! Item was changed: ----- Method: MCSnapshotTest>>testInstanceReuse (in category 'tests') ----- testInstanceReuse | x m n y | x := (MCPackage new name: self mockCategoryName) snapshot. Smalltalk garbageCollect. n := MCDefinition allSubInstances size. y := (MCPackage new name: self mockCategoryName) snapshot. Smalltalk garbageCollect. m := MCDefinition allSubInstances size. self assert: m = n! Item was changed: ----- Method: MCSortingTest>>testConsistentSorting (in category 'tests') ----- testConsistentSorting | definitions shuffledAndSorted| definitions := {self methodNamed: #a class: #A meta: false. self methodNamed: #a class: #A meta: true. self methodNamed: #a class: #B meta: false. self methodNamed: #b class: #A meta: false. self methodNamed: #b class: #B meta: false. self classNamed: #A. self classNamed: #B}. shuffledAndSorted := (1 to: 100) collect: [:ea | self sortDefinitions: definitions shuffled]. self assert: shuffledAndSorted asSet size = 1. ! Item was changed: ----- Method: MCSortingTest>>testSortOrder (in category 'tests') ----- testSortOrder | aA aAm aB bA bB A B cA bAm cAm | aA := self methodNamed: #a class: #A meta: false. bA := self methodNamed: #b class: #A meta: false. cA := self methodNamed: #c class: #A meta: false. aAm := self methodNamed: #a class: #A meta: true. bAm := self methodNamed: #b class: #A meta: true. cAm := self methodNamed: #c class: #A meta: true. aB := self methodNamed: #a class: #B meta: false. bB := self methodNamed: #b class: #B meta: false. A := self classNamed: #A. B := self classNamed: #B. self assert: (self sortDefinitions: {aA. aAm. cAm. aB. bAm. bA. bB. A. cA. B}) = {A. aAm. bAm. cAm. aA. bA. cA. B. aB. bB}! Item was changed: ----- Method: MCStReaderTest>>methodWithStyle (in category 'as yet unclassified') ----- methodWithStyle ^ '!!EventHandler methodsFor: ''copying'' stamp: ''tk 1/22/2001 17:39''!! veryDeepInner: deepCopier "ALL fields are weakly copied. Can''t duplicate an object by duplicating a button that activates it. See DeepCopier." super veryDeepInner: deepCopier. "just keep old pointers to all fields" clickRecipient := clickRecipient.!! ]style[(25 108 10 111)f1b,f1,f1LDeepCopier Comment;,f1!! !! '! Item was changed: ----- Method: MCStReaderTest>>testCommentWithStyle (in category 'as yet unclassified') ----- testCommentWithStyle | reader | reader := MCStReader on: self commentWithStyle readStream. reader definitions! Item was changed: ----- Method: MCStReaderTest>>testCommentWithoutStyle (in category 'as yet unclassified') ----- testCommentWithoutStyle | reader | reader := MCStReader on: self commentWithoutStyle readStream. self assert: (reader definitions anySatisfy: [:ea | ea isMethodDefinition]).! Item was changed: ----- Method: MCStReaderTest>>testMethodWithStyle (in category 'as yet unclassified') ----- testMethodWithStyle | reader | reader := MCStReader on: self methodWithStyle readStream. self assert: reader definitions first isMethodDefinition.! Item was changed: ----- Method: MCStWriterTest>>setUp (in category 'testing') ----- setUp stream := RWBinaryOrTextStream on: String new. writer := MCStWriter on: stream. ! Item was changed: ----- Method: MCStWriterTest>>testInitializerDefinition (in category 'testing') ----- testInitializerDefinition |chunk lastChunk| writer writeSnapshot: self mockSnapshot. stream reset. [stream atEnd] whileFalse: [chunk := stream nextChunk. chunk isAllSeparators ifFalse: [lastChunk := chunk]]. self assertContentsOf: lastChunk readStream match: self expectedInitializerA! Item was changed: ----- Method: MCStWriterTest>>testOrganizationDefinition (in category 'testing') ----- testOrganizationDefinition | definition | definition := MCOrganizationDefinition categories: (self mockPackage packageInfo systemCategories). writer visitOrganizationDefinition: definition. self assertContentsOf: stream match: self expectedOrganizationDefinition. self assertAllChunksAreWellFormed.! Item was changed: ----- Method: MCTestCase>>assertSnapshot:matches: (in category 'asserting') ----- assertSnapshot: actual matches: expected | diff | diff := actual patchRelativeToBase: expected. self assert: diff isEmpty ! Item was changed: ----- Method: MCTestCase>>treeFrom: (in category 'mocks') ----- treeFrom: anArray | name id | name := anArray first. id := '00000000-0000-0000-0000-0000000000', (name asString size = 1 ifTrue: [name asString, '0'] ifFalse: [name asString]). ^ MCVersionInfo name: name id: (UUID fromString: id) message: '' date: nil time: nil author: '' ancestors: (anArray size > 1 ifTrue: [(anArray second collect: [:ea | self treeFrom: ea])] ifFalse: [#()])! Item was changed: ----- Method: MCVersionTest>>setUp (in category 'running') ----- setUp visited := OrderedCollection new.! Item was changed: ----- Method: MCWorkingCopyTest>>testAncestorMerge (in category 'tests') ----- testAncestorMerge | base revA revB revC | base := self snapshot. self change: #a toReturn: 'a1'. revA := self snapshot. self change: #b toReturn: 'b1'. revB := self snapshot. self change: #c toReturn: 'c1'. revC := self snapshot. self should: [self basicMerge: revA] raise: MCNoChangesException. ! Item was changed: ----- Method: MCWorkingCopyTest>>testBackport (in category 'tests') ----- testBackport | inst base final backported | inst := self mockInstanceA. base := self snapshot. self assert: inst one = 1. self change: #one toReturn: 2. self change: #two toReturn: 3. final := self snapshot. [workingCopy backportChangesTo: base info] on: MCChangeSelectionRequest do: [:e | e resume: e patch]. self assert: inst one = 2. self assert: inst two = 3. self assert: workingCopy ancestry ancestors size = 1. self assert: workingCopy ancestry ancestors first = base info. self assert: workingCopy ancestry stepChildren size = 1. self assert: workingCopy ancestry stepChildren first = final info. backported := self snapshot. [workingCopy backportChangesTo: base info] on: MCChangeSelectionRequest do: [:e | e resume: e patch]. self assert: workingCopy ancestry ancestors size = 1. self assert: workingCopy ancestry ancestors first = base info. self assert: workingCopy ancestry stepChildren size = 1. self assert: workingCopy ancestry stepChildren first = backported info. ! Item was changed: ----- Method: MCWorkingCopyTest>>testMergeIntoImageWithNoChanges (in category 'tests') ----- testMergeIntoImageWithNoChanges | base revB revA1 | self change: #a toReturn: 'a'. base := self snapshot. self change: #b toReturn: 'b'. revB := self snapshot. self load: base. self change: #a toReturn: 'a1'. revA1 := self snapshot. self change: #a toReturn: 'a'. self snapshot. self merge: revB. self assert: (workingCopy ancestors size = 2) ! Item was changed: ----- Method: MCWorkingCopyTest>>testMergeIntoUnmodifiedImage (in category 'tests') ----- testMergeIntoUnmodifiedImage | base revA | base := self snapshot. self change: #a toReturn: 'a1'. revA := self snapshot. self load: base. self merge: revA. self assert: (workingCopy ancestors size = 1) ! Item was changed: ----- Method: MCWorkingCopyTest>>testSimpleMerge (in category 'tests') ----- testSimpleMerge | mother base inst | inst := self mockInstanceA. base := self snapshot. self change: #one toReturn: 2. mother := self snapshot. self load: base. self change: #two toReturn: 3. self snapshot. self assert: inst one = 1. self assert: inst two = 3. self merge: mother. self assert: inst one = 2. self assert: inst two = 3.! Item was changed: ----- Method: MCWorkingCopyTest>>testSnapshotAndLoad (in category 'tests') ----- testSnapshotAndLoad | base inst | inst := self mockInstanceA. base := self snapshot. self change: #one toReturn: 2. self assert: inst one = 2. self load: base. self assert: inst one = 1.! Item was changed: ----- Method: PCCByCompilation>>extractCallNamesFromPrimString: (in category 'private') ----- extractCallNamesFromPrimString: aString "method works for both enabled and disabled prim strings" "<primitive: 'doSomething' module:'ModuleFoo'" | tokens | tokens := aString findTokens: ''''. ^ (tokens at: 2) -> (tokens at: 4 ifAbsent: [nil])! Item was changed: ----- Method: PCCByCompilationTest>>cExternalCall1 (in category 'example module') ----- cExternalCall1 <primitive: 'prim1' module: 'CPCCT'> ! Item was changed: ----- Method: PCCByCompilationTest>>cExternalCall2 (in category 'example module') ----- cExternalCall2 <primitive:'prim2'module:'CPCCT'> self primitiveFailed! Item was changed: ----- Method: PCCByCompilationTest>>cFailedCall (in category 'test methods') ----- cFailedCall <primitive: 'primGetModuleName' module:'CFailModule'> ^ 'failed call'! Item was changed: ----- Method: PCCByCompilationTest>>cRealExternalCallOrPrimitiveFailed (in category 'test methods') ----- cRealExternalCallOrPrimitiveFailed <primitive: 'primGetModuleName' module:'LargeIntegers'> self primitiveFailed! Item was changed: ----- Method: PrimCallControllerAbstract>>initialize (in category 'initialize-release') ----- initialize treatedMethods := Dictionary new. " logStream := Transcript." changeStatusOfFailedCallsFlag := false! Item was changed: ----- Method: PrototypeTester>>prototype: (in category 'as yet unclassified') ----- prototype: aPrototype "Set my prototype" prototype := aPrototype copy ! |
Free forum by Nabble | Edit this page |