Migrates AreaEffectSimulation to generated rtiddsgen API
Converts accessor calls to plain member access across aes service and plugin.
This commit is contained in:
102 files changed
+3307
-3313
No files matched your search
+13
-13
@@ -61,8 +61,8 @@ void UnitTestBasics::test_operator_equal_1()
|
||||
AesItemView aesItem1, aesItem2;
|
||||
QVERIFY2(aesItem1 == aesItem2, "AesItemView::operator== failed");
|
||||
|
||||
aesItem1.id(1);
|
||||
aesItem2.id(1);
|
||||
aesItem1.id = 1;
|
||||
aesItem2.id = 1;
|
||||
QVERIFY2(aesItem1 == aesItem2, "AesItemView::operator== failed");
|
||||
|
||||
|
||||
@@ -71,18 +71,18 @@ void UnitTestBasics::test_operator_equal_1()
|
||||
for (int i=1; i< 100; ++i)
|
||||
formVec.emplace_back(Core::GeoPosition(i*0.001, 100/i, 100/i));
|
||||
|
||||
aesItem1.aesItemId(12);
|
||||
aesItem1.sampleTime(12345567);
|
||||
aesItem1.chargeStruct().chargeTypeId(123);
|
||||
aesItem1.effectStart(123456789);
|
||||
aesItem1.form(formVec);
|
||||
aesItem1.boundingBoxBottomLeft(Core::GeoPosition2D(0.1, 0.2));
|
||||
aesItem1.boundingBoxTopRight(Core::GeoPosition2D(1.1, 1.2));
|
||||
aesItem1.aesTypeId(AreaEffectSimulation::AesType_def::AtBoobyTrap);
|
||||
aesItem1.effectStateId(AreaEffectSimulation::AesEffectState_def::EsActivated);
|
||||
aesItem1.partyId(2);
|
||||
aesItem1.aesItemId = 12;
|
||||
aesItem1.sampleTime = 12345567;
|
||||
aesItem1.chargeStruct.chargeTypeId = 123;
|
||||
aesItem1.effectStart = 123456789;
|
||||
aesItem1.form = formVec;
|
||||
aesItem1.boundingBoxBottomLeft = Core::GeoPosition2D(0.1, 0.2);
|
||||
aesItem1.boundingBoxTopRight = Core::GeoPosition2D(1.1, 1.2);
|
||||
aesItem1.aesTypeId = AreaEffectSimulation::AesType::AtBoobyTrap;
|
||||
aesItem1.effectStateId = AreaEffectSimulation::AesEffectState::EsActivated;
|
||||
aesItem1.partyId = 2;
|
||||
|
||||
aesItem1.setId(2334);
|
||||
aesItem1.setId = 2334;
|
||||
|
||||
aesItem2 = aesItem1;
|
||||
QVERIFY2(aesItem1 == aesItem2, "AesItemView::operator== failed");
|
||||
|
||||
+9
-9
@@ -54,19 +54,19 @@ void StateMachineTest::staticTests()
|
||||
const time_t tNow = time(nullptr);
|
||||
|
||||
// newly created, nothing set -> checkEnterNewState() should switch to created
|
||||
QCOMPARE(m_dummyAesObject->checkEnterNewState().underlying(), AesEffectState::EsCreated);
|
||||
QCOMPARE(m_dummyAesObject->checkEnterNewState(), AesEffectState::EsCreated);
|
||||
|
||||
// now we set a activation time -> Prepared
|
||||
m_dummyAesObject->setActivationTime(tNow + 5);
|
||||
QCOMPARE(m_dummyAesObject->checkEnterNewState().underlying(), AesEffectState::EsPrepared);
|
||||
QCOMPARE(m_dummyAesObject->checkEnterNewState(), AesEffectState::EsPrepared);
|
||||
|
||||
// now back to created
|
||||
m_dummyAesObject->setActivationTime(0);
|
||||
QCOMPARE(m_dummyAesObject->checkEnterNewState().underlying(), AesEffectState::EsCreated);
|
||||
QCOMPARE(m_dummyAesObject->checkEnterNewState(), AesEffectState::EsCreated);
|
||||
|
||||
// directly to activated
|
||||
m_dummyAesObject->setActivationTime(tNow);
|
||||
QCOMPARE(m_dummyAesObject->checkEnterNewState().underlying(), AesEffectState::EsActivated);
|
||||
QCOMPARE(m_dummyAesObject->checkEnterNewState(), AesEffectState::EsActivated);
|
||||
|
||||
// pause not possible
|
||||
m_dummyAesObject->setSupportsPausing(false);
|
||||
@@ -89,7 +89,7 @@ void StateMachineTest::staticTests()
|
||||
{
|
||||
QTest::qWait(15);
|
||||
}
|
||||
QCOMPARE(m_dummyAesObject->checkEnterNewState().underlying(), AesEffectState::EsExpired);
|
||||
QCOMPARE(m_dummyAesObject->checkEnterNewState(), AesEffectState::EsExpired);
|
||||
|
||||
// try to delete it
|
||||
QCOMPARE(m_dummyAesObject->trySwitchToRemoved(), false);
|
||||
@@ -102,7 +102,7 @@ void StateMachineTest::staticTests()
|
||||
m_dummyAesObject->setAesEffectState(AesEffectState::EsPaused);
|
||||
QCOMPARE(m_dummyAesObject->trySwitchToRemoved(), true);
|
||||
// an active/paused object must not set to deleted but to expired
|
||||
QCOMPARE(m_dummyAesObject->effectState().underlying(), AesEffectState::EsExpired);
|
||||
QCOMPARE(m_dummyAesObject->effectState(), AesEffectState::EsExpired);
|
||||
QCOMPARE(m_dummyAesObject->trySwitchToCreated(), false);
|
||||
}
|
||||
|
||||
@@ -121,7 +121,7 @@ void StateMachineTest::dynamicTests()
|
||||
m_dummyAesObject->setDurationSec(2);
|
||||
QCOMPARE(m_dummyAesObject->isEndTimeSet(), true);
|
||||
|
||||
QCOMPARE(m_dummyAesObject->checkEnterNewState().underlying(), AesEffectState::EsPrepared);
|
||||
QCOMPARE(m_dummyAesObject->checkEnterNewState(), AesEffectState::EsPrepared);
|
||||
QCOMPARE(spy.count(), 2); // Created, Prepared
|
||||
spy.clear();
|
||||
|
||||
@@ -132,7 +132,7 @@ void StateMachineTest::dynamicTests()
|
||||
if (m_dummyAesObject->effectState() == AesEffectState::EsActivated)
|
||||
break;
|
||||
}
|
||||
QCOMPARE(m_dummyAesObject->effectState().underlying(), AesEffectState::EsActivated);
|
||||
QCOMPARE(m_dummyAesObject->effectState(), AesEffectState::EsActivated);
|
||||
|
||||
qDebug() << "Waiting for end time";
|
||||
for (int i = 0; i < 200; ++i)
|
||||
@@ -142,7 +142,7 @@ void StateMachineTest::dynamicTests()
|
||||
break;
|
||||
}
|
||||
AreaEffectSimulation::AesEffectState state = m_dummyAesObject->effectState();
|
||||
QCOMPARE(state.underlying(), AesEffectState::EsExpired);
|
||||
QCOMPARE(state, AesEffectState::EsExpired);
|
||||
|
||||
QCOMPARE(spy.count(), 2); // Activated, Done
|
||||
spy.clear();
|
||||
|
||||
Reference in new issue
Block a user