Pharo test defects

Package: Soil (ApptiveGrid/Soil, row 84)

State
Open: 3 tests
Defect in
see the record
Tests
17
Fix
apptivegrid-soil.st
Upstream repository
ApptiveGrid/Soil

The record is the text of the repair. The Results table is the last run of the row.

Record

Test

Load the package into a Pharo 14 image (build 791) with the load expression of the test run, file in the fixes file of the row if there is one, and run the test classes of the package.

"row 84"
Metacello new baseline: 'Soil'; repository: 'github://ApptiveGrid/Soil:main/src'; onConflict: [:e | e useIncoming]; load: #('default').

Results

Last result of the package run (stock Cog and iospharo on the same image).

RowLabelLoadStock Cogiospharo VM
84apptivegrid-soiloktests=1184 P=1167 F=0 E=0 S=17 T=0 X=0tests=1184 P=1167 F=0 E=0 S=17 T=0 X=0

Tests that do not pass

TestStock Cogiospharo VM
SoilCleanCodeTest>>testCodeCoverageSKIPSKIP
SoilIndexIteratorTest>>testMoveKey(#classToTest->SoilBTree_#uniqueKeys->false)SKIPSKIP
SoilIndexIteratorTest>>testMoveKey(#classToTest->SoilSkipList_#uniqueKeys->false)SKIPSKIP
SoilIndexIteratorTest>>testMoveKeyOnNonUniqueIndexIsRefused(#classToTest->SoilBTree_#uniqueKeys->true)SKIPSKIP
SoilIndexIteratorTest>>testMoveKeyOnNonUniqueIndexIsRefused(#classToTest->SoilSkipList_#uniqueKeys->true)SKIPSKIP
SoilIndexIteratorTest>>testMoveKeyOverwritesTheTarget(#classToTest->SoilBTree_#uniqueKeys->false)SKIPSKIP
SoilIndexIteratorTest>>testMoveKeyOverwritesTheTarget(#classToTest->SoilSkipList_#uniqueKeys->false)SKIPSKIP
SoilResidentCleanCodeTest>>testCodeCoverageSKIPSKIP
SoilSerializerCleanCodeTest>>testCodeCoverageSKIPSKIP
SoilWindowsFileLockTest>>testFlushFileBuffersDirectSKIPSKIP
SoilWindowsFileLockTest>>testFsyncEntireFileSKIPSKIP
SoilWindowsFileLockTest>>testLockAndUnlockEntireFileSKIPSKIP
SoilWindowsFileLockTest>>testLockAndUnlockRangeSKIPSKIP
SoilWindowsFileLockTest>>testLockExclusiveSKIPSKIP
SoilWindowsFileLockTest>>testLockOrErrorSuccessSKIPSKIP
SoilWindowsFileLockTest>>testLockSharedSKIPSKIP
SoilWindowsFileLockTest>>testMultipleLocksSKIPSKIP

Fix

Fixes file (filed in after the load): apptivegrid-soil.st (download)
"apptivegrid-soil: tests that did not pass, and the repair of each.  Causes, by group:

1. SoilIndexedDictionaryTest>>testAReplayDoesNotAddAValueTheIndexHoldsAgain (BTree
   case).  SoilBTreePage>>cleanRemovedIn: dropped a removed entry by its key.  With
   duplicate keys the binary search for the key can land on the live entry next to
   the removed one, so the cleaner removed the live entry and kept the removed
   one.  The repair drops the removed entries themselves (as
   SoilSkipListPage>>cleanRemoved already does).  The test lost its BTree skip.

2. SoilIndexedDictionaryTest>>testConcurrentIsEmpty (both backends).  The iterator
   of a transaction answered #size from the header page of the index.  The header
   counts the newest committed state, so a transaction that began before another
   commit saw the count of the other commit.  The repair adds
   SoilRestoringIndexIterator>>size: when the database moved past the read version
   of the iterator, the size is counted with the same visibility rule that #do:
   uses.  The test lost its skip (issue 1137 of the package).

3. SoilIndexedDictionaryTest>>testRemoveKeyWithTwoTransactions (both backends).
   The test is stale.  Its comment says that the commit conflict cannot be
   detected yet.  Soil detects the conflict now (SoilIndexHasConcurrentChange, a
   subclass of SoilObjectHasConcurrentChange, see
   testRemovingAKeyAnotherTransactionRemovedIsAConflict).  The test is brought to
   the present design: the commit conflict is checked as before, and the size is
   read in a new transaction after the conflict.

4. SoilTest>>testRootSendingClass.  Commit c8aee57a of the package took
   SoilObjectProxy>>class out (the message says: called too often, breaks the
   inspector), so ProtoObject>>class answers SoilObjectProxy for a proxy, and a #=
   that compares #class (OrderedCollection>>remove: sends real = proxy) does not
   find its element.  The author skipped the test in commit abb46f0c.  The repair
   puts SoilObjectProxy>>class back (an owner decision to review) and uses a small
   class of the test package (SoilTestEqualsUsingClass) in place of the
   deprecated AST alias RBComment.

5. Lint tests.  SoilCleanCodeTest>>testNoUnusedClasses (and the copy that
   SoilResidentCleanCodeTest inherits): SoilDatabaseMigration subclasses are found
   by SoilDatabaseMigration class>>migratesVersion: with #allSubclasses, so the
   lint test needs the isUsed override that the test comment names.
   SoilObjectVisitor has no sender, no subclass and no test: dead code, it is
   removed in the image.  SoilJournalConverter is a tool that a user starts by
   hand to convert a journal of the first format (one file for each transaction)
   into the journal of today.  Nothing in the code sends it, and no test ran it.
   The new SoilJournalConverterTest runs it on a journal in the old form.
   SoilSerializerCleanCodeTest>>testNoUnimplementedCalls and #testNoUnsentMessages
   lost the skip.  SoilMaterializer>>nextCompiledMethod11: is the reader for the
   format of Pharo 11 and older.  It sends CompiledMethod>>#trailer, which Pharo 12
   and newer do not have, and #nextCompiledMethod: sends it only before Pharo 12.
   The lint test has a pragma for such a case, <ignoreNotImplementedSelectors:>,
   and the method now carries it.

6. SoilCleanCodeTest>>testNoUnsentMessages (Soil-Core).  The test lists 65
   selectors of Soil-Core that no code sends.  Most are public API that no test
   called.  The new SoilApiSurfaceTest calls them and checks the answer of each.
   Three selectors were wrong, and the tests found it:
   - SoilSetup>>cacheSegmentAt:maximumBytes: and SoilSetup>>cacheObjectRecordsUsing:
     give a block to SoilObjectRepository>>cacheSegmentAt:using:, and the
     repository gave the block the segment.  The block sends #computeWeight: and
     #maximumWeight:, which are messages of the LRU cache of the segment, so each
     use failed with a doesNotUnderstand.  The repository now gives the block
     the cache of the segment, as its comment says.
   - SoilBehaviorRegistry>>recreateIndex committed its read-only transaction and
     aborted it again in an ensure block, and the second removal from the
     transaction manager failed.  The commit is gone; the abort stays.
   - SoilDatabaseConsistencyTracker>>checkDescriptionsOf:referencedBy:in: has no
     sender anywhere in the image.  The tracker loops over the versions and
     sends #checkDescriptionsOfVersion:referencedBy:in: itself.  The method only
     repeated that loop, so it is removed.
   The test lost its skip.

Also: SoilWindowsFileLockTest>>testErrorDescriptions and >>testWinOverlappedStructure
lose their isWindows skip (no call into kernel32).

Not repaired here: the three #testCodeCoverage tests (measured: Soil-Core 86
percent of 2279 methods, Soil-Serializer 81 percent of 313, Soil-Resident 85
percent of 183; the test wants 93), the six SoilIndexIteratorTest cases that
cannot apply (SoilIndexIterator>>moveKey:to:ifAbsent: refuses an index with
duplicate keys, and the opposite case has a test of its own), and the eight
SoilWindowsFileLockTest tests that call kernel32."

fix value: #SoilBTreePage value: #cleanRemovedIn:
	value: [ :source | source includesSubstring: 'self remove: removedItem key for: index' ]
	value:
'cleanRemovedIn: index
	"Drop the removed items themselves.  A removal by key takes any entry under
	the key when the keys are not unique, and that can be the live entry next to
	the removed one."
	items removeAllSuchThat: [ :each | each value isRemoved ].
	needWrite := true'.

add value: #SoilRestoringIndexIterator value: #size value: 'accessing' value:
'size
	"The header of the index counts the newest committed state.  A reader whose
	read version is older than the database version may see other entries, so it
	counts the entries that it sees, the way #do: does."
	| count item |
	(readVersion isNil or: [ journal isNil ]) ifTrue: [ ^ super size ].
	readVersion >= journal soil control databaseVersion ifTrue: [ ^ super size ].
	count := 0.
	currentPage := nil.
	[ (item := self basicNextAssociation) notNil ] whileTrue: [
		(self restoreItem: item) ifNotNil: [ count := count + 1 ] ].
	^ count'.

fix value: #SoilIndexedDictionaryTest value: #testAReplayDoesNotAddAValueTheIndexHoldsAgain
	value: [ :source | source includesSubstring: 'backend = SoilBTree ifTrue: [ ^ self skip ]' ]
	value:
'testAReplayDoesNotAddAValueTheIndexHoldsAgain
	"a replay applies journals whose changes are already on disk, so an add finds its
	pair on a page read back from disk - as a byte array, while the journal hands it a
	SoilObjectId. Compared as they were, every replayed add appended a second entry
	for its pair, and the index answered a value twice and a size too large.

	On a BTree the cleaning of removed entries (SoilBTreePage>>#cleanRemovedIn:) used
	to drop an entry by its key, and with duplicate keys that can be the live entry
	next to the removed one."
	| tx checkpoint values |
	tx := soil newTransaction.
	dict index allowDuplicateKeys.
	tx root: dict.
	tx commit.
	checkpoint := soil control lastCheckpoint.

	tx := soil newTransaction.
	tx root
		at: #testkey put: ''one'';
		at: #testkey put: ''two''.
	tx commit.
	tx := soil newTransaction.
	values := tx root at: #testkey.
	tx root removeKey: #testkey value: values first.
	tx commit.
	"back to a checkpoint before both commits - what a crash after them would have left"
	soil control checkpoint: checkpoint.
	self reopen.

	tx := soil newTransaction.
	values := tx root at: #testkey.
	self assert: values size equals: 1.
	self assert: values first equals: ''two''.
	self assert: tx root size equals: 1.
	tx abort'.

fix value: #SoilIndexedDictionaryTest value: #testConcurrentIsEmpty
	value: [ :source | source includesSubstring: 'self skip' ]
	value:
'testConcurrentIsEmpty
	| tx1 tx2 tx3 |
	tx1 := soil newTransaction.
	tx1 root: dict.
	dict
		at: #one put: #onevalue.
	tx1 commit.
	tx2 := soil newTransaction.
	"After creating tx2 we open a concurrent transaction and remove the key of
	the dictionary, which should still be visible to tx2"
	tx3 := soil newTransaction.
	tx3 root removeKey: #one.
	tx3 commit.
	"invisible: tx2 still has the key"
	self deny: tx2 root isEmpty.
	self assert: tx2 root size equals: 1'.

fix value: #SoilIndexedDictionaryTest value: #testRemoveKeyWithTwoTransactions
	value: [ :source | source includesSubstring: 'self skip' ]
	value:
'testRemoveKeyWithTwoTransactions
	"the second transaction sees the key at its read version and can remove it in
	its own view.  Its commit is a concurrent change: the first transaction removed
	the key and committed.  The conflict is an SoilIndexHasConcurrentChange, a
	SoilObjectHasConcurrentChange."
	| tx tx2 |
	tx := soil newTransaction.
	tx root: dict.
	dict at: #one put: #onevalue.
	dict at: #two put: #twovalue.
	tx commit.
	"we create two transactions"
	tx := soil newTransaction.
	tx2 := soil newTransaction.
	"remove the key"
	tx2 root removeKey: #two.
	tx2 commit.
	"check that we can still see in the first tr"
	self assert: (tx root at: #two) equals: #twovalue.
	"but removeKey: does not see it, we can remove it without error"
	tx root removeKey: #two ifAbsent: [ self fail ].
	"in its own view the first transaction holds one key now"
	self assert: tx root size equals: 1.
	"but commiting it will fail, as we have commited the remove in t2"
	self should: [ tx commit ] raise: SoilObjectHasConcurrentChange.
	"the first removal stands and the other key is untouched"
	tx := soil newTransaction.
	self assert: (tx root at: #one) equals: #onevalue.
	self assert: (tx root at: #two ifAbsent: [ nil ]) isNil.
	self assert: tx root size equals: 1.
	tx abort'.

(Smalltalk globals includesKey: #SoilTestEqualsUsingClass) ifFalse: [
	(Object << #SoilTestEqualsUsingClass
		slots: { #text };
		package: 'Soil-Core-Tests';
		yourself) install ].

add value: #SoilTestEqualsUsingClass value: #text value: 'accessing' value:
'text
	^ text'.

add value: #SoilTestEqualsUsingClass value: #text: value: 'accessing' value:
'text: aString
	text := aString'.

add value: #SoilTestEqualsUsingClass value: #= value: 'comparing' value:
'= anObject
	"compares the class by sending #class to the other object, as the AST nodes of
	the image do"
	self == anObject ifTrue: [ ^ true ].
	^ self class = anObject class and: [ text = anObject text ]'.

add value: #SoilTestEqualsUsingClass value: #hash value: 'comparing' value:
'hash
	^ text hash'.

add value: #SoilObjectProxy value: #class value: 'class membership' value:
'class
	"ProtoObject>>#class would answer SoilObjectProxy.  The proxy stands for its real
	object, so it answers the class of the real object (as the package did until
	commit c8aee57a, which took this method out)."
	^ self soilRealObject class'.

fix value: #SoilTest value: #testRootSendingClass
	value: [ :source | source includesSubstring: 'self skip' ]
	value:
'testRootSendingClass
	"We have a root in a Dictionary and that object overrides #= that checks using #class.
	This tests that the proxy forwards #class correctly"

	| tx collection objectUsingClassinQueals |
	tx := soil newTransaction.
	collection := OrderedCollection new.
	tx root: collection.
	objectUsingClassinQueals := SoilTestEqualsUsingClass new
		text: ''Some sample text'';
		yourself.
	tx makeRoot: objectUsingClassinQueals.
	collection add: objectUsingClassinQueals.
	tx markDirty: objectUsingClassinQueals.
	tx markDirty: collection.
	tx commit.

	"now lets try to remove the object in a new transaction, note that the #remove uses #= which sends #class"
	tx := soil newTransaction.
	tx root remove: objectUsingClassinQueals.
	tx commit.
	tx := soil newTransaction.
	self assert: tx root isEmpty.
	tx abort'.

add value: #'SoilDatabaseMigration class' value: #isUsed value: 'testing' value:
'isUsed
	"the subclasses are found by #migratesVersion: with #allSubclasses, and no
	method names one of them"
	^ true'.

(Smalltalk globals at: #SoilObjectVisitor ifAbsent: [ nil ]) ifNotNil: [ :visitorClass |
	(visitorClass isUsed not)
		ifTrue: [
			visitorClass removeFromSystem.
			Stdio stdout nextPutAll: 'FIXED SoilObjectVisitor removed (no sender, no subclass, no test)'; lf; flush ]
		ifFalse: [
			Stdio stdout nextPutAll: 'SKIP SoilObjectVisitor (has a subclass or a reference)'; lf; flush ] ].

fix value: #SoilCleanCodeTest value: #testNoUnusedClasses
	value: [ :source | source includesSubstring: 'self skip' ]
	value:
'testNoUnusedClasses
	"Fail if there are Classes that are not used. They should either be tested or deleted.
	(check how to override #isUsed for cases where classes are discovered reflectively)"
	| found  knownviolations |
	found := self packageToCheck definedClasses reject: [ :class | class isUsed].

	knownviolations := #(SoilSkipListDictionary SoilBTreeDictionary).
	found := found reject: [:class | knownviolations includes: class name  ].

	self
		assert: found isEmpty
		description: (''the following classes are unused: '', found asString)'.

fix value: #SoilSerializerCleanCodeTest value: #testNoUnimplementedCalls
	value: [ :source | source includesSubstring: 'self skip' ]
	value:
'testNoUnimplementedCalls

	| remaining |
	"To tag selectors send that are not implemented that should not trigger this rule, use the pragma
	<ignoreNotImplementedSelectors: #(selector:to:be:ignored)>"

	remaining := self packageToCheck methods select: [ :meth |
		             | ignored |
		             ignored := meth allIgnoredNotImplementedSelectors.
						 meth messages anySatisfy: [ :m |
			             m isSelectorSymbol not and: [
				             (ignored includes: m) not ] ] ].

	self assert: remaining isEmpty description: (''the following methods send selectors that do not exist'', remaining asString)'.

fix value: #SoilSerializerCleanCodeTest value: #testNoUnsentMessages
	value: [ :source | source includesSubstring: 'self skip' ]
	value:
'testNoUnsentMessages
	"Fail if there are methods implemented whose selectors is not sent anywhere in Pharo.
	Please add a test or remove the method!"

	| found methods validExceptions |
	found := self packageToCheck allUnsentMessages.
	methods := self packageToCheck methods select: [ :method | found includes: method selector ].
	methods := methods reject: [:method | method hasPragmaNamed: #inspectorPresentationOrder:title:
  ].
  validExceptions := { }.
	"No other exceptions beside the ones mentioned here should be allowed"
	 SystemVersion current major = 11 ifTrue: [
		validExceptions := {
		SoilMaterializer>>#nextCompiledBlock12: .
		SoilMaterializer>>#nextCompiledMethod12: }
	].

	methods := methods asOrderedCollection
								removeAll: validExceptions;
								yourself.


	self
		assert: methods isEmpty
		description: (''the following selectors are implemented, but never send'', methods asString)'.

fix value: #SoilWindowsFileLockTest value: #testErrorDescriptions
	value: [ :source | source includesSubstring: 'OSPlatform current isWindows ifFalse: [ ^ self skip ]' ]
	value:
'testErrorDescriptions
	"Test error description helper method.  The method only answers texts for numbers,
	so it runs on every platform."

	"Test known error codes"
	self assert: (SoilWindowsFileLock errorDescription: 5) equals: ''Access denied''.
	self assert: (SoilWindowsFileLock errorDescription: 6) equals: ''Invalid file handle''.
	self assert: (SoilWindowsFileLock errorDescription: 33) equals: ''Lock violation (region already locked)''.
	self assert: (SoilWindowsFileLock errorDescription: 158) equals: ''Region not locked''.

	"Test unknown error code"
	self assert: ((SoilWindowsFileLock errorDescription: 9999) includesSubstring: ''Unknown error'')'.

fix value: #SoilWindowsFileLockTest value: #testWinOverlappedStructure
	value: [ :source | source includesSubstring: 'OSPlatform current isWindows ifFalse: [ ^ self skip ]' ]
	value:
'testWinOverlappedStructure
	"Test WinOverlapped structure initialization and field access.  The structure is
	plain memory, no call into kernel32, so it runs on every platform."

	| overlapped |
	overlapped := SoilWinOverlappedStruct new.

	"Test field setters and getters"
	overlapped offset: 16r12345678.
	self assert: overlapped offset equals: 16r12345678.

	overlapped offsetHigh: 16rABCDEF00.
	self assert: overlapped offsetHigh equals: 16rABCDEF00.

	overlapped internal: 0.
	self assert: overlapped internal equals: 0.

	overlapped internalHigh: 0.
	self assert: overlapped internalHigh equals: 0.

	overlapped hEvent: ExternalAddress null.
	self assert: overlapped hEvent getHandle equals: ExternalAddress null'.

(Smalltalk globals includesKey: #SoilApiSurfaceTest) ifFalse: [
	(TestCase << #SoilApiSurfaceTest
		slots: { #soil };
		package: 'Soil-Core-Tests';
		yourself) install ].

add value: #SoilApiSurfaceTest value: #setUp value: 'tests' value:
'setUp
	super setUp.
	soil := Soil path: ''soil-api-surface-tests''.
	soil
		destroy;
		initializeFilesystem'.

add value: #SoilApiSurfaceTest value: #tearDown value: 'tests' value:
'tearDown
	soil ifNotNil: [
		soil isOpen ifTrue: [ soil close ].
		soil destroy ].
	super tearDown'.

add value: #SoilApiSurfaceTest value: #newIndex: value: 'tests' value:
'newIndex: anIndexClass
	"a stand-alone index in a file of its own, five keys in it"
	| index |
	index := anIndexClass new
		path: ''sunit-api-surface-index'';
		destroy;
		initializeFilesystem;
		initializeHeaderPage;
		keySize: 8;
		valueSize: 8;
		uniqueKeys: true;
		yourself.
	anIndexClass == SoilSkipList ifTrue: [ index maxLevel: 4 ].
	1 to: 5 do: [ :n | index at: n add: (n asByteArrayOfSize: 8) ].
	^ index'.

add value: #SoilApiSurfaceTest value: #commitRoot value: 'tests' value:
'commitRoot
	"a committed root, changed once by a second commit; answers the object id of the root"
	| tx |
	tx := soil newTransaction.
	tx root: (SoilPersistentDictionary new
		at: #a put: 1;
		yourself).
	tx commit.
	tx := soil newTransaction.
	tx root at: #a put: 2.
	tx commit.
	tx := soil newTransaction.
	^ [ tx objectIdOf: tx root ] ensure: [ tx abort ]'.

add value: #SoilApiSurfaceTest value: #testObjectIdPredicates value: 'tests' value:
'testObjectIdPredicates
	self deny: Object new isObjectId.
	self assert: (SoilObjectId segment: 1 index: 1) isObjectId'.

add value: #SoilApiSurfaceTest value: #testIndexKindPredicates value: 'tests' value:
'testIndexKindPredicates
	self assert: SoilBTree new isBTree.
	self deny: SoilSkipList new isBTree.
	self should: [ SoilIndex new isBTree ] raise: Error'.

add value: #SoilApiSurfaceTest value: #testSoilEmit value: 'tests' value:
'testSoilEmit
	self shouldnt: [ 3 soilEmit ] raise: Error'.

add value: #SoilApiSurfaceTest value: #testPageNavigation value: 'tests' value:
'testPageNavigation
	{ SoilSkipList. SoilBTree } do: [ :each | | index page keys |
		index := self newIndex: each.
		page := index firstPage.
		keys := page items collect: #key.
		self assert: (page itemAfter: keys first) key equals: (keys at: 2).
		self assert: (page itemAfter: keys last) isNil.
		self assert: (page itemBefore: (keys at: 3)) key equals: (keys at: 2).
		index close ]'.

add value: #SoilApiSurfaceTest value: #testSkipListPageKeyQueries value: 'tests' value:
'testSkipListPageKeyQueries
	| index page keys |
	index := self newIndex: SoilSkipList.
	page := index firstPage.
	keys := page items collect: #key.
	self assert: (page firstItemIndexForKey: keys first) equals: 1.
	self assert: (page firstItemIndexForKey: keys last) equals: keys size.
	self assert: (page firstItemIndexForKey: 16r7FFFFFFF) equals: 0.
	self assert: page sizeInBytes equals: page headerSize + (keys size * (page keySize + page valueSize)).
	index close'.

add value: #SoilApiSurfaceTest value: #testBTreePageFindItemBefore value: 'tests' value:
'testBTreePageFindItemBefore
	| index page keys |
	index := self newIndex: SoilBTree.
	page := index firstPage.
	keys := page items collect: #key.
	self assert: (page findItemBefore: keys last) key equals: (keys at: keys size - 1).
	index close'.

add value: #SoilApiSurfaceTest value: #testIteratorResetCurrentKey value: 'tests' value:
'testIteratorResetCurrentKey
	{ SoilSkipList. SoilBTree } do: [ :each | | index iterator first |
		index := self newIndex: each.
		iterator := index newIterator.
		first := iterator next.
		iterator next.
		iterator resetCurrentKey.
		self assert: iterator next equals: first.
		index close ]'.

add value: #SoilApiSurfaceTest value: #testIteratorRemoveItemsSuchThat value: 'tests' value:
'testIteratorRemoveItemsSuchThat
	{ SoilSkipList. SoilBTree } do: [ :each | | index |
		index := self newIndex: each.
		self assert: (index firstPage hasKey: 3).
		index newIterator removeItemsSuchThat: [ :item | item key = 3 ].
		self deny: (index firstPage hasKey: 3).
		self assert: (index firstPage hasKey: 4).
		index close ]'.

add value: #SoilApiSurfaceTest value: #testIndexMarkAllDirty value: 'tests' value:
'testIndexMarkAllDirty
	{ SoilSkipList. SoilBTree } do: [ :each | | index |
		index := self newIndex: each.
		index flush.
		index markAllDirty.
		self assert: index dirtyPages notEmpty.
		index close ]'.

add value: #SoilApiSurfaceTest value: #testIndexBasicRemoveKey value: 'tests' value:
'testIndexBasicRemoveKey
	{ SoilSkipList. SoilBTree } do: [ :each | | index |
		index := self newIndex: each.
		index basicRemoveKey: 3.
		self deny: (index firstPage hasKey: 3).
		self should: [ index basicRemoveKey: 3 ] raise: KeyNotFound.
		index close ]'.

add value: #SoilApiSurfaceTest value: #testStoreKinds value: 'tests' value:
'testStoreKinds
	| index store copy |
	index := self newIndex: SoilBTree.
	store := index store.
	self deny: store isCopyOnWrite.
	self assert: store orderedPages size equals: 1.
	self assert: store orderedPages first == (store pageAt: 1).
	copy := SoilCopyOnWriteIndexStore new.
	copy wrappedStore: store.
	self assert: copy isCopyOnWrite.
	self assert: copy wrappedStore == store.
	index close'.

add value: #SoilApiSurfaceTest value: #testRewriterForce value: 'tests' value:
'testRewriterForce
	"a reindexing file that an aborted rewrite left behind stops the next rewrite,
	unless the rewrite is forced"
	| index staleFile |
	index := self newIndex: SoilBTree.
	staleFile := index path , #reindex.
	staleFile ensureCreateFile.
	self should: [ index newPluggableRewriter rewrite ] raise: Error.
	index newPluggableRewriter
		force: true;
		rewrite.
	self deny: staleFile exists.
	self assert: (index firstPage hasKey: 3).
	index close'.

add value: #SoilApiSurfaceTest value: #testFabricAccessors value: 'tests' value:
'testFabricAccessors
	| fabric |
	fabric := SoilFabric new.
	fabric serializerClass: Object.
	fabric materializerClass: Array.
	fabric transactionClass: String.
	self assert: fabric serializerClass equals: Object.
	self assert: fabric materializerClass equals: Array.
	self assert: fabric transactionClass equals: String.
	soil fabric: fabric.
	self assert: soil fabric == fabric'.

add value: #SoilApiSurfaceTest value: #testSetupCaches value: 'tests' value:
'testSetupCaches
	| metrics |
	soil notificationHandler: SoilMetrics new.
	metrics := soil notificationHandler.
	soil setup cacheObjectRecordsUsing: [ :cache |
		cache
			computeWeight: #soilSizeInMemory;
			maximumWeight: 100000 ].
	self assert: metrics metaRecordCacheTotalWeight equals: 0.
	soil setup cacheSegmentAt: 1 maximumBytes: 100000.
	self assert: metrics metaRecordCacheTotalWeight isInteger'.

add value: #SoilApiSurfaceTest value: #testSetupFsyncEnabled value: 'tests' value:
'testSetupFsyncEnabled
	soil setup fsyncEnabled: false.
	self deny: soil setup isFsyncEnabled.
	soil setup fsyncEnabled: true.
	self assert: soil setup isFsyncEnabled'.

add value: #SoilApiSurfaceTest value: #testMetadataUpdateLastBackup value: 'tests' value:
'testMetadataUpdateLastBackup
	self assert: soil metadata lastBackup equals: DateAndTime epoch.
	soil metadata updateLastBackup.
	self assert: soil metadata lastBackup > DateAndTime epoch'.

add value: #SoilApiSurfaceTest value: #testOpenLogged value: 'tests' value:
'testOpenLogged
	soil close.
	soil openLogged.
	self assert: soil isOpen.
	self assert: soil metadata lastOpened > DateAndTime epoch'.

add value: #SoilApiSurfaceTest value: #testEnsureOnPath value: 'tests' value:
'testEnsureOnPath
	"an existing database is opened, a missing one is created"
	| path other |
	path := ''soil-api-surface-ensure''.
	(Soil path: path) destroy.
	other := Soil ensureOnPath: path.
	[ self assert: other isInitialized ] ensure: [
		other isOpen ifTrue: [ other close ].
		other destroy ].'.

add value: #SoilApiSurfaceTest value: #testMigrateDatabaseFormatRefusesACurrentDatabase value: 'tests' value:
'testMigrateDatabaseFormatRefusesACurrentDatabase
	"a database in the current format needs no migration"
	soil close.
	self
		should: [ soil migrateDatabaseFormat ]
		raise: Error
		whoseDescriptionIncludes: ''does not need migration''
		description: ''migrating a current database must be refused'''.

add value: #SoilApiSurfaceTest value: #testIndexManagerKnowsItsIndexes value: 'tests' value:
'testIndexManagerKnowsItsIndexes
	| manager |
	manager := (soil objectRepository segmentAt: 1) indexManager.
	self deny: (manager hasIndexId: ''no-such-index'').
	manager createIndexWithId: ''api-surface-index'' class: SoilSkipList.
	self assert: (manager hasIndexId: ''api-surface-index'')'.

add value: #SoilApiSurfaceTest value: #testAbortAll value: 'tests' value:
'testAbortAll
	| one two |
	one := soil newTransaction.
	two := soil newTransaction.
	soil transactionManager abortAll.
	self assert: soil transactionManager smallestReadVersion isNil'.

add value: #SoilApiSurfaceTest value: #testTransactionManualWriteTracking value: 'tests' value:
'testTransactionManualWriteTracking
	| tx |
	tx := soil newTransaction.
	self deny: tx commitStrategy hasRecords.
	tx beManualWriteTracking.
	tx root: (SoilPersistentDictionary new
		at: #a put: 1;
		yourself).
	self assert: tx commitStrategy hasRecords.
	tx markDirty: tx root.
	tx commit.
	tx := soil newTransaction.
	self assert: (tx root at: #a) equals: 1.
	tx abort'.

add value: #SoilApiSurfaceTest value: #testTransactionSetWriteVersion value: 'tests' value:
'testTransactionSetWriteVersion
	| tx |
	tx := soil newTransaction.
	self should: [ tx setWriteVersion: tx readVersion ] raise: SoilInvalidWriteVersion.
	tx setWriteVersion: tx readVersion + 1.
	self assert: tx writeVersion equals: tx readVersion + 1.
	tx abort'.

add value: #SoilApiSurfaceTest value: #testTransactionRegisterRecord value: 'tests' value:
'testTransactionRegisterRecord
	| tx record |
	tx := soil newTransaction.
	self should: [ tx registerRecord: SoilClusterRecord new ] raise: Error.
	record := SoilClusterRecord new
		objectId: (SoilObjectId segment: 1 index: 77);
		object: ''registered'';
		yourself.
	tx registerRecord: record.
	self assert: (tx objectIdOf: ''registered'') equals: record objectId.
	tx abort'.

add value: #SoilApiSurfaceTest value: #testJournalQueriesByObjectId value: 'tests' value:
'testJournalQueriesByObjectId
	| objectId |
	objectId := self commitRoot.
	self assert: (soil journal entriesWithObjectId: objectId) notEmpty.
	self assert: (soil journal historyOfObjectId: objectId) notEmpty.
	self assert: (soil journal lastObjectVersionEntriesWithObjectId: objectId) notEmpty'.

add value: #SoilApiSurfaceTest value: #testJournalNewTransactionJournal value: 'tests' value:
'testJournalNewTransactionJournal
	| journal |
	self commitRoot.
	journal := soil journal newTransactionJournalForId: soil control databaseVersion + 1.
	self assert: journal index equals: soil control databaseVersion + 1'.

add value: #SoilApiSurfaceTest value: #testJournalMaxFragmentFiles value: 'tests' value:
'testJournalMaxFragmentFiles
	soil setup maxFragmentFiles: 3.
	self assert: soil journal maxFragmentFiles equals: 3'.

add value: #SoilApiSurfaceTest value: #testFragmentFileEntriesCollect value: 'tests' value:
'testFragmentFileEntriesCollect
	| classes |
	self commitRoot.
	classes := soil journal fragmentFiles flatCollect: [ :each | each entriesCollect: #class ].
	self assert: classes notEmpty.
	self assert: (classes includes: SoilNewObjectEntry).
	self assert: (classes includes: SoilNewObjectVersionEntry)'.

add value: #SoilApiSurfaceTest value: #testJournalEntryAccessors value: 'tests' value:
'testJournalEntryAccessors
	| entries checkpoints versions |
	self commitRoot.
	entries := soil journal fragmentFiles flatCollect: [ :each | each entriesCollect: #yourself ].
	checkpoints := entries select: [ :each | each class == SoilCheckpointEntry ].
	self assert: checkpoints notEmpty.
	self assert: (checkpoints first checkpointedAt isKindOf: DateAndTime).
	self assert: checkpoints first previousCheckpoint notNil.
	versions := entries select: [ :each | each class == SoilNewObjectVersionEntry ].
	self assert: versions notEmpty.
	self deny: versions first oldBytes isString'.

add value: #SoilApiSurfaceTest value: #testJournalEntryClassMap value: 'tests' value:
'testJournalEntryClassMap
	self assert: (SoilJournalEntry allMapped at: SoilCheckpointEntry journalTypeCode) equals: SoilCheckpointEntry'.

add value: #SoilApiSurfaceTest value: #testRecordFindReferences value: 'tests' value:
'testRecordFindReferences
	| tx record |
	self commitRoot.
	tx := soil newTransaction.
	tx root at: #a.
	record := tx objectMap at: tx root theNonSoilProxy.
	self assert: record findReferencesTo isCollection.
	tx abort'.

add value: #SoilApiSurfaceTest value: #testExporterExportOn value: 'tests' value:
'testExporterExportOn
	"exporting to a stream by #exportOn: writes what #stream: and #export write"
	| tx expected actual |
	self commitRoot.
	tx := soil newTransaction.
	expected := ByteArray streamContents: [ :stream |
		(SoilGraphExporter new
			transaction: tx;
			addObject: tx root;
			yourself)
				stream: stream;
				export ].
	actual := ByteArray streamContents: [ :stream |
		(SoilGraphExporter new
			transaction: tx;
			addObject: tx root;
			yourself)
				exportOn: stream ].
	tx abort.
	self assert: actual equals: expected'.

add value: #SoilApiSurfaceTest value: #testExporterExportObjectId value: 'tests' value:
'testExporterExportObjectId
	| tx bytes |
	self commitRoot.
	tx := soil newTransaction.
	bytes := ByteArray streamContents: [ :stream |
		(SoilGraphExporter new
			transaction: tx;
			stream: stream;
			yourself)
				export: (tx objectIdOf: tx root) ].
	tx abort.
	self assert: bytes notEmpty'.

add value: #SoilApiSurfaceTest value: #testExporterMigrateAll value: 'tests' value:
'testExporterMigrateAll
	| tx exporter |
	tx := soil newTransaction.
	tx root: SoilTestClass1 new.
	tx commit.
	tx := soil newTransaction.
	exporter := SoilGraphExporter new
		transaction: tx;
		yourself.
	exporter migrateAll: { SoilTestClass1 } to: [ :object | object ].
	self assert: (exporter instVarNamed: #classMigrations) keys equals: { SoilTestClass1 }.
	tx abort'.

add value: #SoilApiSurfaceTest value: #testFindRecordsVisitorLimit value: 'tests' value:
'testFindRecordsVisitorLimit
	| tx visitor |
	self commitRoot.
	tx := soil newTransaction.
	visitor := SoilFindRecordsVisitor new
		numberOfRecords: 1;
		yourself.
	visitor find: [ :version | true ] in: tx.
	self assert: visitor records size equals: 1.
	tx abort'.

add value: #SoilApiSurfaceTest value: #testTrackingVisitorTrackers value: 'tests' value:
'testTrackingVisitorTrackers
	| visitor tracker |
	tracker := SoilTestCountingTracker new.
	visitor := SoilTrackingVisitor new.
	visitor addTracker: tracker.
	self assert: visitor trackers asArray equals: { tracker }'.

add value: #SoilApiSurfaceTest value: #testDetachedObjectFuelReplacement value: 'tests' value:
'testDetachedObjectFuelReplacement
	| tx detached real |
	self commitRoot.
	tx := soil newTransaction.
	real := tx root theNonSoilProxy.
	detached := SoilFullyDetachedObject on: tx root in: tx.
	self assert: detached fuelReplacement == real.
	tx abort'.

add value: #SoilApiSurfaceTest value: #testProxyFuelReplacement value: 'tests' value:
'testProxyFuelReplacement
	"a proxy that is not loaded stands for itself in a serialization, one that is loaded
	for the object it holds"
	| tx graph proxy |
	tx := soil newTransaction.
	graph := SoilTestGraphRoot new
		nested: (SoilTestNestedObject new
			label: ''nested under root'';
			reference: (SoilTestClusterRoot new
				nested: (SoilTestNestedObject new
					label: ''nested under cluster''))).
	tx makeRoot: graph nested reference.
	tx root: graph.
	tx commit.
	tx := soil newTransaction.
	proxy := tx root nested reference.
	self assert: proxy isSoilProxy.
	self assert: proxy objectIsNotLoaded.
	self assert: proxy fuelReplacement class equals: SoilUnresolvedProxy.
	self assert: proxy fuelReplacement objectId equals: proxy objectId.
	proxy nested.
	self deny: proxy objectIsNotLoaded.
	self assert: proxy fuelReplacement == proxy theNonSoilProxy.
	tx abort'.

add value: #SoilApiSurfaceTest value: #testObjectRepositoryLocations value: 'tests' value:
'testObjectRepositoryLocations
	"the places of the versions that a reader still needs: with no reader only the
	newest, with a reader at the first commit the newest and the one the reader sees"
	| objectId |
	objectId := self commitRoot.
	self assert: (soil objectRepository locationsOf: objectId upToReadVersion: nil) size equals: 1.
	self assert: (soil objectRepository locationsOf: objectId upToReadVersion: 1) size equals: 2'.

add value: #SoilApiSurfaceTest value: #testFileFieldInitialBlock value: 'tests' value:
'testFileFieldInitialBlock
	| field |
	field := SoilFileField name: #answer size: 4 initialBlock: [ 42 ].
	self assert: field initialBlock value equals: 42'.

add value: #SoilApiSurfaceTest value: #testBehaviorShapeConflictAccessors value: 'tests' value:
'testBehaviorShapeConflictAccessors
	| error |
	error := SoilBehaviorShapeConflict new
		behaviorIdentifier: ''Foo'';
		importedInstVarNames: #(a b);
		presentInstVarNames: #(a c);
		yourself.
	self assert: error importedInstVarNames equals: #(a b).
	self assert: error presentInstVarNames equals: #(a c).
	self assert: (error messageText includesSubstring: ''Foo'')'.

add value: #SoilApiSurfaceTest value: #testIncompatibleExportFormatAccessors value: 'tests' value:
'testIncompatibleExportFormatAccessors
	| error |
	error := SoilIncompatibleExportFormat new
		importerUnderstands: 1;
		streamSays: 2;
		yourself.
	self assert: error importerUnderstands equals: 1.
	self assert: error streamSays equals: 2.
	self assert: (error messageText includesSubstring: ''2'')'.

add value: #SoilApiSurfaceTest value: #testClusterVersionResetBytes value: 'tests' value:
'testClusterVersionResetBytes
	| objectId version |
	objectId := self commitRoot.
	version := (soil objectRepository segmentAt: objectId segment) at: objectId index.
	self deny: (version instVarNamed: #bytes) isNil.
	version resetBytes.
	self assert: (version instVarNamed: #bytes) isNil'.

add value: #SoilApiSurfaceTest value: #testBehaviorRegistryRecreateIndex value: 'tests' value:
'testBehaviorRegistryRecreateIndex
	"the index of class names is built again from the descriptions in the meta segment"
	| tx |
	tx := soil newTransaction.
	tx root: SoilTestClass1 new.
	tx commit.
	soil behaviorRegistry recreateIndex.
	self assert: (soil behaviorRegistry nameAt: SoilTestClass1 name ifAbsent: [ nil ]) notNil.
	soil close.
	soil := (Soil path: ''soil-api-surface-tests'') open.
	tx := soil newTransaction.
	self assert: tx root class equals: SoilTestClass1.
	tx abort'.

(Smalltalk globals includesKey: #SoilJournalConverterTest) ifFalse: [
	(TestCase << #SoilJournalConverterTest
		slots: { #soil };
		package: 'Soil-Core-Tests';
		yourself) install ].

add value: #SoilJournalConverterTest value: #setUp value: 'tests' value:
'setUp
	super setUp.
	soil := Soil path: ''soil-journal-converter-tests''.
	soil
		destroy;
		initializeFilesystem'.

add value: #SoilJournalConverterTest value: #tearDown value: 'tests' value:
'tearDown
	soil ifNotNil: [
		soil isOpen ifTrue: [ soil close ].
		soil destroy ].
	super tearDown'.

add value: #SoilJournalConverterTest value: #testConvertRebuildsTheJournalFromOldFiles value: 'tests' value:
'testConvertRebuildsTheJournalFromOldFiles
	"The first format of the journal kept one file for each transaction, named for the
	transaction (1.journal, 2.journal ...). The converter reads such files, writes the
	same transactions into the journal of today and deletes the old files."
	| tx journals journalPath |
	1 to: 2 do: [ :n |
		tx := soil newTransaction.
		tx root: (SoilPersistentDictionary new
			at: #n put: n;
			yourself).
		tx commit ].
	journals := (1 to: soil control databaseVersion) collect: [ :each |
		soil journal transactionJournalAt: each ifAbsent: [ self fail ] ].
	soil close.
	"put the journal into the old form: the fragment files go, one file for each transaction comes"
	journalPath := soil path / #journal.
	journalPath files do: [ :each | each delete ].
	journals do: [ :each |
		(journalPath / (each index printString , ''.journal'')) binaryWriteStreamDo: [ :stream |
			each writeOn: stream ] ].
	self assert: (journalPath allChildrenMatching: ''*.journal'') size equals: journals size.
	soil basicOpen.
	(SoilJournalConverter new
		soil: soil;
		yourself) convert.
	self assert: (journalPath allChildrenMatching: ''*.journal'') isEmpty.
	journals do: [ :each |
		self assert: (soil journal transactionJournalAt: each index ifAbsent: [ nil ]) notNil ].
	soil close.
	soil := (Soil path: ''soil-journal-converter-tests'') open.
	tx := soil newTransaction.
	self assert: (tx root at: #n) equals: 2.
	tx abort'.


fix value: #SoilBehaviorRegistry value: #recreateIndex
	value: [ :source | source includesSubstring: 'txn commit ] ' ]
	value:
'recreateIndex 
	| txn metaSegment record zeroFound |
	"this is a last resort action to recreate the index in a sane
	state. It assumes that all behavior descriptions are written 
	in the meta segement but the entry in the index is bogus. 
	So we read all from the segment and readd them.
	The transaction only reads, so it is aborted at the end. A commit before the abort
	removed the transaction from the transaction manager a second time and failed"
	txn := soil newTransaction.
	[
		metaSegment := soil objectRepository metaSegment.
		3 to: metaSegment lastObjectIndex do: [ :n |
			record := txn materializeRecord: (metaSegment at: n). 
			self nameAt: record object behaviorIdentifier put: record objectId 
		] ] 
			ensure: [ txn abort ].
	"there are pages with multiple zero entries. The only way right now
	is to remove the same key until the ifAbsent block is executed"
	zeroFound := true.
	[ zeroFound ] whileTrue: [  
		index removeKey: 0 ifAbsent: [ zeroFound := false ] ].
	"as we are on it we can also compact the index"
	index compact'.

fix value: #SoilObjectRepository value: #cacheSegmentAt:using:
	value: [ :source | source includesSubstring: 'aBlock value: metaSegment' ]
	value:
'cacheSegmentAt: index using: aBlock
	| segment |
	"exchange object segment with a LRU cached segment. The block is given the LRU
	cache of the new segment and sets it up (SoilSetup>>cacheSegmentAt:maximumBytes:
	sends #computeWeight: and #maximumWeight: to what it is given, and those are
	messages of the cache, not of the segment)"
	(index == 0) 
		ifTrue: [ 
			metaSegment := metaSegment asCachedSegment.
			aBlock value: metaSegment cache ]
		ifFalse: [ 
			segment := (segments at: index) asCachedSegment.
			aBlock value: segment cache.
			segments 	
				at: index 
				put: segment ]'.

fix value: #SoilMaterializer value: #nextCompiledMethod11:
	value: [ :source | (source includesSubstring: 'ignoreNotImplementedSelectors') not ]
	value:
'nextCompiledMethod11: aClass
	"The reader for the format of Pharo 11 and older: #nextCompiledMethod: sends it only
	before Pharo 12. Pharo 12 and newer have no CompiledMethod>>#trailer, so the lint
	test for unimplemented calls must not count that send."
	<ignoreNotImplementedSelectors: #(trailer)>

 	| header bytecodesPlusTrailerSize compiledMethod |

 	header :=  self nextSoilObject.
 	bytecodesPlusTrailerSize := self nextLengthEncodedInteger.

 	compiledMethod := aClass
 		newMethod: bytecodesPlusTrailerSize
 		header: header.

	self registerObject: compiledMethod.

 	"first the literals"
	1 to: compiledMethod numLiterals do: [ :i |		
		compiledMethod literalAt: i put: self nextSoilObject ].
	
	
	"LiteralVariables have been restored as new instances pointing to nil, we now do a pass to re-lookup. We have to do this as a second pass as the last literal encodes the class name we have to use to re-lookup"
	
	1 to: compiledMethod numLiterals do: [ :i |	 | literal className class |	
		className :=  (compiledMethod literalAt: compiledMethod numLiterals) name.
		class := Smalltalk globals at: className.
		literal := compiledMethod literalAt: i.
		(literal isKindOf: LiteralVariable) ifTrue: [ 
			compiledMethod literalAt: i put: (class lookupVar: literal name).
			 ]  ].

 	"then the bytecodes, we ignore the trailer for now"
 	compiledMethod initialPC 
 		to: compiledMethod size - compiledMethod trailer size
 		do: [ :index |
 			compiledMethod
 				at: index
 				put: self nextByte ].
	
 	^compiledMethod'.

fix value: #SoilCleanCodeTest value: #testNoUnsentMessages
	value: [ :source | source includesSubstring: 'self skip' ]
	value:
'testNoUnsentMessages
	"Fail if there are methods implemented whose selectors is not sent anywhere in Pharo.
	Please add a test or remove the method!"

	| found methods|
	found := self packageToCheck allUnsentMessages.
	methods := self packageToCheck methods select: [ :method | found includes: method selector ].
	methods := methods reject: [:method | method hasPragmaNamed: #inspectorPresentationOrder:title:
  ].
	
	self
		assert: methods isEmpty
		description: (''the following selectors are implemented, but never send'', methods asString)'.

"A method that has no sender anywhere in the image, only a copy of the loop that its
sibling #checkDescriptionsOfVersion:referencedBy:in: runs"
(Smalltalk globals at: #SoilDatabaseConsistencyTracker ifAbsent: [ nil ]) ifNotNil: [ :trackerClass |
	(trackerClass includesSelector: #checkDescriptionsOf:referencedBy:in:)
		ifTrue: [
			trackerClass removeSelector: #checkDescriptionsOf:referencedBy:in:.
			Stdio stdout nextPutAll: 'FIXED SoilDatabaseConsistencyTracker>>checkDescriptionsOf:referencedBy:in: removed (no sender)'; lf; flush ]
		ifFalse: [
			Stdio stdout nextPutAll: 'SKIP SoilDatabaseConsistencyTracker>>checkDescriptionsOf:referencedBy:in: (absent)'; lf; flush ] ].
Tests that cannot apply, with the proof: apptivegrid-soil.txt (download)
# Tests that cannot apply.  One test for each line: Class>>selector (with the
# parameters of a parametrized case), or Class>>* for each test of the class.
# A line that starts with # has the proof.
#
# SoilIndexIteratorTest is a parametrized test class (index class and
# uniqueKeys).  SoilIndexIterator>>moveKey:to:ifAbsent: signals a SoilError
# when the index does not have unique keys (Soil-Core, SoilIndexIterator,
# 'index hasUniqueKeys ifFalse: [ SoilError signal: ... ]').  So testMoveKey
# and testMoveKeyOverwritesTheTarget have a meaning only for uniqueKeys true,
# and testMoveKeyOnNonUniqueIndexIsRefused only for uniqueKeys false.  Each
# test skips for the other value, and the cases with a meaning pass.
SoilIndexIteratorTest>>testMoveKey(#classToTest->SoilBTree_#uniqueKeys->false)
SoilIndexIteratorTest>>testMoveKey(#classToTest->SoilSkipList_#uniqueKeys->false)
SoilIndexIteratorTest>>testMoveKeyOverwritesTheTarget(#classToTest->SoilBTree_#uniqueKeys->false)
SoilIndexIteratorTest>>testMoveKeyOverwritesTheTarget(#classToTest->SoilSkipList_#uniqueKeys->false)
SoilIndexIteratorTest>>testMoveKeyOnNonUniqueIndexIsRefused(#classToTest->SoilBTree_#uniqueKeys->true)
SoilIndexIteratorTest>>testMoveKeyOnNonUniqueIndexIsRefused(#classToTest->SoilSkipList_#uniqueKeys->true)
#
# SoilWindowsFileLockTest: each of these tests starts with
# 'OSPlatform current isWindows ifFalse: [ ^ self skip ]' and calls kernel32
# through FFI (LockFileEx, UnlockFileEx, FlushFileBuffers: Soil-File,
# SoilWindowsFileLock, 'module: #kernel32').  The test machine is macOS.  The
# two tests of the class that do not call kernel32 (testErrorDescriptions,
# testWinOverlappedStructure) run and pass.  SoilLockableStreamTest and
# SoilFileLockRegistryTest test the file locks of macOS and pass.
SoilWindowsFileLockTest>>testFlushFileBuffersDirect
SoilWindowsFileLockTest>>testFsyncEntireFile
SoilWindowsFileLockTest>>testLockAndUnlockEntireFile
SoilWindowsFileLockTest>>testLockAndUnlockRange
SoilWindowsFileLockTest>>testLockExclusive
SoilWindowsFileLockTest>>testLockOrErrorSuccess
SoilWindowsFileLockTest>>testLockShared
SoilWindowsFileLockTest>>testMultipleLocks

State of 2026-11-20. Made from the test records of the iospharo project (a second Pharo VM). The fixes are proposals for review.