Proper setting of defines in tests
This commit is contained in:
parent
fd101fe77f
commit
d3381b2950
@ -9,8 +9,12 @@ set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O3")
|
||||
include_directories(tests examples/linux .)
|
||||
|
||||
add_executable(nanomodbus_tests nanomodbus.c tests/nanomodbus_tests.c)
|
||||
|
||||
add_executable(server_disabled nanomodbus.c tests/server_disabled.c)
|
||||
target_compile_definitions(server_disabled PUBLIC NMBS_SERVER_DISABLED)
|
||||
|
||||
add_executable(client_disabled nanomodbus.c tests/client_disabled.c)
|
||||
target_compile_definitions(client_disabled PUBLIC NMBS_CLIENT_DISABLED)
|
||||
|
||||
add_executable(client-tcp nanomodbus.c examples/linux/client-tcp.c)
|
||||
add_executable(server-tcp nanomodbus.c examples/linux/server-tcp.c)
|
||||
|
||||
@ -1,5 +1,3 @@
|
||||
#define NMBS_CLIENT_DISABLED
|
||||
|
||||
#include "nanomodbus.h"
|
||||
|
||||
#define UNUSED_PARAM(x) ((x) = (x))
|
||||
@ -32,7 +30,7 @@ int main() {
|
||||
.write = write_empty,
|
||||
};
|
||||
|
||||
nmbs_callbacks callbacks_empty;
|
||||
nmbs_callbacks callbacks_empty = {0};
|
||||
|
||||
nmbs_error err = nmbs_server_create(&nmbs, 1, &platform_conf_empty, &callbacks_empty);
|
||||
if (err != 0)
|
||||
|
||||
@ -1,5 +1,3 @@
|
||||
#define NMBS_SERVER_DISABLED
|
||||
|
||||
#include "nanomodbus.h"
|
||||
|
||||
#define UNUSED_PARAM(x) ((x) = (x))
|
||||
|
||||
Loading…
Reference in New Issue
Block a user