Kernel improvements (#485)

* **New Features**
  * Added public accessors for querying module/device start and ready state.

* **Refactor**
  * Internal state moved to opaque internal objects; module/device/driver initializers now explicitly initialize internal pointers.
  * Lifecycle handling updated to construct/destruct internal state and use accessors.

* **Tests**
  * Tests updated to use public accessors and explicit construct/destruct lifecycle calls.

* **Chores**
  * Test build/include paths and small metadata updated.
This commit is contained in:
Ken Van Hoeylandt
2026-02-06 16:32:30 +01:00
committed by GitHub
parent 1757af859c
commit 79e43b093a
105 changed files with 338 additions and 331 deletions
@@ -0,0 +1,37 @@
#include "doctest.h"
#include <Tactility/Dispatcher.h>
using namespace tt;
TEST_CASE("dispatcher should not call callback if consume isn't called") {
int counter = 0;
Dispatcher dispatcher;
dispatcher.dispatch([&counter]() { counter++; });
kernel::delayTicks(10);
CHECK_EQ(counter, 0);
}
TEST_CASE("dispatcher should be able to dealloc when message is not consumed") {
auto* dispatcher = new Dispatcher();
auto context = std::make_shared<uint32_t>();
dispatcher->dispatch([]() { /* NO-OP */ });
delete dispatcher;
}
TEST_CASE("dispatcher should call callback when consume is called") {
int counter = 0;
Dispatcher dispatcher;
CHECK_EQ(dispatcher.dispatch([&counter] { counter++; }), true);
CHECK_EQ(dispatcher.consume(100), 1);
CHECK_EQ(counter, 1);
}
TEST_CASE("message should be passed on correctly") {
Dispatcher dispatcher;
dispatcher.dispatch([]() { /* NO-OP */ });
dispatcher.consume(100);
}