mirror of
https://github.com/open62541/open62541.git
synced 2025-06-03 04:00:21 +00:00
feat(tests): Enable first unit tests to lwip as the architecture
This commit is contained in:
parent
f0ff49ebcf
commit
79a4a19808
@ -33,7 +33,14 @@ createEvents(UA_UInt32 events) {
|
||||
}
|
||||
|
||||
START_TEST(benchmarkTimer) {
|
||||
#if defined(UA_ARCHITECTURE_POSIX)
|
||||
el = UA_EventLoop_new_POSIX(NULL);
|
||||
#elif defined(UA_ARCHITECTURE_LWIP)
|
||||
el = UA_EventLoop_new_LWIP(NULL);
|
||||
#else
|
||||
#error Add other EventLoop implementations here
|
||||
#endif
|
||||
|
||||
createEvents(N_EVENTS);
|
||||
|
||||
clock_t begin = clock();
|
||||
|
@ -13,11 +13,26 @@
|
||||
#include <check.h>
|
||||
|
||||
static UA_EventLoop *el;
|
||||
static UA_ConnectionManager *cm;
|
||||
static unsigned connCount;
|
||||
static char *testMsg = "open62541";
|
||||
static uintptr_t clientId;
|
||||
static UA_Boolean received;
|
||||
|
||||
static void setupEL(void) {
|
||||
#if defined(UA_ARCHITECTURE_POSIX)
|
||||
el = UA_EventLoop_new_POSIX(UA_Log_Stdout);
|
||||
cm = UA_ConnectionManager_new_POSIX_TCP(UA_STRING("tcpCM"));
|
||||
el->registerEventSource(el, &cm->eventSource);
|
||||
#elif defined(UA_ARCHITECTURE_LWIP)
|
||||
el = UA_EventLoop_new_LWIP(UA_Log_Stdout);
|
||||
cm = UA_ConnectionManager_new_LWIP_TCP(UA_STRING("tcpCM"));
|
||||
el->registerEventSource(el, &cm->eventSource);
|
||||
#else
|
||||
#error Add other EventLoop implementations here
|
||||
#endif
|
||||
}
|
||||
|
||||
static void
|
||||
connectionCallback(UA_ConnectionManager *cm, uintptr_t connectionId,
|
||||
void *application, void **connectionContext,
|
||||
@ -53,9 +68,7 @@ connectionCallback(UA_ConnectionManager *cm, uintptr_t connectionId,
|
||||
}
|
||||
|
||||
START_TEST(listenTCP) {
|
||||
UA_ConnectionManager *cm = UA_ConnectionManager_new_POSIX_TCP(UA_STRING("tcpCM"));
|
||||
el = UA_EventLoop_new_POSIX(UA_Log_Stdout);
|
||||
el->registerEventSource(el, &cm->eventSource);
|
||||
setupEL();
|
||||
el->start(el);
|
||||
|
||||
UA_UInt16 port = 4840;
|
||||
@ -99,9 +112,7 @@ START_TEST(listenTCP) {
|
||||
} END_TEST
|
||||
|
||||
START_TEST(connectTCP) {
|
||||
UA_ConnectionManager *cm = UA_ConnectionManager_new_POSIX_TCP(UA_STRING("tcpCM"));
|
||||
el = UA_EventLoop_new_POSIX(UA_Log_Stdout);
|
||||
el->registerEventSource(el, &cm->eventSource);
|
||||
setupEL();
|
||||
el->start(el);
|
||||
|
||||
UA_UInt16 port = 4840;
|
||||
|
Loading…
Reference in New Issue
Block a user