mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-28 02:11:43 +00:00
Major formatting changes (breaks diffs). No code changes.
The changes made in this commit do not affect any actual code,
they are purely aesthetic. I ran clang-format with google style
over all .h/.cpp files in wpilibc that weren't in wpilibC++Sim
or gtest, and the eclipse formatter over all of the Java files
using the Google eclipse formatting configuration.
Change-Id: I9627bca0bc103c398ecc1c5ba17467193291ae63
This commit is contained in:
@@ -12,34 +12,27 @@
|
||||
static const double kWaitTime = 0.5;
|
||||
|
||||
class TimerTest : public testing::Test {
|
||||
protected:
|
||||
Timer *m_timer;
|
||||
|
||||
virtual void SetUp() override {
|
||||
m_timer = new Timer;
|
||||
}
|
||||
|
||||
virtual void TearDown() override {
|
||||
delete m_timer;
|
||||
}
|
||||
|
||||
void Reset() {
|
||||
m_timer->Reset();
|
||||
}
|
||||
protected:
|
||||
Timer *m_timer;
|
||||
|
||||
virtual void SetUp() override { m_timer = new Timer; }
|
||||
|
||||
virtual void TearDown() override { delete m_timer; }
|
||||
|
||||
void Reset() { m_timer->Reset(); }
|
||||
};
|
||||
|
||||
/**
|
||||
* Test if the Wait function works
|
||||
*/
|
||||
TEST_F(TimerTest, Wait) {
|
||||
Reset();
|
||||
|
||||
double initialTime = m_timer->GetFPGATimestamp();
|
||||
|
||||
Wait(kWaitTime);
|
||||
|
||||
double finalTime = m_timer->GetFPGATimestamp();
|
||||
|
||||
EXPECT_NEAR(kWaitTime, finalTime - initialTime, 0.001);
|
||||
}
|
||||
Reset();
|
||||
|
||||
double initialTime = m_timer->GetFPGATimestamp();
|
||||
|
||||
Wait(kWaitTime);
|
||||
|
||||
double finalTime = m_timer->GetFPGATimestamp();
|
||||
|
||||
EXPECT_NEAR(kWaitTime, finalTime - initialTime, 0.001);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user