Move tests to relevant subprojects (#615)
- Moved test projects to the parent project they belong to - Improved test stability/corectness - Improved recursive directory deletion by safely ignoring current- and parent-directory entries. - Update docs
This commit is contained in:
committed by
GitHub
parent
d6b1d15e56
commit
f943c4dd69
@@ -0,0 +1,25 @@
|
||||
#include "doctest.h"
|
||||
#include <tactility/freertos/task.h>
|
||||
#include <tactility/concurrent/dispatcher.h>
|
||||
|
||||
TEST_CASE("dispatcher test") {
|
||||
DispatcherHandle_t dispatcher = dispatcher_alloc();
|
||||
CHECK_NE(dispatcher, nullptr);
|
||||
|
||||
int count = 0;
|
||||
auto error = dispatcher_dispatch(dispatcher, &count, [](void* context) {
|
||||
int* count_ptr = static_cast<int*>(context);
|
||||
(*count_ptr)++;
|
||||
});
|
||||
|
||||
CHECK_EQ(error, ERROR_NONE);
|
||||
vTaskDelay(1);
|
||||
|
||||
CHECK_EQ(count, 0);
|
||||
|
||||
CHECK_EQ(dispatcher_consume(dispatcher), ERROR_NONE);
|
||||
CHECK_EQ(count, 1);
|
||||
|
||||
dispatcher_free(dispatcher);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user