dirkwhoffmann/vAmiga

Self-test code fails on Windows

Closed this issue · 2 comments

Today, I've enabled the CMake tests on Windows builds.

The second test (the console app creates an emulator instance and runs a self-test script) fails on Windows builds with an exception:

2: Test command: D:\a\vAmiga\vAmiga\build\Release\vAmigaConsole.exe
2: Working Directory: D:/a/vAmiga/vAmiga/build
2: Test timeout computed to be: 10000000
2: vAmiga Headless v2.6.2 - (C)opyright Dirk W. Hoffmann
2: 
2: System Error: resource deadlock would occur: resource deadlock would occur
2/2 Test #2: SelfTest2 ........................***Failed    0.11 sec

If somebody knows what's going on, please let me know.

Bildschirmfoto 2024-08-23 um 17 44 30

OK, as expected. My mutex code is not Windows compatible.

The mutex is unlocked by a different thread which is not allowed according to https://en.cppreference.com/w/cpp/thread/mutex/unlock

Finally, the Headless app runs on Windows...

Bildschirmfoto 2024-08-23 um 21 39 46

Besides the mutex issue, running the Headless app on Windows unexpectedly revealed a couple of bugs in the command handlers of some RetroShell commands (access of non-existing vector elements). The effort paid off.