Initial commit
This commit is contained in:
commit
b7d90b9afe
16245 files changed
+3396666
No files matched your search
@@ -0,0 +1,60 @@
|
||||
/**
|
||||
* Unittest for testing the statemachine for aes objects
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AreaEffectSimulation/object_base.h>
|
||||
|
||||
namespace AreaEffectSimulation
|
||||
{
|
||||
class DummyAesObject final: public ObjectBaseTmpl<Database::AesNContamination>
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit DummyAesObject(QObject *parent = nullptr);
|
||||
|
||||
void setAesEffectState(AesEffectState newState) { m_data.effectStateId = newState; }
|
||||
void setSupportsPausing(bool bSupportsPausing) { m_bSupportsPausing = bSupportsPausing; }
|
||||
void setActivationTime(time_t actTime)
|
||||
{
|
||||
if (actTime)
|
||||
m_data.effectStart = QDateTime::fromMSecsSinceEpoch(actTime * 1000LL);
|
||||
else
|
||||
m_data.effectStart = QDateTime();
|
||||
}
|
||||
void setDurationSec(int durationSec)
|
||||
{
|
||||
m_data.effectDuration = durationSec * 1000;
|
||||
}
|
||||
qint64 partitionTimeMSec() const override
|
||||
{
|
||||
return partitionTime().toMSecsSinceEpoch();
|
||||
}
|
||||
QDateTime partitionTime() const override
|
||||
{
|
||||
return QDateTime::currentDateTimeUtc();
|
||||
}
|
||||
std::vector<Core::GeoPosition> form() const override { return {}; }
|
||||
QPolygonF generateForm() override;
|
||||
AesType aesType() const override { return AesType::AtUnknown; }
|
||||
bool isCentral() const override { return m_data.isCentral; }
|
||||
};
|
||||
|
||||
class StateMachineTest : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
StateMachineTest();
|
||||
~StateMachineTest();
|
||||
private Q_SLOTS:
|
||||
void staticTests();
|
||||
void dynamicTests();
|
||||
|
||||
private:
|
||||
DummyAesObject *m_dummyAesObject;
|
||||
};
|
||||
} // namespace AreaEffectSimulation
|
||||
Reference in new issue
Block a user