Open: the two tests testCallingFunctionWithW64CallingConvention (TFFunctionCallTest and TFUFFIDifferentCallingConventionFunctionCallTest) run only on an x86_64 VM on macOS. The proof is only the architecture name on arm64; a run on an x86_64 VM under Rosetta is not done.
scripts/image-fixes/20-NA-platform-windows.stWin32EnvironmentTest>>testExistingEnvironmentVariableLongerThanBufferShouldReturnValue, Win32EnvironmentTest>>testExistingEnvironmentVariableShouldReturnValue, Win32EnvironmentTest>>testNonExistingEnvironmentVariableShouldGenerateExceptionOf 19 tests, 3 (Win32EnvironmentTest) were skipping on macOS for no good reason; the skip is removed and they now pass on both VMs. The other 16 test Windows-only or x86_64-only behaviour and are proven not applicable on this machine. No VM defect was found.
| Test | Defect in | State | Cause |
|---|---|---|---|
Win32EnvironmentTest>>testExistingEnvironmentVariableLongerThanBufferShouldReturnValue |
test | repaired | Skipped on non-Windows although it only checks the platform-independent OSEnvironment contract, which works on macOS. The isWindows skip is removed and the assertions are unchanged. |
Win32EnvironmentTest>>testExistingEnvironmentVariableShouldReturnValue |
test | repaired | Same as above. The skip is removed and the assertion is unchanged. |
Win32EnvironmentTest>>testNonExistingEnvironmentVariableShouldGenerateException |
test | repaired | Same as above. The skip is removed and the assertion is unchanged. |
Win32WideStringTest>>testCharactersAreEncodedInUnicode16Bits |
none-not-applicable | not applicable | Win32WideString (FFI-Kernel) converts through the Windows API MultiByteToWideChar and WideCharToMultiByte, called via WinPlatform. On this machine asWin32WideString fails with MessageNotUnderstood MacOSXPlatform>>#multiByteToWideCharacterCodepage:flags:input:inputLen:output:outputLen:. Measured on both VMs with evalfile.sh (<work directory>). OSPlatform current isWindows is false. |
Win32WideStringTest>>testConvertingInBothDirectionsGaveSameString |
none-not-applicable | not applicable | Same as above: Windows-API-only code under test. |
Win32WideStringTest>>testHandleIsAByteArray |
none-not-applicable | not applicable | Same as above. |
Win32WideStringTest>>testUnderlayingByteArrayEndsInTwoZeros |
none-not-applicable | not applicable | Same as above. |
Win32WideStringTest>>testUnderlayingByteArrayIsMultipleOf2 |
none-not-applicable | not applicable | Same as above. |
KMCombinationTest>>testWindowsAndUnixMetaShouldBeCtrl |
none-not-applicable | not applicable | The test is skipped when OSPlatform current isMacOS. On macOS $n meta prints 'Meta + N' and $n ctrl prints 'Ctrl + N', and $n meta = $n ctrl is false on both VMs, so the assertion cannot hold here by design. The macOS counterpart KMCombinationTest>>testMacMetaShouldBeCmd passes on both VMs. |
TFBasicTypeSizeTest>>testSizeSignedLongWindows |
none-not-applicable | not applicable | Asserts long is 4 bytes, which is the Windows LLP64 size. On this machine TFBasicType slong byteSize is 8 on both VMs. The Unix counterpart testSizeSignedLongUnix (long equals Smalltalk wordSize) passes on both VMs. |
TFBasicTypeSizeTest>>testSizeUnsignedLongWindows |
none-not-applicable | not applicable | Same as above (ulong is 8 bytes here). Counterpart testSizeUnsignedLongUnix passes on both VMs. |
TFBasicTypeTest>>testSignedLongWindows |
none-not-applicable | not applicable | Same as above. Counterpart testSignedLongUnix passes on both VMs. |
TFBasicTypeTest>>testUnsignedLongWindows |
none-not-applicable | not applicable | Same as above. Counterpart testUnsignedLongUnix passes on both VMs. |
TFUFFIBasicTypeSizeTest>>testSizeSignedLongWindows |
none-not-applicable | not applicable | Same as above (the test inherits TFBasicTypeSizeTest). Counterpart testSizeSignedLongUnix passes on both VMs. |
TFUFFIBasicTypeSizeTest>>testSizeUnsignedLongWindows |
none-not-applicable | not applicable | Same as above. Counterpart testSizeUnsignedLongUnix passes on both VMs. |
TFFunctionCallTest>>testCallingFunctionWithW64CallingConvention |
none-not-applicable | not applicable | The test runs only when isMacOS and Smalltalk vm architectureName = 'x86_64', and uses the ABI DARWIN_X86_64_WIN64. This machine is arm64 (architectureName is 'aarch64' on our VM, 'arm64' on Cog). That ABI exists only in libffi for x86_64 Darwin. I did not try an x86_64 VM under Rosetta, so the test is not proven to pass there. |
TFUFFIDifferentCallingConventionFunctionCallTest>>testCallingFunctionWithW64CallingConvention |
none-not-applicable | not applicable | Same condition as above (x86_64 only). |
WinPlatformTest>>testGetTempPathFromTMP |
none-not-applicable | not applicable | Tests WinPlatform>>getTempPath, which calls the kernel32 function GetTempPathW. On this machine OSPlatform current is MacOSXPlatform, which does not understand #getTempPath, and WinPlatform new getTempPath fails. The code under test cannot run on macOS. |
WindowsResolverTest>>testResolveTempPathFromTMP |
none-not-applicable | not applicable | WindowsResolver>>temp calls OSPlatform current getTempPath (GetTempPathW). Measured: WindowsResolver new temp gives MessageNotUnderstood MacOSXPlatform>>#getTempPath on both VMs. |
Regression check: OSEnvironmentTest (the only code these tests touch, no non-test method changed): 8 PASS on both our VM and Cog, with the fix image. It was also 8 PASS on the base images before the fix. TFBasicTypeSizeTest, TFBasicTypeTest, TFUFFIBasicTypeSizeTest and KMCombinationTest were run on the base images only (no change there). Only the Unix/macOS counterpart tests were checked as PASS; the remaining tests in those classes were not listed.
Open points: None blocking. Two items I did not run: (1) the W64 calling-convention tests under an x86_64 VM on Rosetta (proven not applicable only by the condition value on arm64). (2) The Win32WideString and WinPlatform/WindowsResolver tests could only be run on Windows. I did not stub the Windows API into the tests, since that would weaken them. The p1.st output for 'WinPlatform new getTempPath' showed a MessageNotUnderstood about multiByteToWideCharacterCodepage:, which looks like the wrong selector for that call; I did not investigate it.
Upstream note: Pharo, System-OSEnvironments-Tests: Win32EnvironmentTest only skips on non-Windows, but its three tests check platform-independent OSEnvironment behaviour (at:put:, a value of 1500 characters, NotFound for an absent name). Remove the OSPlatform current isWindows skip so the tests run on Unix and macOS. The assertions are unchanged. Not submitted; needs owner review first.
Last full sweeps of 2026-11-17: iospharo (sweep14-new14) and stock Cog with the Cog changes (sweepcogp14-new10), with all image fixes. "Before" is the state of the test before the repairs. The Stock Cog column has a value only where the record measured stock Cog: "PASS 3 of 3 (repair run)" is the check of each repair on stock Cog v12.0.6 with the fix entry; "-" is not measured separately.
| Test | Before | State | iospharo VM | Patched Cog | Stock Cog |
|---|---|---|---|---|---|
Win32EnvironmentTest>>testExistingEnvironmentVariableLongerThanBufferShouldReturnValue | SKIP | repaired | PASS | PASS | PASS 3 of 3 (repair run) |
Win32EnvironmentTest>>testExistingEnvironmentVariableShouldReturnValue | SKIP | repaired | PASS | PASS | PASS 3 of 3 (repair run) |
Win32EnvironmentTest>>testNonExistingEnvironmentVariableShouldGenerateException | SKIP | repaired | PASS | PASS | PASS 3 of 3 (repair run) |
KMCombinationTest>>testWindowsAndUnixMetaShouldBeCtrl | SKIP | not applicable | SKIP | SKIP | - |
TFBasicTypeSizeTest>>testSizeSignedLongWindows | SKIP | not applicable | SKIP 2x | SKIP 2x | - |
TFBasicTypeSizeTest>>testSizeUnsignedLongWindows | SKIP | not applicable | SKIP 2x | SKIP 2x | - |
TFBasicTypeTest>>testSignedLongWindows | SKIP | not applicable | SKIP 2x | SKIP 2x | - |
TFBasicTypeTest>>testUnsignedLongWindows | SKIP | not applicable | SKIP 2x | SKIP 2x | - |
TFFunctionCallTest>>testCallingFunctionWithW64CallingConvention | SKIP | not applicable | SKIP 2x | SKIP 2x | - |
TFUFFIBasicTypeSizeTest>>testSizeSignedLongWindows | SKIP | not applicable | SKIP 2x | SKIP 2x | - |
TFUFFIBasicTypeSizeTest>>testSizeUnsignedLongWindows | SKIP | not applicable | SKIP 2x | SKIP 2x | - |
TFUFFIDifferentCallingConventionFunctionCallTest>>testCallingFunctionWithW64CallingConvention | SKIP | not applicable | SKIP 2x | SKIP 2x | - |
Win32WideStringTest>>testCharactersAreEncodedInUnicode16Bits | SKIP | not applicable | SKIP | SKIP | - |
Win32WideStringTest>>testConvertingInBothDirectionsGaveSameString | SKIP | not applicable | SKIP | SKIP | - |
Win32WideStringTest>>testHandleIsAByteArray | SKIP | not applicable | SKIP | SKIP | - |
Win32WideStringTest>>testUnderlayingByteArrayEndsInTwoZeros | SKIP | not applicable | SKIP | SKIP | - |
Win32WideStringTest>>testUnderlayingByteArrayIsMultipleOf2 | SKIP | not applicable | SKIP | SKIP | - |
WinPlatformTest>>testGetTempPathFromTMP | SKIP | not applicable | SKIP | SKIP | - |
WindowsResolverTest>>testResolveTempPathFromTMP | SKIP | not applicable | SKIP | SKIP | - |
Run the tests in a Pharo 14 image on macOS arm64: they skip (the fixtures and the platform tests skip by design).
"Run in a Playground of a Pharo 14 image (Do it and print each line)." ((KMCombinationTest selector: #testWindowsAndUnixMetaShouldBeCtrl) run) printString. ((TFBasicTypeSizeTest selector: #testSizeSignedLongWindows) run) printString. ((TFBasicTypeSizeTest selector: #testSizeUnsignedLongWindows) run) printString. ((TFBasicTypeTest selector: #testSignedLongWindows) run) printString. ((TFBasicTypeTest selector: #testUnsignedLongWindows) run) printString. ((TFFunctionCallTest selector: #testCallingFunctionWithW64CallingConvention) run) printString. ((TFUFFIBasicTypeSizeTest selector: #testSizeSignedLongWindows) run) printString. ((TFUFFIBasicTypeSizeTest selector: #testSizeUnsignedLongWindows) run) printString. ((TFUFFIDifferentCallingConventionFunctionCallTest selector: #testCallingFunctionWithW64CallingConvention) run) printString. ((Win32EnvironmentTest selector: #testExistingEnvironmentVariableLongerThanBufferShouldReturnValue) run) printString. ((Win32EnvironmentTest selector: #testExistingEnvironmentVariableShouldReturnValue) run) printString. ((Win32EnvironmentTest selector: #testNonExistingEnvironmentVariableShouldGenerateException) run) printString. ((Win32WideStringTest selector: #testCharactersAreEncodedInUnicode16Bits) run) printString. ((Win32WideStringTest selector: #testConvertingInBothDirectionsGaveSameString) run) printString. ((Win32WideStringTest selector: #testHandleIsAByteArray) run) printString. ((Win32WideStringTest selector: #testUnderlayingByteArrayEndsInTwoZeros) run) printString. ((Win32WideStringTest selector: #testUnderlayingByteArrayIsMultipleOf2) run) printString. ((WinPlatformTest selector: #testGetTempPathFromTMP) run) printString. ((WindowsResolverTest selector: #testResolveTempPathFromTMP) run) printString.
testWindowsAndUnixMetaShouldBeCtrl OSPlatform current isMacOS ifTrue: [ ^ self skip ]. self assert: $n meta equals: $n ctrl. self assert: $n ctrl equals: $n meta. self assert: $n meta shift equals: $n ctrl shift. self assert: $n ctrl shift equals: $n meta shift
testSizeSignedLongWindows OSPlatform current isWindows ifFalse: [ "Check #testSizeSignedLongUnix" ^ self skip ]. self assertType: 'long' equals: 4
testSizeUnsignedLongWindows OSPlatform current isWindows ifFalse: [ "Check #testSizeUnsignedLongUnix" ^ self skip ]. self assertType: 'ulong' equals: 4
testSignedLongWindows OSPlatform current isWindows ifFalse: [ "Check #testSignedLongUnix" ^ self skip ]. self assert: TFBasicType slong byteSize equals: 4
testUnsignedLongWindows OSPlatform current isWindows ifFalse: [ "Check #testUnsignedLongUnix" ^ self skip ]. self assert: TFBasicType ulong byteSize equals: 4
testCallingFunctionWithW64CallingConvention
| fun returnValue |
"This test is only valid in OSX and X86_64, as calling conventions constants are heavily dependant on the OS & Architecture"
(OSPlatform current isMacOS and: [ Smalltalk vm architectureName = 'x86_64'])
ifFalse: [ self skip ].
fun := TFExternalFunction
name: 'w64Convention'
moduleName: self libraryPath
definition: (TFFunctionDefinition
parameterTypes: {TFBasicType sint. TFBasicType sint. TFBasicType sint. TFBasicType sint. TFBasicType sint. TFBasicType sint. TFBasicType sint. TFBasicType sint. TFBasicType sint. TFBasicType sint}
returnType: TFBasicType sint
abi: DARWIN_X86_64_WIN64).
returnValue := runner invokeFunction: fun withArguments: (1 to: 10) asArray.
self assert: returnValue equals: 55testCallingFunctionWithW64CallingConvention | result | "This test is only valid in OSX and X86_64, as calling conventions constants are heavily dependant on the OS & Architecture" (OSPlatform current isMacOS and: [ Smalltalk vm architectureName = 'x86_64']) ifFalse: [ self skip ]. result := self calloutWithManyArguments: 1 and: 2 and: 3 and: 4 and: 5 and: 6 and: 7 and: 8 and: 9 and: 10. self assert: result equals: 55
testExistingEnvironmentVariableLongerThanBufferShouldReturnValue | value aExpectedValue | OSPlatform current isWindows ifFalse: [ ^self skip ]. aExpectedValue := String loremIpsum: 1500. OSEnvironment current at: 'ExistingNonEmpty' put: aExpectedValue. value := OSEnvironment current at: 'ExistingNonEmpty'. self assert: value equals: aExpectedValue
testExistingEnvironmentVariableShouldReturnValue | value | OSPlatform current isWindows ifFalse: [ ^self skip ]. OSEnvironment current at: 'ExistingNonEmpty' put: 'IamAValue'. value := OSEnvironment current at: 'ExistingNonEmpty'. self assert: value equals: 'IamAValue'
testNonExistingEnvironmentVariableShouldGenerateException OSPlatform current isWindows ifFalse: [ ^self skip ]. self should: [ OSEnvironment current at: 'NonExistingVariable' ] raise: NotFound
testCharactersAreEncodedInUnicode16Bits | bytes index | self isWindows ifFalse: [ ^self skip ]. bytes := self exampleString asWin32WideString getHandle. index := 1. self exampleString do: [ :aCharacter | self assert: (bytes at: index) equals: (aCharacter codePoint bitAnd: 255). self assert: (bytes at: index+1) equals: (aCharacter codePoint >> 8). index := index + 2. ]
testConvertingInBothDirectionsGaveSameString self isWindows ifFalse: [ ^self skip ]. self assert: self exampleString asWin32WideString asString equals: self exampleString
testHandleIsAByteArray self isWindows ifFalse: [ ^self skip ]. self assert: (self exampleString asWin32WideString getHandle isKindOf: ByteArray)
testUnderlayingByteArrayEndsInTwoZeros self isWindows ifFalse: [ ^self skip ]. self assert: (self exampleString asWin32WideString getHandle last:2) equals: #[00 00]
testUnderlayingByteArrayIsMultipleOf2 self isWindows ifFalse: [ ^self skip ]. self assert: (self exampleString asWin32WideString getHandle size) % 2 equals: 0
testGetTempPathFromTMP | value | OSPlatform current isWindows ifFalse: [ ^ self skip ]. value := OSEnvironment current at: 'TMP' ifAbsent: [ nil ]. [ | actual expected | expected := 'X:\Temp\'. OSEnvironment current at: 'TMP' put: expected. actual := OSPlatform current getTempPath. self assert: actual equals: expected ] ensure: [ value ifNil: [ OSEnvironment current removeKey: 'TMP' ] ifNotNil: [ OSEnvironment current at: 'TMP' put: value ] ]
testResolveTempPathFromTMP | expected | OSPlatform current isWindows ifFalse: [ ^ self skip ]. expected := 'X:\Temp'. OSEnvironment current setEnv: 'TMP' value: expected during: [ | actual | actual := WindowsResolver new temp. self assert: actual fullName equals: expected ]
How to apply an entries file: file in 00-header.st and the entries file as one chunk (the iospharo script scripts/gen-image-fixes.py makes that chunk). Each entry checks for the defect first and prints FIXED, ADDED or SKIP. Download 00-header.st.
"Win32EnvironmentTest: the three tests check the platform independent OSEnvironment contract (at:put:, at: with a value longer than 1000 characters, NotFound for an absent name). Their only Windows part was the skip; the code under test (OSEnvironment current) works on macOS and Linux, so the tests run everywhere." fix value: #Win32EnvironmentTest value: #testExistingEnvironmentVariableLongerThanBufferShouldReturnValue value: [ :s | s includesSubstring: 'isWindows' ] value: 'testExistingEnvironmentVariableLongerThanBufferShouldReturnValue | value aExpectedValue | aExpectedValue := String loremIpsum: 1500. OSEnvironment current at: ''ExistingNonEmpty'' put: aExpectedValue. value := OSEnvironment current at: ''ExistingNonEmpty''. self assert: value equals: aExpectedValue'. fix value: #Win32EnvironmentTest value: #testExistingEnvironmentVariableShouldReturnValue value: [ :s | s includesSubstring: 'isWindows' ] value: 'testExistingEnvironmentVariableShouldReturnValue | value | OSEnvironment current at: ''ExistingNonEmpty'' put: ''IamAValue''. value := OSEnvironment current at: ''ExistingNonEmpty''. self assert: value equals: ''IamAValue'''. fix value: #Win32EnvironmentTest value: #testNonExistingEnvironmentVariableShouldGenerateException value: [ :s | s includesSubstring: 'isWindows' ] value: 'testNonExistingEnvironmentVariableShouldGenerateException self should: [ OSEnvironment current at: ''NonExistingVariable'' ] raise: NotFound'.
State of 2026-11-20. Made from the test records of the iospharo project (a second Pharo VM). The fixes are proposals for review.