A few small changes to the C++ ITs

A PDP channel number is correct now, the deploy script was changed to
kill Java programs before running and ignore useless messages,
the "Waiting for enable" message is only printed once, and the accelerometer
test is more robust.

Change-Id: I2226140d8c3e44c452e039c27f4f1cf11c952c42
This commit is contained in:
thomasclark
2014-07-24 18:19:43 -04:00
parent 2481e98bc8
commit fdbe750d3d
5 changed files with 19 additions and 15 deletions

View File

@@ -8,8 +8,7 @@
#include "WPILib.h"
#include "gtest/gtest.h"
static constexpr double accelerationTolerance = 0.1;
static constexpr double kAccelerationTolerance = 0.1;
/**
* There's not much we can automatically test with the on-board accelerometer,
* but checking for gravity is probably good enough to tell that it's working.
@@ -17,7 +16,11 @@ static constexpr double accelerationTolerance = 0.1;
TEST(AccelerometerTest, Accelerometer) {
BuiltInAccelerometer accelerometer;
ASSERT_NEAR(0.0, accelerometer.GetX(), accelerationTolerance);
ASSERT_NEAR(0.0, accelerometer.GetY(), accelerationTolerance);
ASSERT_NEAR(1.0, accelerometer.GetZ(), accelerationTolerance);
/* The testbench sometimes shakes a little from a previous test. Give it
some time. */
Wait(1.0);
ASSERT_NEAR(0.0, accelerometer.GetX(), kAccelerationTolerance);
ASSERT_NEAR(0.0, accelerometer.GetY(), kAccelerationTolerance);
ASSERT_NEAR(1.0, accelerometer.GetZ(), kAccelerationTolerance);
}