Add tests for controller fire attempt suppression and usecode interpreter functionality
- Enhanced isometric_controls_tests.cpp to include assertions for controller fire attempt suppression under various conditions. - Added tests for the Usecode interpreter in usecode_vm_tests.cpp, verifying script execution and stack manipulation. - Introduced a new PowerShell script, clean-old-build-artifacts.ps1, to facilitate the cleanup of old build artifacts in specified directories.
This commit is contained in:
parent
49a15602b6
commit
ffb1918f35
41 changed files with 3611 additions and 349 deletions
|
|
@ -271,6 +271,15 @@ int main()
|
|||
groupKernel.refreshActiveGroup(groupTable);
|
||||
assert(groupKernel.activeGroup() == 30 && groupKernel.groupSelectionPending());
|
||||
|
||||
remorse::ProcessKernel retainedGroupKernel;
|
||||
remorse::u16 retainedGroups[32]{};
|
||||
retainedGroupKernel.createProcess(2, retainedGroups);
|
||||
retainedGroupKernel.createProcess(5, retainedGroups);
|
||||
retainedGroupKernel.terminateProcess(1, retainedGroups);
|
||||
retainedGroupKernel.setActiveGroup(3);
|
||||
retainedGroupKernel.refreshActiveGroup(retainedGroups);
|
||||
assert(retainedGroupKernel.activeGroup() == 5 && !retainedGroupKernel.groupSelectionPending());
|
||||
|
||||
remorse::ProcessKernel scheduler;
|
||||
remorse::u16 scheduledGroups[32]{};
|
||||
assert(scheduler.activeGroup() == 1 && !scheduler.groupSelectionPending());
|
||||
|
|
@ -296,6 +305,21 @@ int main()
|
|||
assert((ran == std::vector<remorse::u16>{2, 3}));
|
||||
assert(specialGroup->bytes[0x08] == 30);
|
||||
|
||||
remorse::ProcessKernel gateKernel;
|
||||
remorse::u16 gateGroups[32]{};
|
||||
auto* linkedAt24 = gateKernel.createProcess(2, gateGroups);
|
||||
auto* linkedAt26 = gateKernel.createProcess(2, gateGroups);
|
||||
auto* readyProcess = gateKernel.createProcess(2, gateGroups);
|
||||
auto* daemonProcess = gateKernel.createProcess(3, gateGroups);
|
||||
linkedAt24->bytes[0x24] = 1;
|
||||
linkedAt26->bytes[0x26] = 1;
|
||||
daemonProcess->bytes[0x16] |= 2;
|
||||
std::vector<remorse::u16> gatedRuns;
|
||||
gateKernel.scanRunnableProcesses(2, recordRun, &gatedRuns);
|
||||
assert(gatedRuns.size() == 2);
|
||||
assert(gateKernel.processAt(gatedRuns[0]) == readyProcess);
|
||||
assert(gateKernel.processAt(gatedRuns[1]) == daemonProcess);
|
||||
|
||||
remorse::ProcessKernel automaticGroupKernel;
|
||||
remorse::u16 automaticGroupCounts[32]{};
|
||||
automaticGroupKernel.createProcess(3, automaticGroupCounts);
|
||||
|
|
@ -965,6 +989,29 @@ int main()
|
|||
event.scanCode, event.modifiers, event.field8 != 0);
|
||||
}, &deliveredMovement);
|
||||
assert(deliveredMovement.request().animation == 1 && deliveredMovement.request().direction == 14);
|
||||
inputKernel.setActiveGroup(2);
|
||||
std::vector<remorse::u8> groupFilteredScans;
|
||||
assert(inputKernel.queuePendingKeyEvent(wrapped));
|
||||
inputKernel.dispatchPendingKeyEvents([](remorse::EntityDispatchEntryBase&,
|
||||
remorse::u16, remorse::u16, remorse::KeyEvent& event, void* context) {
|
||||
static_cast<std::vector<remorse::u8>*>(context)->push_back(event.scanCode);
|
||||
}, &groupFilteredScans);
|
||||
assert(groupFilteredScans.empty());
|
||||
remorse::EntityDispatchEntry::setGroupId(inputController->base, 2, inputGroups);
|
||||
assert(inputKernel.queuePendingKeyEvent(wrapped));
|
||||
inputKernel.dispatchPendingKeyEvents([](remorse::EntityDispatchEntryBase&,
|
||||
remorse::u16, remorse::u16, remorse::KeyEvent& event, void* context) {
|
||||
static_cast<std::vector<remorse::u8>*>(context)->push_back(event.scanCode);
|
||||
}, &groupFilteredScans);
|
||||
assert((groupFilteredScans == std::vector<remorse::u8>{0x48}));
|
||||
inputKernel.setActiveGroup(31);
|
||||
remorse::EntityDispatchEntry::setGroupId(inputController->base, 30, inputGroups);
|
||||
assert(inputKernel.queuePendingKeyEvent(wrapped));
|
||||
inputKernel.dispatchPendingKeyEvents([](remorse::EntityDispatchEntryBase&,
|
||||
remorse::u16, remorse::u16, remorse::KeyEvent& event, void* context) {
|
||||
static_cast<std::vector<remorse::u8>*>(context)->push_back(event.scanCode);
|
||||
}, &groupFilteredScans);
|
||||
assert((groupFilteredScans == std::vector<remorse::u8>{0x48, 0x48}));
|
||||
wrapped.field8 = 0;
|
||||
assert(inputKernel.queuePendingKeyEvent(wrapped));
|
||||
inputKernel.dispatchPendingKeyEvents([](remorse::EntityDispatchEntryBase&,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue