Skip to content

Commit ef43a1c

Browse files
prepare for QP v8.x.x, adjust internal code to v7+ QP API
1 parent f702948 commit ef43a1c

File tree

5 files changed

+13
-9
lines changed

5 files changed

+13
-9
lines changed

cpputest-for-qpcpp-lib/include/cmsDummyActiveObject.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ class DummyActiveObject : public QP::QActive {
134134
static QP::QState initial(DummyActiveObject* const me,
135135
QP::QEvt const* const)
136136
{
137-
return Q_TRAN(&running);
137+
return me->tran(Q_STATE_CAST(&running));
138138
}
139139

140140
static QP::QState running(DummyActiveObject* const me,
@@ -143,7 +143,7 @@ class DummyActiveObject : public QP::QActive {
143143
QP::QState rtn;
144144
switch (e->sig) {
145145
case Q_INIT_SIG:
146-
rtn = Q_SUPER(&top);
146+
rtn = me->super(&top);
147147
break;
148148
case Q_ENTRY_SIG: // purposeful fall through
149149
case Q_EXIT_SIG:
@@ -153,7 +153,7 @@ class DummyActiveObject : public QP::QActive {
153153
if ((me->m_eventHandler != nullptr) && (e->sig != 0)) {
154154
me->m_eventHandler(e);
155155
}
156-
rtn = Q_SUPER(&top);
156+
rtn = me->super(&top);
157157
break;
158158
}
159159

cpputest-for-qpcpp-lib/include/cmsOrthogonalContainer.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ class OrthogonalContainer : public QP::QActive {
7878
{
7979
ForEachInTuple(me->m_components,
8080
[](auto& component) { component.start(); });
81-
return Q_TRAN(&running);
81+
return me->tran(Q_STATE_CAST(&running));
8282
}
8383

8484
static QP::QState running(OrthogonalContainer* const me,
@@ -102,7 +102,7 @@ class OrthogonalContainer : public QP::QActive {
102102
rtn = Q_HANDLED();
103103
}
104104
else {
105-
rtn = Q_SUPER(&top);
105+
rtn = me->super(&top);
106106
}
107107
} break;
108108
}

cpputest-for-qpcpp-lib/include/qp_port.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111
#include "qp_config.hpp" // external QP configuration
1212
#endif
1313

14+
#ifndef QP_API_VERSION
15+
#define QP_API_VERSION 700 //cpputest for qpcpp support v7.x.x and v8.x.x
16+
#endif
17+
1418
// no-return function specifier (C++11 Standard)
1519
// removed due to certain cpputest test functions
1620
#define Q_NORETURN void

cpputest-for-qpcpp-lib/tests/orthogonalComponentTests.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ class TestComponent : public OrthogonalComponent {
7878

7979
static QP::QState initial(TestComponent* const me, QP::QEvt const* const)
8080
{
81-
return Q_TRAN(&running);
81+
return me->tran(Q_STATE_CAST(&running));
8282
}
8383

8484
static QP::QState running(TestComponent* const me, QP::QEvt const* const e)
@@ -109,7 +109,7 @@ class TestComponent : public OrthogonalComponent {
109109
rtn = Q_HANDLED();
110110
break;
111111
default:
112-
rtn = Q_SUPER(&top);
112+
rtn = me->super(&top);
113113
break;
114114
}
115115
return rtn;

cpputest-for-qpcpp-lib/tests/orthogonalContainerTests.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ class TestComponent : public OrthogonalComponent {
104104

105105
static QP::QState initial(TestComponent* const me, QP::QEvt const* const)
106106
{
107-
return Q_TRAN(&running);
107+
return me->tran(Q_STATE_CAST(&running));
108108
}
109109

110110
static QP::QState running(TestComponent* const me, QP::QEvt const* const e)
@@ -144,7 +144,7 @@ class TestComponent : public OrthogonalComponent {
144144
rtn = Q_HANDLED();
145145
break;
146146
default:
147-
rtn = Q_SUPER(&top);
147+
rtn = me->super(&top);
148148
break;
149149
}
150150
return rtn;

0 commit comments

Comments
 (0)