Skip to content

Commit 8fb915e

Browse files
Merge pull request #229 from ACRIOS-Systems/bugfix/fix_linux_tests
Fixed making test under Linux
2 parents cfd2b9a + 23cf5d4 commit 8fb915e

File tree

18 files changed

+76
-48
lines changed

18 files changed

+76
-48
lines changed

erpc_c/port/erpc_config_internal.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,12 @@
7070
#if ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_STATIC
7171
#if !defined(ERPC_CODEC_COUNT)
7272
#define ERPC_CODEC_COUNT (2U)
73-
#warning "ERPC_CODEC_COUNT is not defined. Default is used."
7473
#endif
7574
#if !defined(ERPC_MESSAGE_LOGGERS_COUNT)
7675
#define ERPC_MESSAGE_LOGGERS_COUNT (0U)
77-
#warning "ERPC_MESSAGE_LOGGERS_COUNT is not defined. Default is used."
7876
#endif
7977
#if !defined(ERPC_CLIENTS_THREADS_AMOUNT)
8078
#define ERPC_CLIENTS_THREADS_AMOUNT (1U)
81-
#warning "ERPC_CLIENTS_THREADS_AMOUNT is not defined. Default is used."
8279
#endif
8380
#endif
8481

erpcgen/src/templates/c_server_header.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ typedef void * erpc_service_t;
5151
erpc_service_t create_{$iface.serviceClassName}(void);
5252

5353
#if ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_DYNAMIC
54-
void destroy_{$iface.serviceClassName}(erpc_service_t *service);
54+
void destroy_{$iface.serviceClassName}(erpc_service_t service);
5555
#elif ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_STATIC
5656
void destroy_{$iface.serviceClassName}(void);
5757
#else

erpcgen/src/templates/c_server_source.template

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,11 +250,11 @@ erpc_service_t create_{$iface.serviceClassName}()
250250
return new (nothrow) {$iface.serviceClassName}();
251251
}
252252

253-
void destroy_{$iface.serviceClassName}(erpc_service_t *service)
253+
void destroy_{$iface.serviceClassName}(erpc_service_t service)
254254
{
255-
if (*service)
255+
if (service)
256256
{
257-
delete service;
257+
delete ({$iface.serviceClassName} *)service;
258258
}
259259
}
260260
#elif ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_STATIC

erpcgen/test/test_dynamic_ann_c.yml

Lines changed: 0 additions & 17 deletions
This file was deleted.

erpcgen/test/test_service_c.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
name: static
3+
desc: dynamic annotation is not used.
4+
idl: |
5+
program test
6+
7+
interface ErrorTest{
8+
oneway f()
9+
}
10+
11+
test_server.h:
12+
- erpc_service_t create_ErrorTest_service(void);
13+
14+
- "#if ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_DYNAMIC"
15+
- void destroy_ErrorTest_service(erpc_service_t service);
16+
- "#elif ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_STATIC"
17+
- void destroy_ErrorTest_service(void);
18+
- "#else"
19+
- "#warning \"Unknown eRPC allocation policy!\""
20+
- "#endif"
21+
22+
test_server.cpp:
23+
- ERPC_MANUALLY_CONSTRUCTED_STATIC(ErrorTest_service, s_ErrorTest_service);
24+
- "#if ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_DYNAMIC"
25+
- erpc_service_t create_ErrorTest_service()
26+
- "{"
27+
- return new (nothrow) ErrorTest_service();
28+
- "}"
29+
- void destroy_ErrorTest_service(erpc_service_t service)
30+
- "{"
31+
- if (service)
32+
- "{"
33+
- delete (ErrorTest_service *)service;
34+
- "}"
35+
- "}"
36+
- "#elif ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_STATIC"
37+
- erpc_service_t create_ErrorTest_service()
38+
- "{"
39+
- s_ErrorTest_service.construct();
40+
- return s_ErrorTest_service.get();
41+
- "}"
42+
- void destroy_ErrorTest_service()
43+
- "{"
44+
- s_ErrorTest_service.destroy();
45+
- "}"
46+
- "#else"
47+
- "#warning \"Unknown eRPC allocation policy!\""
48+
- "#endif"

test/common/config/erpc_config.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@
146146
//! ERPC_MESSAGE_LOGGING_DISABLED.
147147
//!
148148
//! Uncomment for using logging feature.
149-
#define ERPC_MESSAGE_LOGGING (ERPC_MESSAGE_LOGGING_ENABLED)
149+
// #define ERPC_MESSAGE_LOGGING (ERPC_MESSAGE_LOGGING_ENABLED)
150150

151151
//! @def ERPC_TRANSPORT_MU_USE_MCMGR
152152
//!

test/test_arbitrator/config/erpc_config.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@
145145
//! ERPC_MESSAGE_LOGGING_DISABLED.
146146
//!
147147
//! Uncomment for using logging feature.
148-
#define ERPC_MESSAGE_LOGGING (ERPC_MESSAGE_LOGGING_ENABLED)
148+
// #define ERPC_MESSAGE_LOGGING (ERPC_MESSAGE_LOGGING_ENABLED)
149149

150150
//! @def ERPC_TRANSPORT_MU_USE_MCMGR
151151
//!

test/test_arrays/test_arrays_server_impl.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ void remove_services_from_server()
417417
{
418418
erpc_remove_service_from_server(service_test);
419419
#if ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_DYNAMIC
420-
destroy_PointersService_service((erpc_service_t *)service_test);
420+
destroy_PointersService_service(service_test);
421421
#elif ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_STATIC
422422
destroy_PointersService_service();
423423
#endif
@@ -427,7 +427,7 @@ void remove_common_services_from_server(erpc_service_t service)
427427
{
428428
erpc_remove_service_from_server(service);
429429
#if ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_DYNAMIC
430-
destroy_Common_service((erpc_service_t *)service);
430+
destroy_Common_service(service);
431431
#elif ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_STATIC
432432
destroy_Common_service();
433433
#endif

test/test_binary/test_binary_server_impl.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ void remove_services_from_server()
117117
{
118118
erpc_remove_service_from_server(service_test);
119119
#if ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_DYNAMIC
120-
destroy_Binary_service((erpc_service_t *)service_test);
120+
destroy_Binary_service(service_test);
121121
#elif ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_STATIC
122122
destroy_Binary_service();
123123
#endif
@@ -127,7 +127,7 @@ void remove_common_services_from_server(erpc_service_t service)
127127
{
128128
erpc_remove_service_from_server(service);
129129
#if ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_DYNAMIC
130-
destroy_Common_service((erpc_service_t *)service);
130+
destroy_Common_service(service);
131131
#elif ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_STATIC
132132
destroy_Common_service();
133133
#endif

test/test_builtin/test_builtin_server_impl.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ void remove_services_from_server()
193193
{
194194
erpc_remove_service_from_server(service_test);
195195
#if ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_DYNAMIC
196-
destroy_BuiltinServices_service((erpc_service_t *)service_test);
196+
destroy_BuiltinServices_service(service_test);
197197
#elif ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_STATIC
198198
destroy_BuiltinServices_service();
199199
#endif
@@ -203,7 +203,7 @@ void remove_common_services_from_server(erpc_service_t service)
203203
{
204204
erpc_remove_service_from_server(service);
205205
#if ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_DYNAMIC
206-
destroy_Common_service((erpc_service_t *)service);
206+
destroy_Common_service(service);
207207
#elif ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_STATIC
208208
destroy_Common_service();
209209
#endif

0 commit comments

Comments
 (0)