Skip to content

Commit ae016fa

Browse files
committed
Fixed infinity loops in tests (c++ vs c scope)
Signed-off-by: Cervenka Dusan <cervenka@acrios.com>
1 parent 1e7218a commit ae016fa

File tree

10 files changed

+932
-176
lines changed

10 files changed

+932
-176
lines changed

.vscode/launch.json

Lines changed: 576 additions & 0 deletions
Large diffs are not rendered by default.

test/common/unit_test_serial_server.cpp

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,17 +96,21 @@ int32_t getServerAllocated()
9696
return result;
9797
}
9898

99-
class Common_server:public Common_interface
99+
class Common_server: public Common_interface
100100
{
101101
public:
102-
void quit()
102+
103+
void quit(void)
103104
{
104-
quit();
105+
::quit();
105106
}
106107

107-
int32_t getServerAllocated()
108+
int32_t getServerAllocated(void)
108109
{
109-
return getServerAllocated();
110+
int32_t result;
111+
result = ::getServerAllocated();
112+
113+
return result;
110114
}
111115
};
112116

test/common/unit_test_tcp_server.cpp

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,17 +105,21 @@ int32_t getServerAllocated()
105105
return result;
106106
}
107107

108-
class Common_server:public Common_interface
108+
class Common_server: public Common_interface
109109
{
110110
public:
111-
void quit()
111+
112+
void quit(void)
112113
{
113-
quit();
114+
::quit();
114115
}
115116

116-
int32_t getServerAllocated()
117+
int32_t getServerAllocated(void)
117118
{
118-
return getServerAllocated();
119+
int32_t result;
120+
result = ::getServerAllocated();
121+
122+
return result;
119123
}
120124
};
121125

test/test_annotations/test_annotations_server_impl.cpp

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,27 +39,34 @@ myInt testIfMyIntAndConstExist(myInt a)
3939
return a;
4040
}
4141

42-
class AnnotateTest_server:public AnnotateTest_interface
42+
class AnnotateTest_server: public AnnotateTest_interface
4343
{
4444
public:
45+
4546
int32_t add(int32_t a, int32_t b)
4647
{
47-
return add(a,b);
48+
int32_t result;
49+
result = ::add(a, b);
50+
51+
return result;
4852
}
4953

50-
void testIfFooStructExist(const fooStruct *a)
54+
void testIfFooStructExist(const fooStruct * a)
5155
{
52-
testIfFooStructExist(a);
56+
::testIfFooStructExist(a);
5357
}
5458

5559
void testIfMyEnumExist(myEnum a)
5660
{
57-
testIfMyEnumExist(a);
61+
::testIfMyEnumExist(a);
5862
}
5963

6064
myInt testIfMyIntAndConstExist(myInt a)
6165
{
62-
return testIfMyIntAndConstExist(a);
66+
myInt result;
67+
result = ::testIfMyIntAndConstExist(a);
68+
69+
return result;
6370
}
6471
};
6572

test/test_arbitrator/test_arbitrator_client_impl.cpp

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -109,18 +109,40 @@ void enableFirstSide()
109109
enabled = true;
110110
}
111111

112-
class SecondInterface_server:public SecondInterface_interface
112+
class SecondInterface_server: public SecondInterface_interface
113113
{
114114
public:
115-
void secondSendInt(int32_t a){secondSendInt(a);}
116115

117-
int32_t secondReceiveInt(void){return secondReceiveInt();}
116+
void secondSendInt(int32_t a)
117+
{
118+
::secondSendInt(a);
119+
}
118120

119-
void quitSecondInterfaceServer(void){quitSecondInterfaceServer();}
121+
int32_t secondReceiveInt(void)
122+
{
123+
int32_t result;
124+
result = ::secondReceiveInt();
120125

121-
void enableFirstSide(void) {enableFirstSide();}
126+
return result;
127+
}
122128

123-
int32_t callFirstSide(void) {return callFirstSide();}
129+
void quitSecondInterfaceServer(void)
130+
{
131+
::quitSecondInterfaceServer();
132+
}
133+
134+
void enableFirstSide(void)
135+
{
136+
::enableFirstSide();
137+
}
138+
139+
int32_t callFirstSide(void)
140+
{
141+
int32_t result;
142+
result = ::callFirstSide();
143+
144+
return result;
145+
}
124146
};
125147

126148
void add_services(erpc::SimpleServer *server)

test/test_arbitrator/test_arbitrator_server_impl.cpp

Lines changed: 59 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -55,26 +55,66 @@ int32_t callSecondSide()
5555
}
5656
}
5757

58-
class FirstInterface_server : public FirstInterface_interface
58+
class FirstInterface_server: public FirstInterface_interface
5959
{
60-
public:
61-
void whenReady(void){};
62-
63-
void firstSendInt(int32_t a) { firstSendInt(a); }
64-
65-
int32_t firstReceiveInt(void) { return firstReceiveInt(); }
66-
67-
void stopSecondSide(void) { stopSecondSide(); }
68-
69-
int32_t getResultFromSecondSide(void) { return getResultFromSecondSide(); }
70-
71-
void testCasesAreDone(void) { testCasesAreDone(); }
72-
73-
void quitFirstInterfaceServer(void) { quitFirstInterfaceServer(); }
74-
75-
int32_t nestedCallTest(void) { return nestedCallTest(); }
76-
77-
int32_t callSecondSide(void) { return callSecondSide(); }
60+
public:
61+
62+
void whenReady(void)
63+
{
64+
::whenReady();
65+
}
66+
67+
void firstSendInt(int32_t a)
68+
{
69+
::firstSendInt(a);
70+
}
71+
72+
int32_t firstReceiveInt(void)
73+
{
74+
int32_t result;
75+
result = ::firstReceiveInt();
76+
77+
return result;
78+
}
79+
80+
void stopSecondSide(void)
81+
{
82+
::stopSecondSide();
83+
}
84+
85+
int32_t getResultFromSecondSide(void)
86+
{
87+
int32_t result;
88+
result = ::getResultFromSecondSide();
89+
90+
return result;
91+
}
92+
93+
void testCasesAreDone(void)
94+
{
95+
::testCasesAreDone();
96+
}
97+
98+
void quitFirstInterfaceServer(void)
99+
{
100+
::quitFirstInterfaceServer();
101+
}
102+
103+
int32_t nestedCallTest(void)
104+
{
105+
int32_t result;
106+
result = ::nestedCallTest();
107+
108+
return result;
109+
}
110+
111+
int32_t callSecondSide(void)
112+
{
113+
int32_t result;
114+
result = ::callSecondSide();
115+
116+
return result;
117+
}
78118
};
79119

80120
void add_services(erpc::SimpleServer *server)

0 commit comments

Comments
 (0)