RoboidControl-cpp/test/thing_test.cc
2025-02-28 17:55:25 +01:00

40 lines
911 B
C++

#if GTEST
// #include <gmock/gmock.h>
// not supported using Visual Studio 2022 compiler...
#include <gtest/gtest.h>
#include "LocalParticipant.h"
#include "Thing.h"
using namespace RoboidControl;
TEST(RoboidControlSuite, HiddenParticipant) {
Thing* thing = new Thing();
unsigned long milliseconds = Thing::GetTimeMs();
unsigned long startTime = milliseconds;
while (milliseconds < startTime + 1000) {
Thing::UpdateThings(milliseconds);
milliseconds = Thing::GetTimeMs();
}
SUCCEED();
}
TEST(RoboidControlSuite, IsolatedParticipant) {
LocalParticipant* participant = LocalParticipant::Isolated();
Thing* thing = new Thing(participant);
unsigned long milliseconds = Thing::GetTimeMs();
unsigned long startTime = milliseconds;
while (milliseconds < startTime + 1000) {
participant->Update(milliseconds);
milliseconds = Thing::GetTimeMs();
}
SUCCEED();
}
#endif